@Test public void testGetAssignmentsInfo() { List<DataInput> dataInputs = new ArrayList<>(); DataInput dataInput1 = mockDataInput("INPUT_ID_1", "INPUT_NAME_1", mockEntry("dtype", "Integer")); DataInput dataInput2 = mockDataInput("INPUT_ID_2", "INPUT_NAME_2", mockEntry("dtype", "String")); dataInputs.add(dataInput1); dataInputs.add(dataInput2); InputOutputSpecification ioSpec = mock(InputOutputSpecification.class); List<DataInputAssociation> dataInputAssociations = new ArrayList<>(); DataInputAssociation inputAssociation = mockDataInputAssociation(dataInput1, "VARIABLE1"); DataInputAssociation inputAssociation2 = mockDataInputAssociation(dataInput2, "VARIABLE2"); dataInputAssociations.add(inputAssociation); dataInputAssociations.add(inputAssociation2); List<DataOutput> dataOutputs = new ArrayList<>(); DataOutput dataOutput1 = mockDataOutput("OUTPUT_ID_1", "OUTPUT_NAME_1", mockEntry("dtype", "Boolean")); DataOutput dataOutput2 = mockDataOutput("OUTPUT_ID_2", "OUTPUT_NAME_2", mockEntry("dtype", "Float")); dataOutputs.add(dataOutput1); dataOutputs.add(dataOutput2); List<DataOutputAssociation> dataOutputAssociations = new ArrayList<>(); DataOutputAssociation outputAssociation1 = mockDataOutputAssociation(dataOutput1, "VARIABLE3"); DataOutputAssociation outputAssociation2 = mockDataOutputAssociation(dataOutput2, "VARIABLE4"); dataOutputAssociations.add(outputAssociation1); dataOutputAssociations.add(outputAssociation2); when(ioSpec.getDataInputs()).thenReturn(dataInputs); when(ioSpec.getDataOutputs()).thenReturn(dataOutputs); when(activity.getIoSpecification()).thenReturn(ioSpec); when(activity.getDataInputAssociations()).thenReturn(dataInputAssociations); when(activity.getDataOutputAssociations()).thenReturn(dataOutputAssociations); AssignmentsInfo result = reader.getAssignmentsInfo(); String expectedResult = "|INPUT_NAME_1:Integer,INPUT_NAME_2:String||OUTPUT_NAME_1:Boolean,OUTPUT_NAME_2:Float|[din]VARIABLE1->INPUT_NAME_1,[din]VARIABLE2->INPUT_NAME_2,[dout]OUTPUT_NAME_1->VARIABLE3,[dout]OUTPUT_NAME_2->VARIABLE4"; assertEquals(expectedResult, result.getValue()); }
public AssignmentsInfo getAssignmentsInfo() { AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), getDataInputAssociations(), getDataOutputs(), getDataOutputAssociations(), getIOSpecification().isPresent()); if (info.getValue().isEmpty()) { info.setValue(EMPTY_ASSIGNMENTS); } return info; }
ActivityPropertyReader extends FlowElementPropertyReader { public AssignmentsInfo getAssignmentsInfo() { AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), getDataInputAssociations(), getDataOutputs(), getDataOutputAssociations(), getIOSpecification().isPresent()); if (info.getValue().isEmpty()) { info.setValue(EMPTY_ASSIGNMENTS); } return info; } }
ActivityPropertyReader extends FlowElementPropertyReader { public AssignmentsInfo getAssignmentsInfo() { AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), getDataInputAssociations(), getDataOutputs(), getDataOutputAssociations(), getIOSpecification().isPresent()); if (info.getValue().isEmpty()) { info.setValue(EMPTY_ASSIGNMENTS); } return info; } ActivityPropertyReader(Activity activity, BPMNDiagram diagram, DefinitionResolver definitionResolver); }
ActivityPropertyReader extends FlowElementPropertyReader { public AssignmentsInfo getAssignmentsInfo() { AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), getDataInputAssociations(), getDataOutputs(), getDataOutputAssociations(), getIOSpecification().isPresent()); if (info.getValue().isEmpty()) { info.setValue(EMPTY_ASSIGNMENTS); } return info; } ActivityPropertyReader(Activity activity, BPMNDiagram diagram, DefinitionResolver definitionResolver); ScriptTypeListValue getOnEntryAction(); ScriptTypeListValue getOnExitAction(); SimulationSet getSimulationSet(); AssignmentsInfo getAssignmentsInfo(); }
ActivityPropertyReader extends FlowElementPropertyReader { public AssignmentsInfo getAssignmentsInfo() { AssignmentsInfo info = AssignmentsInfos.of(getDataInputs(), getDataInputAssociations(), getDataOutputs(), getDataOutputAssociations(), getIOSpecification().isPresent()); if (info.getValue().isEmpty()) { info.setValue(EMPTY_ASSIGNMENTS); } return info; } ActivityPropertyReader(Activity activity, BPMNDiagram diagram, DefinitionResolver definitionResolver); ScriptTypeListValue getOnEntryAction(); ScriptTypeListValue getOnExitAction(); SimulationSet getSimulationSet(); AssignmentsInfo getAssignmentsInfo();  }