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());
});
}
}
Aggregations