public String getCollectionInput() { ItemAwareElement ieDataInput = getMultiInstanceLoopCharacteristics() .map(MultiInstanceLoopCharacteristics::getLoopDataInputRef) .orElse(null); return process.getDataInputAssociations().stream() .filter(dia -> dia.getTargetRef().getId().equals(ieDataInput.getId())) .map(dia -> getVariableName((Property) dia.getSourceRef().get(0))) .findFirst() .orElse(null); }
public static InputAssignmentReader fromAssociation(DataInputAssociation in) { List<ItemAwareElement> sourceList = in.getSourceRef(); List<Assignment> assignmentList = in.getAssignment(); String targetName = ((DataInput) in.getTargetRef()).getName(); if (isReservedIdentifier(targetName)) { return null; } if (!sourceList.isEmpty()) { return new InputAssignmentReader(sourceList.get(0), targetName); } else if (!assignmentList.isEmpty()) { return new InputAssignmentReader(assignmentList.get(0), targetName); } else { throw new IllegalArgumentException("Cannot find SourceRef or Assignment for Target " + targetName); } }
public DataInputAssociation getDataInputAssociation() { DataInputAssociation dataInputAssociation = bpmn2.createDataInputAssociation(); dataInputAssociation .getSourceRef() .add(scope.lookup(sourceVariable).getTypedIdentifier()); dataInputAssociation .setTargetRef(getDataInput()); return dataInputAssociation; } }
public void setCollectionInput(String collectionInput) { // ignore empty input if (collectionInput == null) { return; } DataInput dataInputElement = createDataInput("IN_COLLECTION"); Property prop = findPropertyById(collectionInput); // check whether this exist or throws miloop.setLoopDataInputRef(dataInputElement); this.inputSet.getDataInputRefs().add(dataInputElement); DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.getSourceRef().add(prop); dia.setTargetRef(dataInputElement); process.getDataInputAssociations().add(dia); }
public String findVar(List<DataInputAssociation> associations, String varName) { return associations.stream() .filter(a -> { DataInput in = (DataInput) a.getTargetRef(); return in.getName().equals(varName); }) .map(a -> { Property dataOutput = (Property) a.getSourceRef().get(0); return dataOutput.getName(); }) .findFirst() .get(); }
for (DataInputAssociation datain : inputAssociations) { String lhsAssociation = ""; if (datain.getSourceRef() != null && datain.getSourceRef().size() > 0) { if (datain.getTransformation() != null && datain.getTransformation().getBody() != null) { lhsAssociation = datain.getTransformation().getBody(); } else { lhsAssociation = datain.getSourceRef().get(0).getId();
private ItemAwareElement getDataInputAssociationSourceRef(Activity activity, String id) { List<DataInputAssociation> dataInputAssociations = activity.getDataInputAssociations(); if (dataInputAssociations != null) { for (DataInputAssociation dataInputAssociation : dataInputAssociations) { List<ItemAwareElement> sourceRef = dataInputAssociation.getSourceRef(); if (sourceRef != null && !sourceRef.isEmpty()) { ItemAwareElement result = Arrays.stream(sourceRef.toArray(new ItemAwareElement[sourceRef.size()])) .filter(itemAwareElement -> id.equals(itemAwareElement.getId())) .findFirst() .orElse(null); if (result != null) { return result; } } } } return null; }
private ItemAwareElement getDataInputAssociationSourceRef(Activity activity, String id) { List<DataInputAssociation> dataInputAssociations = activity.getDataInputAssociations(); if (dataInputAssociations != null) { for (DataInputAssociation dataInputAssociation : dataInputAssociations) { List<ItemAwareElement> sourceRef = dataInputAssociation.getSourceRef(); if (sourceRef != null && !sourceRef.isEmpty()) { ItemAwareElement result = Arrays.stream(sourceRef.toArray(new ItemAwareElement[sourceRef.size()])) .filter(itemAwareElement -> id.equals(itemAwareElement.getId()) || id.equals(((Property) itemAwareElement).getName())) .findFirst() .orElse(null); if (result != null) { return result; } } } } return null; }
for ( DataInputAssociation inputAssociation : dataInputAssociations ) { if ( inputAssociation.getSourceRef() != null && inputAssociation.getSourceRef().size() > 0 && inputAssociation.getTargetRef() != null ) { String variableId = inputAssociation.getSourceRef().get( 0 ).getId(); DataInput input = (DataInput) inputAssociation.getTargetRef(); String id = input != null ? input.getName() : null;
dia.getSourceRef().add(ie); List<DataInput> dataInputs = event.getInputSet().getDataInputRefs(); for (DataInput di : dataInputs) {
dia.getSourceRef().add(ie); List<DataInput> dataInputs = callActivity.getIoSpecification().getDataInputs(); for (DataInput di : dataInputs) {
dia.getSourceRef().add(ie); List<DataInput> dataInputs = task.getIoSpecification().getDataInputs(); for (DataInput di : dataInputs) {
if (dia.getTargetRef().equals(iedatainput)) { properties.put("multipleinstancecollectioninput", dia.getSourceRef().get(0).getId()); break; if (datain.getSourceRef() != null && datain.getSourceRef().size() > 0 && datain.getSourceRef().get(0).getId().equals(taskMultiLoop.getInputDataItem().getId())) { proceed = false; if (datain.getSourceRef() != null && datain.getSourceRef().size() > 0) { if (datain.getTransformation() != null && datain.getTransformation().getBody() != null) { lhsAssociation = datain.getTransformation().getBody(); } else { lhsAssociation = datain.getSourceRef().get(0).getId();
dia.getSourceRef().add(ie); List<DataInput> dataInputs = sp.getIoSpecification().getDataInputs(); for (DataInput di : dataInputs) { ItemAwareElement ie = Bpmn2Factory.eINSTANCE.createItemAwareElement(); ie.setId(inputCollectionStr); dia.getSourceRef().add(ie); dia.setTargetRef(multiInput); sp.getDataInputAssociations().add(dia);
if (inputList != null) { for (DataInputAssociation input : inputList) { List<ItemAwareElement> sourceRef = input.getSourceRef(); if (sourceRef != null) { for (ItemAwareElement iae : sourceRef) {
loopCharacteristics.setLoopDataInputRef(miCollectionInputDI); DataInputAssociation miCollectionInputDataInputAssociation = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); miCollectionInputDataInputAssociation.getSourceRef().add(prop); miCollectionInputDataInputAssociation.setTargetRef(miCollectionInputDI); task.getDataInputAssociations().add(miCollectionInputDataInputAssociation); if (miDataInput != null && miDataInput.length() > 0 && ((MultiInstanceLoopCharacteristics) task.getLoopCharacteristics()).getInputDataItem() != null) { DataInputAssociation dias = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dias.getSourceRef().add(((MultiInstanceLoopCharacteristics) task.getLoopCharacteristics()).getInputDataItem()); List<DataInput> dins = task.getIoSpecification().getDataInputs(); for (DataInput di : dins) {
if (dia.getTargetRef().equals(iedatainput)) { properties.put(MULTIPLEINSTANCECOLLECTIONINPUT, dia.getSourceRef().get(0).getId()); break;
DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.setTargetRef(d); dia.getSourceRef().add(da); task.getDataInputAssociations().add(dia); DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.setTargetRef(datain); dia.getSourceRef().add(da); te.getDataInputAssociation().add(dia); DataInputAssociation dia = Bpmn2Factory.eINSTANCE.createDataInputAssociation(); dia.setTargetRef(d); dia.getSourceRef().add(da); targetElement.getDataInputAssociations().add(dia);