Search in sources :

Example 1 with MAPPING_VARIABLE

use of org.jbpm.ruleflow.core.Metadata.MAPPING_VARIABLE in project kogito-runtimes by kiegroup.

the class AbstractNodeHandler method setCatchVariable.

protected void setCatchVariable(IOSpecification ioSpecification, Node node) {
    NodeImpl nodeImpl = (NodeImpl) node;
    nodeImpl.setIoSpecification(ioSpecification);
    if (node instanceof EventNode) {
        EventNode eventNode = (EventNode) node;
        findSourceMappingVar(ioSpecification.getDataOutputAssociation()).ifPresent(var -> {
            eventNode.setInputVariableName(var.getLabel());
        });
        findTargetMappingVar(ioSpecification.getDataOutputAssociation()).ifPresent(var -> {
            eventNode.getMetaData().put(MAPPING_VARIABLE, var.getLabel());
            eventNode.setVariableName(var.getLabel());
        });
    } else if (node instanceof TimerNode || node instanceof StateNode || node instanceof CatchLinkNode) {
        findTargetMappingVar(ioSpecification.getDataOutputAssociation()).ifPresent(data -> {
            nodeImpl.getMetaData().put(MAPPING_VARIABLE, data.getLabel());
        });
    }
}
Also used : SequenceFlow(org.jbpm.bpmn2.core.SequenceFlow) ForEachNode(org.jbpm.workflow.core.node.ForEachNode) LoggerFactory(org.slf4j.LoggerFactory) PatternConstants(org.jbpm.util.PatternConstants) NodeImpl(org.jbpm.workflow.core.impl.NodeImpl) Thread.currentThread(java.lang.Thread.currentThread) DroolsConsequenceAction(org.jbpm.workflow.core.impl.DroolsConsequenceAction) ItemDefinition(org.jbpm.bpmn2.core.ItemDefinition) Assignment(org.jbpm.workflow.core.node.Assignment) ExtensibleXmlParser(org.drools.core.xml.ExtensibleXmlParser) Association(org.jbpm.bpmn2.core.Association) StateNode(org.jbpm.workflow.core.node.StateNode) Matcher(java.util.regex.Matcher) ProcessBuildData(org.jbpm.compiler.xml.ProcessBuildData) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Map(java.util.Map) Signal(org.jbpm.bpmn2.core.Signal) Transformation(org.jbpm.workflow.core.node.Transformation) IOSpecification(org.jbpm.workflow.core.impl.IOSpecification) XmlDumper(org.drools.compiler.compiler.xml.XmlDumper) MultiInstanceSpecification(org.jbpm.workflow.core.impl.MultiInstanceSpecification) CatchLinkNode(org.jbpm.workflow.core.node.CatchLinkNode) CompositeContextNode(org.jbpm.workflow.core.node.CompositeContextNode) Collection(java.util.Collection) Set(java.util.Set) UUID(java.util.UUID) VariableScope(org.jbpm.process.core.context.variable.VariableScope) List(java.util.List) Error(org.jbpm.bpmn2.core.Error) ContextContainer(org.jbpm.process.core.ContextContainer) Node(org.jbpm.workflow.core.Node) JavaDialect(org.drools.mvel.java.JavaDialect) SAXException(org.xml.sax.SAXException) Optional(java.util.Optional) MAPPING_VARIABLE_INPUT(org.jbpm.ruleflow.core.Metadata.MAPPING_VARIABLE_INPUT) VARIABLE(org.jbpm.ruleflow.core.Metadata.VARIABLE) RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) DataDefinition(org.jbpm.workflow.core.impl.DataDefinition) HashMap(java.util.HashMap) Function(java.util.function.Function) ArrayList(java.util.ArrayList) Lane(org.jbpm.bpmn2.core.Lane) TimerNode(org.jbpm.workflow.core.node.TimerNode) HashSet(java.util.HashSet) DataTypeResolver.fromType(org.jbpm.process.core.datatype.DataTypeResolver.fromType) NodeContainer(org.jbpm.workflow.core.NodeContainer) DataAssociation(org.jbpm.workflow.core.impl.DataAssociation) Attributes(org.xml.sax.Attributes) BaseAbstractHandler(org.drools.core.xml.BaseAbstractHandler) FaultNode(org.jbpm.workflow.core.node.FaultNode) DroolsAction(org.jbpm.workflow.core.DroolsAction) Variable(org.jbpm.process.core.context.variable.Variable) DataTransformer(org.kie.api.runtime.process.DataTransformer) ActionNode(org.jbpm.workflow.core.node.ActionNode) EndNode(org.jbpm.workflow.core.node.EndNode) Logger(org.slf4j.Logger) NodeList(org.w3c.dom.NodeList) Iterator(java.util.Iterator) EventNode(org.jbpm.workflow.core.node.EventNode) COMPLETION_CONDITION(org.jbpm.ruleflow.core.Metadata.COMPLETION_CONDITION) Handler(org.drools.core.xml.Handler) DataTypeResolver(org.jbpm.process.core.datatype.DataTypeResolver) SAXParseException(org.xml.sax.SAXParseException) Element(org.w3c.dom.Element) DataTransformerRegistry(org.jbpm.process.core.impl.DataTransformerRegistry) MAPPING_VARIABLE(org.jbpm.ruleflow.core.Metadata.MAPPING_VARIABLE) Definitions(org.jbpm.bpmn2.core.Definitions) ExtendedNodeImpl(org.jbpm.workflow.core.impl.ExtendedNodeImpl) EventNode(org.jbpm.workflow.core.node.EventNode) CatchLinkNode(org.jbpm.workflow.core.node.CatchLinkNode) NodeImpl(org.jbpm.workflow.core.impl.NodeImpl) ExtendedNodeImpl(org.jbpm.workflow.core.impl.ExtendedNodeImpl) StateNode(org.jbpm.workflow.core.node.StateNode) TimerNode(org.jbpm.workflow.core.node.TimerNode)

Aggregations

Thread.currentThread (java.lang.Thread.currentThread)1 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Iterator (java.util.Iterator)1 List (java.util.List)1 Map (java.util.Map)1 Optional (java.util.Optional)1 Set (java.util.Set)1 UUID (java.util.UUID)1 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 Function (java.util.function.Function)1 Matcher (java.util.regex.Matcher)1 XmlDumper (org.drools.compiler.compiler.xml.XmlDumper)1 BaseAbstractHandler (org.drools.core.xml.BaseAbstractHandler)1 ExtensibleXmlParser (org.drools.core.xml.ExtensibleXmlParser)1 Handler (org.drools.core.xml.Handler)1 JavaDialect (org.drools.mvel.java.JavaDialect)1 Association (org.jbpm.bpmn2.core.Association)1