use of org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertEventSubprocessNode.
private SubProcessPropertyWriter convertEventSubprocessNode(Node<View<EventSubprocess>, ?> n) {
SubProcess process = bpmn2.createSubProcess();
process.setId(n.getUUID());
SubProcessPropertyWriter p = propertyWriterFactory.of(process);
EventSubprocess definition = n.getContent().getDefinition();
process.setTriggeredByEvent(true);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
ProcessData processData = definition.getProcessData();
p.setProcessVariables(processData.getProcessVariables());
p.setSimulationSet(definition.getSimulationSet());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess in project kie-wb-common by kiegroup.
the class BPMNDiagramMarshallerTest method testUnmarshallEventSubprocess.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEventSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS);
assertDiagram(diagram, 2);
assertEquals("EventSubProcess", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> eventSubprocessNode = diagram.getGraph().getNode("_DF031493-5F1C-4D2B-9916-2FEABB1FADFF");
EventSubprocess eventSubprocess = (EventSubprocess) eventSubprocessNode.getContent().getDefinition();
assertTrue(eventSubprocess.getIsAsync().getValue());
assertEquals("Var1:String", eventSubprocess.getProcessData().getProcessVariables().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess 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.EventSubprocess in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallEventSubprocess.
@Test
@SuppressWarnings("unchecked")
public void testUnmarshallEventSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_EVENT_SUBPROCESS);
assertDiagram(diagram, 2);
assertEquals("EventSubProcess", diagram.getMetadata().getTitle());
Node<? extends Definition, ?> eventSubprocessNode = diagram.getGraph().getNode("_DF031493-5F1C-4D2B-9916-2FEABB1FADFF");
EventSubprocess eventSubprocess = (EventSubprocess) eventSubprocessNode.getContent().getDefinition();
assertTrue(eventSubprocess.getIsAsync().getValue());
assertEquals(eventSubprocess.getProcessData().getProcessVariables().getValue(), "Var1:String");
}
use of org.kie.workbench.common.stunner.bpmn.definition.EventSubprocess in project kie-wb-common by kiegroup.
the class StartEventFilterProviderFactoryTest method setUp.
@Before
public void setUp() throws Exception {
inEdges = Arrays.asList(edge);
eventSubprocess = new EventSubprocess();
otherNode = new MultipleInstanceSubprocess();
when(sessionManager.getCurrentSession()).thenReturn(session);
when(session.getCanvasHandler()).thenReturn(canvasHandler);
when(canvasHandler.getGraphIndex()).thenReturn(graphIndex);
when(canvasHandler.getGraphIndex().getNode(ELEMENT_UUID)).thenReturn(node);
when(node.getInEdges()).thenReturn(inEdges);
when(edge.getContent()).thenReturn(child);
when(edge.getSourceNode()).thenReturn(parentNode);
when(parentNode.asNode()).thenReturn(parentNode);
when(parentNode.getContent()).thenReturn(parentView);
}
Aggregations