use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData in project kie-wb-common by kiegroup.
the class SubProcessConverter method convertEmbeddedSubprocessNode.
private BpmnNode convertEmbeddedSubprocessNode(SubProcess subProcess) {
Node<View<EmbeddedSubprocess>, Edge> node = factoryManager.newNode(subProcess.getId(), EmbeddedSubprocess.class);
EmbeddedSubprocess definition = node.getContent().getDefinition();
SubProcessPropertyReader p = propertyReaderFactory.of(subProcess);
definition.setGeneral(new BPMNGeneralSet(new Name(subProcess.getName()), new Documentation(p.getDocumentation())));
definition.getOnEntryAction().setValue(p.getOnEntryAction());
definition.getOnExitAction().setValue(p.getOnExitAction());
definition.getIsAsync().setValue(p.isAsync());
definition.setProcessData(new ProcessData(new ProcessVariables(p.getProcessVariables())));
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.variables.ProcessData in project kie-wb-common by kiegroup.
the class RootProcessConverter method convertProcessNode.
private ProcessPropertyWriter convertProcessNode(Node<Definition<BPMNDiagramImpl>, ?> node) {
Process process = bpmn2.createProcess();
ProcessPropertyWriter p = propertyWriterFactory.of(process);
BPMNDiagramImpl definition = node.getContent().getDefinition();
DiagramSet diagramSet = definition.getDiagramSet();
p.setName(diagramSet.getName().getValue());
p.setDocumentation(diagramSet.getDocumentation().getValue());
process.setId(diagramSet.getId().getValue());
p.setPackage(diagramSet.getPackageProperty().getValue());
p.setVersion(diagramSet.getVersion().getValue());
p.setAdHoc(diagramSet.getAdHoc().getValue());
p.setDescription(diagramSet.getProcessInstanceDescription().getValue());
p.setExecutable(diagramSet.getExecutable().getValue());
ProcessData processData = definition.getProcessData();
p.setProcessVariables(processData.getProcessVariables());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData 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.property.variables.ProcessData in project kie-wb-common by kiegroup.
the class BPMNDirectDiagramMarshallerTest method testUnmarshallAddHocSubprocess.
@Test
public void testUnmarshallAddHocSubprocess() throws Exception {
Diagram<Graph, Metadata> diagram = unmarshall(BPMN_ADHOC_SUBPROCESS);
AdHocSubprocess adHocSubprocess = 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 AdHocSubprocess) {
adHocSubprocess = (AdHocSubprocess) oDefinition;
break;
}
}
}
assertNotNull(adHocSubprocess);
BPMNGeneralSet generalSet = adHocSubprocess.getGeneral();
AdHocSubprocessTaskExecutionSet executionSet = adHocSubprocess.getExecutionSet();
ProcessData processData = adHocSubprocess.getProcessData();
assertNotNull(generalSet);
assertNotNull(executionSet);
assertNotNull(processData);
assertEquals("AdHocSubprocess1", generalSet.getName().getValue());
assertEquals("AdHocSubprocess1Documentation", generalSet.getDocumentation().getValue());
assertNotNull(executionSet.getAdHocCompletionCondition());
assertNotNull(executionSet.getAdHocCompletionCondition().getValue());
assertNotNull(executionSet.getAdHocOrdering());
assertNotNull(executionSet.getOnEntryAction());
assertNotNull(executionSet.getOnExitAction());
assertEquals("autocomplete", executionSet.getAdHocCompletionCondition().getValue().getScript());
assertEquals("drools", executionSet.getAdHocCompletionCondition().getValue().getLanguage());
assertEquals("Sequential", executionSet.getAdHocOrdering().getValue());
assertEquals(1, executionSet.getOnEntryAction().getValue().getValues().size());
assertEquals("System.out.println(\"onEntryAction\");", executionSet.getOnEntryAction().getValue().getValues().get(0).getScript());
assertEquals("mvel", executionSet.getOnEntryAction().getValue().getValues().get(0).getLanguage());
assertEquals(1, executionSet.getOnExitAction().getValue().getValues().size());
assertEquals("System.out.println(\"onExitAction\");", executionSet.getOnExitAction().getValue().getValues().get(0).getScript());
assertEquals("java", executionSet.getOnExitAction().getValue().getValues().get(0).getLanguage());
assertEquals("subProcessVar1:String,subProcessVar2:String", processData.getProcessVariables().getValue());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessData in project kie-wb-common by kiegroup.
the class ProcessVariableProviderTest method mockRootNodeWithoutProcessVariables.
private Element mockRootNodeWithoutProcessVariables() {
BPMNDiagramImpl rootNode = new BPMNDiagramImpl();
rootNode.setProcessData(new ProcessData(new ProcessVariables("")));
return mockNode(rootNode);
}
Aggregations