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 testConvertMultipleIntanceSubprocess.
@Test
public void testConvertMultipleIntanceSubprocess() {
final MultipleInstanceSubprocess definition = new MultipleInstanceSubprocess();
setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
final View<MultipleInstanceSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<MultipleInstanceSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertMultipleInstanceSubprocessNode(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 testConvertEventSubprocess.
@Test
public void testConvertEventSubprocess() {
final EventSubprocess definition = new EventSubprocess();
setBaseSubprocessExecutionSetValues(definition.getExecutionSet());
final View<EventSubprocess> view = new ViewImpl<>(definition, Bounds.create());
final Node<View<EventSubprocess>, ?> node = new NodeImpl<>(UUID.randomUUID().toString());
node.setContent(view);
SubProcessPropertyWriter writer = tested.convertEventSubprocessNode(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 SubProcessConverter method convertSubProcess.
public Result<SubProcessPropertyWriter> convertSubProcess(Node<View<? extends BPMNViewDefinition>, ?> node) {
Result<SubProcessPropertyWriter> processRootResult = NodeMatch.fromNode(BaseSubprocess.class, SubProcessPropertyWriter.class).when(EmbeddedSubprocess.class, this::convertEmbeddedSubprocessNode).when(EventSubprocess.class, this::convertEventSubprocessNode).when(BaseAdHocSubprocess.class, this::convertAdHocSubprocessNode).when(MultipleInstanceSubprocess.class, this::convertMultipleInstanceSubprocessNode).ignore(BPMNViewDefinition.class).apply(node);
if (processRootResult.isIgnored()) {
return processRootResult;
}
DefinitionsBuildingContext subContext = context.withRootNode(node);
SubProcessPropertyWriter processRoot = processRootResult.value();
super.convertChildNodes(processRoot, subContext);
super.convertEdges(processRoot, subContext);
return processRootResult;
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.fromstunner.properties.SubProcessPropertyWriter in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertEmbeddedSubprocessNode.
protected SubProcessPropertyWriter convertEmbeddedSubprocessNode(Node<View<EmbeddedSubprocess>, ?> n) {
SubProcess process = bpmn2.createSubProcess();
process.setId(n.getUUID());
SubProcessPropertyWriter p = propertyWriterFactory.of(process);
EmbeddedSubprocess definition = n.getContent().getDefinition();
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
EmbeddedSubprocessExecutionSet executionSet = definition.getExecutionSet();
p.setOnEntryAction(executionSet.getOnEntryAction());
p.setOnExitAction(executionSet.getOnExitAction());
p.setAsync(executionSet.getIsAsync().getValue());
p.setSlaDueDate(executionSet.getSlaDueDate());
ProcessData processData = definition.getProcessData();
p.setProcessVariables(processData.getProcessVariables());
p.setSimulationSet(definition.getSimulationSet());
p.setMetaData(definition.getAdvancedData().getMetaDataAttributes());
p.setAbsoluteBounds(n);
return p;
}
Aggregations