Search in sources :

Example 1 with VariableUsage

use of org.kie.workbench.common.stunner.bpmn.client.util.VariableUsage in project kie-wb-common by kiegroup.

the class ActivityDataIOEditorWidget method isMultipleInstanceVariable.

public boolean isMultipleInstanceVariable(final String name) {
    ClientSession session = sessionManager.getCurrentSession();
    Diagram diagram = session.getCanvasHandler().getDiagram();
    Node selectedNode = getSelectedNode(diagram, sessionManager.getCurrentSession());
    Collection<VariableUsage> variableUsages = VariableUtils.findVariableUsages(selectedNode, name);
    return variableUsages.stream().anyMatch(variableUsage -> variableUsage.getUsageType() == VariableUsage.USAGE_TYPE.MULTIPLE_INSTANCE_DATA_INPUT || variableUsage.getUsageType() == VariableUsage.USAGE_TYPE.MULTIPLE_INSTANCE_DATA_OUTPUT);
}
Also used : ClientSession(org.kie.workbench.common.stunner.core.client.session.ClientSession) ClientUtils.getSelectedNode(org.kie.workbench.common.stunner.core.client.util.ClientUtils.getSelectedNode) Node(org.kie.workbench.common.stunner.core.graph.Node) Diagram(org.kie.workbench.common.stunner.core.diagram.Diagram) VariableUsage(org.kie.workbench.common.stunner.bpmn.client.util.VariableUsage)

Aggregations

VariableUsage (org.kie.workbench.common.stunner.bpmn.client.util.VariableUsage)1 ClientSession (org.kie.workbench.common.stunner.core.client.session.ClientSession)1 ClientUtils.getSelectedNode (org.kie.workbench.common.stunner.core.client.util.ClientUtils.getSelectedNode)1 Diagram (org.kie.workbench.common.stunner.core.diagram.Diagram)1 Node (org.kie.workbench.common.stunner.core.graph.Node)1