use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InitializedOutputVariable in project kie-wb-common by kiegroup.
the class CatchEventPropertyWriter method setAssignmentsInfo.
public void setAssignmentsInfo(AssignmentsInfo info) {
ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info);
List<InitializedOutputVariable> outputs = assignmentsInfo.createInitializedOutputVariables(getId(), variableScope, dataObjects);
if (outputs.isEmpty()) {
return;
}
if (outputs.size() > 1) {
throw new IllegalArgumentException("Output Associations should be at most 1 in Catch Events");
}
InitializedOutputVariable output = outputs.get(0);
DataOutput dataOutput = output.getDataOutput();
event.getDataOutputs().add(dataOutput);
getOutputSet().getDataOutputRefs().add(dataOutput);
this.addItemDefinition(dataOutput.getItemSubjectRef());
DataOutputAssociation dataOutputAssociation = output.getDataOutputAssociation();
if (dataOutputAssociation != null) {
event.getDataOutputAssociation().add(dataOutputAssociation);
}
}
use of org.kie.workbench.common.stunner.bpmn.backend.converters.customproperties.InitializedVariable.InitializedOutputVariable in project kie-wb-common by kiegroup.
the class ActivityPropertyWriter method setAssignmentsInfo.
public void setAssignmentsInfo(AssignmentsInfo info) {
final ParsedAssignmentsInfo assignmentsInfo = ParsedAssignmentsInfo.of(info);
final List<InitializedInputVariable> inputs = assignmentsInfo.createInitializedInputVariables(getId(), variableScope, dataObjects);
if (!inputs.isEmpty()) {
final InputOutputSpecification ioSpec = getIoSpecification();
for (InitializedInputVariable input : inputs) {
if (isReservedIdentifier(input.getIdentifier())) {
continue;
}
DataInput dataInput = input.getDataInput();
getInputSet(ioSpec).getDataInputRefs().add(dataInput);
ioSpec.getDataInputs().add(dataInput);
this.addItemDefinition(input.getItemDefinition());
DataInputAssociation dataInputAssociation = input.getDataInputAssociation();
if (dataInputAssociation != null) {
activity.getDataInputAssociations().add(dataInputAssociation);
}
}
}
final List<InitializedOutputVariable> outputs = assignmentsInfo.createInitializedOutputVariables(getId(), variableScope, dataObjects);
if (!outputs.isEmpty()) {
final InputOutputSpecification ioSpec = getIoSpecification();
for (InitializedOutputVariable output : outputs) {
DataOutput dataOutput = output.getDataOutput();
getOutputSet(ioSpec).getDataOutputRefs().add(dataOutput);
ioSpec.getDataOutputs().add(dataOutput);
this.addItemDefinition(output.getItemDefinition());
DataOutputAssociation dataOutputAssociation = output.getDataOutputAssociation();
if (dataOutputAssociation != null) {
activity.getDataOutputAssociations().add(dataOutputAssociation);
}
}
}
}
Aggregations