use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertSubProcess.
public PropertyWriter convertSubProcess(Node<View<BaseSubprocess>, ?> node) {
SubProcessPropertyWriter processRoot = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class).when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode).when(EventSubprocess.class, this::convertEventSubprocessNode).when(AdHocSubprocess.class, this::convertAdHocSubprocessNode).apply(node).value();
DefinitionsBuildingContext subContext = context.withRootNode(node);
super.convertChildNodes(processRoot, subContext.nodes(), subContext.lanes());
super.convertEdges(processRoot, subContext);
return processRoot;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertEventSubprocessNode.
protected 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());
EventSubprocessExecutionSet executionSet = definition.getExecutionSet();
p.setAsync(executionSet.getIsAsync().getValue());
p.setSlaDueDate(executionSet.getSlaDueDate());
p.setSimulationSet(definition.getSimulationSet());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAbsoluteBounds(n);
return p;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method testConvertEmbeddedSubprocess.
@Test
public void testConvertEmbeddedSubprocess() {
final EmbeddedSubprocess definition = new EmbeddedSubprocess();
setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
final View<EmbeddedSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<EmbeddedSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertEmbeddedSubprocessNode(node);
assertBaseSubprocessExecutionSet(writer);
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method testConvertAdHocSubprocessNode_autostart.
@Test
public void testConvertAdHocSubprocessNode_autostart() {
final AdHocSubprocess definition = new AdHocSubprocess();
definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(true));
final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node);
assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer));
assertTrue(CustomElement.autoStart.of(writer.getFlowElement()).get());
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverterTest method testConvertAdHocSubprocessNode_notautostart.
@Test
public void testConvertAdHocSubprocessNode_notautostart() {
final AdHocSubprocess definition = new AdHocSubprocess();
definition.getExecutionSet().setAdHocAutostart(new AdHocAutostart(false));
final View<BaseAdHocSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<BaseAdHocSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertAdHocSubprocessNode(node);
assertTrue(AdHocSubProcessPropertyWriter.class.isInstance(writer));
assertFalse(CustomElement.autoStart.of(writer.getFlowElement()).get());
}
Aggregations