use of org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertAdHocSubProcess.
private BpmnNode convertAdHocSubProcess(org.eclipse.bpmn2.AdHocSubProcess subProcess) {
Node<View<AdHocSubprocess>, Edge> node = factoryManager.newNode(subProcess.getId(), AdHocSubprocess.class);
AdHocSubprocess definition = node.getContent().getDefinition();
AdHocSubProcessPropertyReader p = propertyReaderFactory.of(subProcess);
definition.setGeneral(new BPMNGeneralSet(new Name(subProcess.getName()), new Documentation(p.getDocumentation())));
definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables())));
definition.setExecutionSet(new AdHocSubprocessTaskExecutionSet(new AdHocCompletionCondition(p.getAdHocCompletionCondition()), new AdHocOrdering(p.getAdHocOrdering()), new OnEntryAction(p.getOnEntryAction()), new OnExitAction(p.getOnExitAction())));
definition.setSimulationSet(p.getSimulationSet());
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertEventSubprocessNode.
private BpmnNode convertEventSubprocessNode(SubProcess subProcess) {
Node<View<EventSubprocess>, Edge> node = factoryManager.newNode(subProcess.getId(), EventSubprocess.class);
EventSubprocess definition = node.getContent().getDefinition();
SubProcessPropertyReader p = propertyReaderFactory.of(subProcess);
definition.setGeneral(new BPMNGeneralSet(new Name(subProcess.getName()), new Documentation(p.getDocumentation())));
definition.getIsAsync().setValue(p.isAsync());
definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables())));
definition.setSimulationSet(p.getSimulationSet());
definition.setDimensionsSet(p.getRectangleDimensionsSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
node.getContent().setBounds(p.getBounds());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallIsInterruptingStartErrorEvent.
@Test
public void testUnmarshallIsInterruptingStartErrorEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTERROREVENT);
assertDiagram(diagram, 7);
assertEquals("EventSubprocessStartErrorEvent", diagram.getMetadata().getTitle());
// Check first start event with all FILLED properties
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("9ABD5C04-C6E2-4DF3-829F-ADB283330AD6");
StartErrorEvent startErrorEvent = (StartErrorEvent) startEventNode.getContent().getDefinition();
BPMNGeneralSet eventGeneralSet = startErrorEvent.getGeneral();
assertNotNull(eventGeneralSet);
assertEquals("StartErrorEvent", eventGeneralSet.getName().getValue());
assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
InterruptingErrorEventExecutionSet eventExecutionSet = startErrorEvent.getExecutionSet();
assertNotNull(eventExecutionSet);
assertNotNull(eventExecutionSet.getErrorRef());
assertEquals("Error1", eventExecutionSet.getErrorRef().getValue());
assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
DataIOSet eventDataIOSet = startErrorEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
// Check second start event with all EMPTY properties
Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("50B93E5E-C05D-40DD-BF48-2B6AE919763E");
StartErrorEvent emptyErrorEvent = (StartErrorEvent) emptyEventNode.getContent().getDefinition();
BPMNGeneralSet emptyEventGeneralSet = emptyErrorEvent.getGeneral();
assertNotNull(emptyEventGeneralSet);
assertEquals("", emptyEventGeneralSet.getName().getValue());
assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
InterruptingErrorEventExecutionSet emptyExecutionSet = emptyErrorEvent.getExecutionSet();
assertNotNull(emptyExecutionSet);
assertNotNull(emptyExecutionSet.getErrorRef());
assertEquals("", emptyExecutionSet.getErrorRef().getValue());
assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
DataIOSet emptyDataIOSet = emptyErrorEvent.getDataIOSet();
AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
assertEquals("", emptyAssignmentsInfo.getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallReusableSubprocess.
@Test
public void testUnmarshallReusableSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_REUSABLE_SUBPROCESS);
ReusableSubprocess reusableSubprocess = null;
Iterator<Element> it = nodesIterator(diagram);
while (it.hasNext()) {
Element element = it.next();
if (element.getContent() instanceof View) {
Object oDefinition = ((View) element.getContent()).getDefinition();
if (oDefinition instanceof ReusableSubprocess) {
reusableSubprocess = (ReusableSubprocess) oDefinition;
break;
}
}
}
assertNotNull(reusableSubprocess);
assertNotNull(reusableSubprocess.getExecutionSet());
assertNotNull(reusableSubprocess.getExecutionSet().getCalledElement());
assertNotNull(reusableSubprocess.getGeneral());
BPMNGeneralSet generalSet = reusableSubprocess.getGeneral();
ReusableSubprocessTaskExecutionSet executionSet = reusableSubprocess.getExecutionSet();
assertNotNull(generalSet);
assertNotNull(executionSet);
assertEquals("my subprocess", generalSet.getName().getValue());
assertEquals("my-called-element", executionSet.getCalledElement().getValue());
assertEquals(false, executionSet.getIndependent().getValue());
assertEquals(false, executionSet.getWaitForCompletion().getValue());
String assignmentsInfo = reusableSubprocess.getDataIOSet().getAssignmentsinfo().getValue();
assertEquals("|input1:String,input2:Float||output1:String,output2:Float|[din]pv1->input1,[din]pv2->input2,[dout]output1->pv1,[dout]output2->pv2", assignmentsInfo);
assertEquals("true", reusableSubprocess.getExecutionSet().getIsAsync().getValue().toString());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.general.BPMNGeneralSet in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallIsInterruptingStartMessageEvent.
@Test
public void testUnmarshallIsInterruptingStartMessageEvent() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS_STARTMESSAGEEVENT);
assertDiagram(diagram, 7);
assertEquals("EventSubprocessStartMessageEvent", diagram.getMetadata().getTitle());
// Check first start event with all FILLED properties
Node<? extends Definition, ?> startEventNode = diagram.getGraph().getNode("_77E79714-F32A-4BE7-B0D2-15178F5244F0");
StartMessageEvent startMessageEvent = (StartMessageEvent) startEventNode.getContent().getDefinition();
BPMNGeneralSet eventGeneralSet = startMessageEvent.getGeneral();
assertNotNull(eventGeneralSet);
assertEquals("StartMessageEvent", eventGeneralSet.getName().getValue());
assertEquals("Some not empty\nDocumentation\n~`!@#$%^&*()_+=-{}|[]\\:\";'<>/?.,", eventGeneralSet.getDocumentation().getValue());
InterruptingMessageEventExecutionSet eventExecutionSet = startMessageEvent.getExecutionSet();
assertNotNull(eventExecutionSet);
assertNotNull(eventExecutionSet.getMessageRef());
assertEquals("Message1", eventExecutionSet.getMessageRef().getValue());
assertEquals(true, eventExecutionSet.getIsInterrupting().getValue());
DataIOSet eventDataIOSet = startMessageEvent.getDataIOSet();
AssignmentsInfo assignmentsInfo = eventDataIOSet.getAssignmentsinfo();
assertEquals("||Var1:String||[dout]Var1->Var1", assignmentsInfo.getValue());
// Check second start event with all EMPTY properties
Node<? extends Definition, ?> emptyEventNode = diagram.getGraph().getNode("_E4563AE4-5F70-4283-A5AC-C9AB14F15EBA");
StartMessageEvent emptyMessageEvent = (StartMessageEvent) emptyEventNode.getContent().getDefinition();
BPMNGeneralSet emptyEventGeneralSet = emptyMessageEvent.getGeneral();
assertNotNull(emptyEventGeneralSet);
assertEquals("", emptyEventGeneralSet.getName().getValue());
assertEquals("", emptyEventGeneralSet.getDocumentation().getValue());
InterruptingMessageEventExecutionSet emptyExecutionSet = emptyMessageEvent.getExecutionSet();
assertNotNull(emptyExecutionSet);
assertNotNull(emptyExecutionSet.getMessageRef());
assertEquals("", emptyExecutionSet.getMessageRef().getValue());
assertEquals(false, emptyExecutionSet.getIsInterrupting().getValue());
DataIOSet emptyDataIOSet = emptyMessageEvent.getDataIOSet();
AssignmentsInfo emptyAssignmentsInfo = emptyDataIOSet.getAssignmentsinfo();
assertEquals("", emptyAssignmentsInfo.getValue());
}
Aggregations