private InputSet getInputSet(InputOutputSpecification ioSpecification) { List<InputSet> inputSets = ioSpecification.getInputSets(); InputSet inputSet; if (inputSets.isEmpty()) { inputSet = bpmn2.createInputSet(); inputSets.add(inputSet); } else { inputSet = inputSets.get(0); } return inputSet; }
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; }
private void setStringValue(String value) { if (value == null || value.isEmpty()) { return; } DataInputAssociation input = input(value); DataInput targetRef = (DataInput) input.getTargetRef(); getIoSpecification(element).getDataInputs().add(targetRef); getIoSpecification(element).getInputSets().get(0).getDataInputRefs().add(targetRef); element.getDataInputAssociations().add(input); }
private String marshallDataInputSet(Activity activity, Map<String, Object> properties, List<String> disallowedNames) { if (activity.getIoSpecification() != null) { List<InputSet> inputSetList = activity.getIoSpecification().getInputSets(); StringBuilder dataInBuffer = new StringBuilder(); for (InputSet inset : inputSetList) { List<DataInput> dataInputList = inset.getDataInputRefs(); marshallItemAwareElements(activity, dataInputList, dataInBuffer, disallowedNames); } if (dataInBuffer.length() > 0) { dataInBuffer.setLength(dataInBuffer.length() - 1); } String datainputset = dataInBuffer.toString(); properties.put(DATAINPUTSET, datainputset); return datainputset; } else { return null; } }
public MultipleInstanceSubProcessPropertyWriter(SubProcess process, VariableScope variableScope) { super(process, variableScope); this.miloop = bpmn2.createMultiInstanceLoopCharacteristics(); process.setLoopCharacteristics(miloop); this.ioSpec = bpmn2.createInputOutputSpecification(); this.inputSet = bpmn2.createInputSet(); this.ioSpec.getInputSets().add(inputSet); this.outputSet = bpmn2.createOutputSet(); this.ioSpec.getOutputSets().add(outputSet); process.setIoSpecification(ioSpec); }
activity.getIoSpecification().getInputSets().add(inset); } else { if (activity.getIoSpecification() != null) { activity.getIoSpecification().getInputSets().add(Bpmn2Factory.eINSTANCE.createInputSet());
if (ios.getInputSets() == null || ios.getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet(); ios.getInputSets().add(inset);
for (DataInput processedInput : alreadyProcessedInputs.values()) { if (processedInput != null) { task.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(processedInput); InputSet inset = task.getIoSpecification().getInputSets().get(0); inset.getDataInputRefs().add(assignmentTaskNameDataInput);
DataInput notStartedNotificationInput = null; if (task.getIoSpecification() != null) { List<InputSet> inputSetList = task.getIoSpecification().getInputSets(); for (InputSet inset : inputSetList) { List<DataInput> dataInputList = inset.getDataInputRefs();
if (inputCollectionStr != null && !inputCollectionStr.isEmpty()) { InputSet inset = sp.getIoSpecification().getInputSets().get(0); DataInput multiInput = Bpmn2Factory.eINSTANCE.createDataInput(); multiInput.setId(sp.getId() + "_" + "input");
task.getIoSpecification().getDataInputs().add(d); foundInput = d; 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(d); task.getIoSpecification().getDataInputs().add(d); foundInput = d; 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(d); task.getIoSpecification().getDataInputs().add(d); foundInput = d; 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(d); task.getIoSpecification().getDataInputs().add(d); foundInput = d; if (task.getIoSpecification().getInputSets() == null || task.getIoSpecification().getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet(); task.getIoSpecification().getInputSets().add(inset);
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();
@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 (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.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 (targetElement.getIoSpecification().getInputSets() == null || targetElement.getIoSpecification().getInputSets().size() < 1) { InputSet inset = Bpmn2Factory.eINSTANCE.createInputSet(); targetElement.getIoSpecification().getInputSets().add(inset); InputSet inSet = targetElement.getIoSpecification().getInputSets().get(0); boolean foundDataInput = false; for (DataInput dataInput : inSet.getDataInputRefs()) { d.setName(da.getId() + "InputX"); targetElement.getIoSpecification().getDataInputs().add(d); targetElement.getIoSpecification().getInputSets().get(0).getDataInputRefs().add(d); DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.setTargetRef(d);