use of org.jbpm.workflow.core.impl.DataDefinition in project kogito-runtimes by kiegroup.
the class ServerlessWorkflowParser method subprocessNode.
public static <T extends RuleFlowNodeContainerFactory<T, ?>> SubProcessNodeFactory<T> subprocessNode(SubProcessNodeFactory<T> nodeFactory, String inputVar, String outputVar) {
Map<String, String> types = Collections.singletonMap(DEFAULT_WORKFLOW_VAR, JSON_NODE);
DataAssociation inputDa = new DataAssociation(new DataDefinition(inputVar, inputVar, JSON_NODE), new DataDefinition(DEFAULT_WORKFLOW_VAR, DEFAULT_WORKFLOW_VAR, JSON_NODE), null, null);
DataAssociation outputDa = new DataAssociation(new DataDefinition(DEFAULT_WORKFLOW_VAR, DEFAULT_WORKFLOW_VAR, JSON_NODE), new DataDefinition(outputVar, outputVar, JSON_NODE), null, null);
VariableScope variableScope = new VariableScope();
return nodeFactory.independent(true).metaData("BPMN.InputTypes", types).metaData("BPMN.OutputTypes", types).mapDataInputAssociation(inputDa).mapDataOutputAssociation(outputDa).context(variableScope).defaultContext(variableScope);
}
use of org.jbpm.workflow.core.impl.DataDefinition in project kogito-runtimes by kiegroup.
the class AbstractNodeHandler method writeDataAssociation.
protected void writeDataAssociation(DataAssociation input, StringBuilder xmlDump) {
for (DataDefinition source : input.getSources()) {
xmlDump.append(" <sourceRef>" + source.getId() + "</sourceRef>" + EOL);
}
if (input.getTarget() != null) {
xmlDump.append("<targetRef>" + input.getTarget().getId() + "</targetRef>" + EOL);
}
if (!input.getAssignments().isEmpty()) {
for (Assignment assignment : input.getAssignments()) {
xmlDump.append(" <assignment>" + EOL);
xmlDump.append(" <from xsi:type=\"tFormalExpression\">" + assignment.getFrom().getExpression() + "</from>");
xmlDump.append(" <to xsi:type=\"tFormalExpression\">" + assignment.getTo().getExpression() + "</to>");
xmlDump.append(" </assignment>" + EOL);
}
}
}
use of org.jbpm.workflow.core.impl.DataDefinition in project kogito-runtimes by kiegroup.
the class AbstractNodeHandler method writeMultiInstance.
protected void writeMultiInstance(MultiInstanceSpecification ioSpecification, StringBuilder xmlDump) {
if (!ioSpecification.hasLoopDataInputRef()) {
return;
}
xmlDump.append("<multiInstanceLoopCharacteristics>" + EOL);
if (ioSpecification.hasLoopDataInputRef()) {
xmlDump.append("<loopDataInputRef>" + ioSpecification.getLoopDataInputRef() + "</loopDataInputRef>" + EOL);
}
if (ioSpecification.hasLoopDataOutputRef()) {
xmlDump.append("<loopDataOutputRef>" + ioSpecification.getLoopDataOutputRef() + "</loopDataOutputRef>" + EOL);
}
DataDefinition input = ioSpecification.getInputDataItem();
if (input != null) {
xmlDump.append("<inputDataItem id=\"" + input.getId() + "\" name=\"" + input.getLabel() + "\" structureRef=\"" + input.getType() + "\" />");
}
DataDefinition output = ioSpecification.getOutputDataItem();
if (output != null) {
xmlDump.append("<outputDataItem id=\"" + output.getId() + "\" name=\"" + output.getLabel() + "\" structureRef=\"" + output.getType() + "\" />");
}
xmlDump.append("</multiInstanceLoopCharacteristics>" + EOL);
}
use of org.jbpm.workflow.core.impl.DataDefinition in project kogito-runtimes by kiegroup.
the class AbstractNodeHandler method writeCatchIO.
protected void writeCatchIO(IOSpecification ioSpecification, StringBuilder xmlDump) {
for (DataDefinition output : ioSpecification.getDataOutput().values()) {
xmlDump.append(" <dataOutput id=\"" + output.getId() + "\" name=\"" + output.getLabel() + "\" />" + EOL);
}
for (DataAssociation output : ioSpecification.getDataOutputAssociation()) {
xmlDump.append(" <dataOutputAssociation>" + EOL);
writeDataAssociation(output, xmlDump);
xmlDump.append(" </dataOutputAssociation>" + EOL);
}
}
use of org.jbpm.workflow.core.impl.DataDefinition in project kogito-runtimes by kiegroup.
the class AbstractNodeHandler method toDataExpression.
private DataDefinition toDataExpression(String expression) {
DataDefinition dataSpec = new DataDefinition(UUID.randomUUID().toString(), "EXPRESSION (" + expression + ")", null);
dataSpec.setExpression(expression);
return dataSpec;
}
Aggregations