use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables 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.ProcessVariables in project kie-wb-common by kiegroup.
the class ProcessVariablesProvider method findElements.
@Override
protected Collection<Pair<Object, String>> findElements(Predicate<Node> filter, Function<Node, Pair<Object, String>> mapper) {
Collection<Pair<Object, String>> result = new ArrayList<>();
String elementUUID = sessionManager.getCurrentSession().getCanvasHandler().getDiagram().getMetadata().getCanvasRootUUID();
Node node;
if (elementUUID != null) {
node = sessionManager.getCurrentSession().getCanvasHandler().getDiagram().getGraph().getNode(elementUUID);
Object oDefinition = ((View) node.getContent()).getDefinition();
if (oDefinition instanceof BPMNDiagram) {
BPMNDiagramImpl bpmnDiagram = (BPMNDiagramImpl) oDefinition;
ProcessVariables processVars = bpmnDiagram.getProcessData().getProcessVariables();
if (processVars.getValue().length() > 0) {
List<String> list = Arrays.asList(processVars.getValue().split(","));
list.forEach(s1 -> {
String value = s1.split(":")[0];
result.add(new Pair<>(value, value));
});
}
}
}
return result;
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables 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);
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables in project kie-wb-common by kiegroup.
the class UserTaskTest method RHBA607.
@Test
@SuppressWarnings("unchecked")
public void RHBA607() throws Exception {
super.init();
final String BPMN_USER_TASK_PROPERTIES_FILE_PATH = "org/kie/workbench/common/stunner/bpmn/backend/service/diagram/userTaskProperties.bpmn";
final String DIAGRAM_ID = "_pfJ-8O50EeiVSc03Fghuww";
Diagram<Graph, Metadata> d = unmarshall(marshaller, BPMN_USER_TASK_PROPERTIES_FILE_PATH);
Node<View<BPMNDiagramImpl>, ?> node = d.getGraph().getNode(DIAGRAM_ID);
ProcessData processData = node.getContent().getDefinition().getProcessData();
ProcessVariables processVariables = processData.getProcessVariables();
DeclarationList declarationList = DeclarationList.fromString(processVariables.getValue());
assertTrue(declarationList.getDeclarations().isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.definition.property.variables.ProcessVariables in project kie-wb-common by kiegroup.
the class ProcessPropertyWriterTest method processVariables.
@Test
public void processVariables() {
ProcessVariables processVariables = new ProcessVariables("GV1:Boolean:input,GV2:Boolean:output;required,GV3:Integer:customTag;required");
p.setProcessVariables(processVariables);
final ProcessPropertyReader pp = new ProcessPropertyReader(p.getProcess(), p.getBpmnDiagram(), p.getShape(), 1.0);
String processVariablesString = pp.getProcessVariables();
assertThat(processVariablesString).isEqualTo("GV1:Boolean:<![CDATA[input]]>,GV2:Boolean:<![CDATA[output;required]]>,GV3:Integer:<![CDATA[customTag;required]]>");
}
Aggregations