private InputOutputSpecification getIoSpecification(Task element) { InputOutputSpecification ioSpecification = element.getIoSpecification(); if (ioSpecification == null) { ioSpecification = bpmn2.createInputOutputSpecification(); element.setIoSpecification(ioSpecification); } List<InputSet> inputSets = ioSpecification.getInputSets(); if (inputSets.isEmpty()) { inputSets.add(bpmn2.createInputSet()); } return ioSpecification; }
public AssignmentsInfo getAssignmentsInfo() { Optional<InputOutputSpecification> ioSpecification = Optional.ofNullable(task.getIoSpecification()); AssignmentsInfo info = AssignmentsInfos.of( ioSpecification.map(InputOutputSpecification::getDataInputs) .orElse(Collections.emptyList()), task.getDataInputAssociations(), ioSpecification.map(InputOutputSpecification::getDataOutputs) .orElse(Collections.emptyList()), task.getDataOutputAssociations(), ioSpecification.isPresent() ); // do not break compatibility with old marshallers: return // empty delimited fields instead of empty string if (info.getValue().isEmpty()) { info.setValue("||||"); } return info; }
"String"); taskNameDataInput.getAnyAttribute().add(extensionEntry); if (task.getIoSpecification() == null) { InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification(); task.setIoSpecification(iospec); task.getIoSpecification().getDataInputs().add(taskNameDataInput); for (DataInput processedInput : alreadyProcessedInputs.values()) { if (processedInput != null) { task.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(processedInput); if (task.getIoSpecification() != null && task.getIoSpecification().getDataOutputs() != null) { List<DataInput> dataInputs = task.getIoSpecification().getDataInputs(); for (DataInput di : dataInputs) { if (di.getId().equals(task.getId() + "_" + fromPart + (fromPart.endsWith("InputX") ? "" : "InputX"))) { assignmentTaskNameDataInput.setId(task.getId() + "_TaskNameInputX"); assignmentTaskNameDataInput.setName("TaskName"); if (task.getIoSpecification() == null) { InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification(); task.setIoSpecification(iospec); task.getIoSpecification().getDataInputs().add(assignmentTaskNameDataInput); dia.setTargetRef(assignmentTaskNameDataInput); InputSet inset = task.getIoSpecification().getInputSets().get(0); inset.getDataInputRefs().add(assignmentTaskNameDataInput); List<DataOutput> dataOutputs = task.getIoSpecification().getDataOutputs();
prop.getId()); miCollectionInputDI.setItemSubjectRef(miCollectionInputDIItemDefinition); task.getIoSpecification().getDataInputs().add(miCollectionInputDI); if (task.getIoSpecification().getInputSets() == null || task.getIoSpecification().getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet(); task.getIoSpecification().getInputSets().add(inset); task.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(miCollectionInputDI); loopCharacteristics.setLoopDataInputRef(miCollectionInputDI); DataInputAssociation miCollectionInputDataInputAssociation = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); prop.getId()); miCollectionOutputDI.setItemSubjectRef(miCollectionOutputDIItemDefinition); task.getIoSpecification().getDataOutputs().add(miCollectionOutputDI); if (task.getIoSpecification().getOutputSets() == null || task.getIoSpecification().getOutputSets().size() < 1) { OutputSet outset = Bpmn2Factory.eINSTANCE.createOutputSet(); task.getIoSpecification().getOutputSets().add(outset); task.getIoSpecification().getOutputSets().get(0).getDataOutputRefs().add(miCollectionOutputDI); loopCharacteristics.setLoopDataOutputRef(miCollectionOutputDI); DataOutputAssociation miCollectionInputDataOutputAssociation = Bpmn2Factory.eINSTANCE.createDataOutputAssociation(); List<DataInput> dins = task.getIoSpecification().getDataInputs(); for (DataInput di : dins) { if (di.getName().equals(miDataInput)) { List<DataOutput> douts = task.getIoSpecification().getDataOutputs(); for (DataOutput dout : douts) { if (dout.getName().equals(miDataOutput)) {
if (t.getIoSpecification() != null) { InputOutputSpecification ios = t.getIoSpecification(); if (ios.getInputSets() == null || ios.getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet();
if (task instanceof UserTask && task.getIoSpecification() != null && task.getIoSpecification().getDataInputs() != null) { List<DataInput> taskDataInputs = task.getIoSpecification().getDataInputs(); for (DataInput din : taskDataInputs) { if (din.getName() != null && din.getName().equals("TaskName")) { List<DataInput> taskDataInputs = task.getIoSpecification().getDataInputs(); for (DataInput din : taskDataInputs) { if (din != null && din.getItemSubjectRef() != null && taskmi.getInputDataItem() != null && taskmi.getInputDataItem().getItemSubjectRef() != null) { List<DataOutput> taskDataOutputs = task.getIoSpecification().getDataOutputs(); for (DataOutput dout : taskDataOutputs) { if (dout != null && dout.getItemSubjectRef() != null && taskmi.getOutputDataItem() != null && taskmi.getOutputDataItem().getItemSubjectRef() != null) { DataInput notCompletedNotificationInput = null; DataInput notStartedNotificationInput = null; if (task.getIoSpecification() != null) { List<InputSet> inputSetList = task.getIoSpecification().getInputSets(); for (InputSet inset : inputSetList) { List<DataInput> dataInputList = inset.getDataInputRefs();
@Test public void shouldCreateOneInputSet() { Task task = bpmn2.createTask(); ActivityPropertyWriter activityPropertyWriter = new ActivityPropertyWriter(task, new FlatVariableScope()); activityPropertyWriter.setAssignmentsInfo(new AssignmentsInfo( "|A:String|||" )); List<InputSet> inputSets = task.getIoSpecification().getInputSets(); assertEquals(1, inputSets.size()); } }
@Test public void shouldReuseInputSet() { Task task = bpmn2.createTask(); StringInput stringInput = new StringInput("BLAH", "ATYPE", "DEFAULTVAL"); stringInput.of(task).set("VALUE"); StringInput stringInput2 = new StringInput("BLAH2", "ATYPE", "DEFAULTVAL"); stringInput.of(task).set("VALUE"); InputOutputSpecification ioSpecification = task.getIoSpecification(); List<InputSet> inputSets = ioSpecification.getInputSets(); assertEquals(1, inputSets.size()); } }
if (as.getTargetRef() instanceof Task) { Task task = (Task) as.getTargetRef(); if (task.getIoSpecification() == null) { InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification(); task.setIoSpecification(iospec); if (task.getIoSpecification().getInputSets() == null || task.getIoSpecification().getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet(); task.getIoSpecification().getInputSets().add(inset); InputSet inSet = task.getIoSpecification().getInputSets().get(0); boolean foundDataInput = false; for (DataInput dataInput : inSet.getDataInputRefs()) { d.setId(task.getId() + "_" + da.getId() + "InputX"); d.setName(da.getId() + "InputX"); task.getIoSpecification().getDataInputs().add(d); task.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(d); DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.setTargetRef(d); if (as.getSourceRef() instanceof Task) { Task task = (Task) as.getSourceRef(); if (task.getIoSpecification() == null) { InputOutputSpecification iospec = Bpmn2Factory.eINSTANCE.createInputOutputSpecification(); task.setIoSpecification(iospec); if (task.getIoSpecification().getOutputSets() == null || task.getIoSpecification().getOutputSets().size() < 1) { OutputSet outSet = Bpmn2Factory.eINSTANCE.createOutputSet();