In memory 2 sequence flow created while loading the resource file. [message #1747234] |
Fri, 11 November 2016 05:31 |
Rakesh Kumar Shah Messages: 9 Registered: April 2016 |
Junior Member |
|
|
Hi,
I am facing a strange problem and debugging to figure out the root cause.
Following is a problem.
1. I created completely custom model for our need and created custom task for respective Business Object.
2. Everything is going fine as per the sample and document.
Following are the steps of the issue production.
1.Create a brand new bpmn file and add few activities to the file.
2. Save the file and close the bpmn file editor.
3. Now double click and reopen the same file, RuntimeExtension will get a call back on notify() reference implementation snippet is following.
4. Now in the file modify any change and save the file.
5. Reopen the file, will get Orphan SequenceFlow error consistently.
Following is a bpmn file content for reference created first time and saved.
<?xml version="1.0" encoding="UTF-8"?>
<!-- origin at X=0.0 Y=0.0 -->
<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:ot="http://www.opentext.com/bpmn2" xmlns:tl="http://www.w3.org/2001/XMLSchema" id="Definitions_1" exporter="org.eclipse.bpmn2.modeler.core" exporterVersion="1.1.6" targetNamespace="http://www.opentext.com/bpmn2">
<bpmn2:process id="process_1" name="Default Process" isExecutable="false">
<bpmn2:startEvent id="StartEvent_1" name="UntitledWorkflow">
<bpmn2:outgoing>SequenceFlow_1</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:userTask id="UserTask_1" ot:wemType="ManualActivity" name="ManualActivity_1">
<bpmn2:extensionElements>
<ot:wemManualActivity xsi:type="ot:ManualActivity">
<ot:outputData xsi:type="ot:OutputData" name="vgnTaskAssignee" dataType="USER" description="The user who accepts this task"/>
<ot:timeLine/>
</ot:wemManualActivity>
</bpmn2:extensionElements>
<bpmn2:incoming>SequenceFlow_1</bpmn2:incoming>
</bpmn2:userTask>
<bpmn2:sequenceFlow id="SequenceFlow_1" sourceRef="StartEvent_1" targetRef="UserTask_1">
<bpmn2:extensionElements>
<ot:wemSequenceFlow>
<condition xsi:type="ot:Condition"/>
</ot:wemSequenceFlow>
</bpmn2:extensionElements>
</bpmn2:sequenceFlow>
</bpmn2:process>
Now reopening the same file, I will be notified with the following event.
@Override
public void notify(LifecycleEvent event) {
if(LifecycleEvent.EventType.EDITOR_INITIALIZED.compareTo(event.eventType) == 0){
System.out.println("Editor is initialized.. "+event);
DesignEditor editor = (DesignEditor) event.target;
Bpmn2ResourceImpl resource = editor.getModelHandler().getResource();
TreeIterator<EObject> contents = resource.getAllContents();
while(contents.hasNext()){
EObject object = contents.next();
if(object instanceof StartEvent){
StartEvent startEvent = (StartEvent) object;
int size = startEvent.getOutgoing().size();
System.out.println(startEvent.getOutgoing().size()); // Here it print value 2 instead of 1 on console
if(size > 1){
//startEvent.getOutgoing().remove(1);
}
}else if(object instanceof UserTask){
UserTask userTask = (UserTask) object;
System.out.println(userTask.getOutgoing().size());
System.out.println(userTask.getIncoming().size());
}
All information in both the SequenceFlow object is same, like sourceRef and targetRef, id but the only difference is extensionAttributeValue is available in the second object and first object is missing this information.
Let me know if anybody has pointer on this. I am struggling with this. We are approaching the deadline of release.
Thanks in advance.
-Rakesh
|
|
|
Powered by
FUDForum. Page generated in 0.03861 seconds