private Assignment assignment(String from, String to) { Assignment assignment = bpmn2.createAssignment(); FormalExpression fromExpr = bpmn2.createFormalExpression(); fromExpr.setBody(asCData(from)); assignment.setFrom(fromExpr); FormalExpression toExpr = bpmn2.createFormalExpression(); toExpr.setBody(to); assignment.setTo(toExpr); return assignment; }
FormalExpression toExp = Bpmn2Factory.eINSTANCE.createFormalExpression(); toExp.setBody(task.getId() + "_TaskNameInputX"); taskNameAssignment.setTo(toExp); taskNameDataInputAssociation.getAssignment().add(taskNameAssignment); task.getDataInputAssociations().add(taskNameDataInputAssociation); toExpression.setBody(dia.getTargetRef().getId()); a.setFrom(fromExpression); a.setTo(toExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia);
toExpression.setBody(dia.getTargetRef().getId()); a.setFrom(fromExpression); a.setTo(toExpression); dia.getAssignment().add(a); event.getDataInputAssociation().add(dia);
toExpression.setBody(dia.getTargetRef().getId()); a.setFrom(fromExpression); a.setTo(toExpression); dia.getAssignment().add(a); callActivity.getDataInputAssociations().add(dia);
toExpression.setBody(dia.getTargetRef().getId()); a.setFrom(fromExpression); a.setTo(toExpression); dia.getAssignment().add(a); sp.getDataInputAssociations().add(dia);
public DataInputAssociation getDataInputAssociation() { DataInputAssociation dataInputAssociation = bpmn2.createDataInputAssociation(); Assignment assignment = bpmn2.createAssignment(); String id = getDataInput().getId(); FormalExpression toExpr = bpmn2.createFormalExpression(); toExpr.setBody(id); assignment.setTo(toExpr); FormalExpression fromExpr = bpmn2.createFormalExpression(); // this should be handled **outside** the marshallers! String decodedExpression = decode(expression); String cdataExpression = asCData(decodedExpression); fromExpr.setBody(cdataExpression); assignment.setFrom(fromExpr); dataInputAssociation .getAssignment().add(assignment); dataInputAssociation .setTargetRef(getDataInput()); return dataInputAssociation; }
groupToExpression.setBody(foundInput.getId()); a.setFrom(groupFromExpression); a.setTo(groupToExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia); skippableToExpression.setBody(foundInput.getId()); a.setFrom(skippableFromExpression); a.setTo(skippableToExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia); commentToExpression.setBody(foundInput.getId()); a.setFrom(commentFromExpression); a.setTo(commentToExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia); descriptionToExpression.setBody(foundInput.getId()); a.setFrom(descriptionFromExpression); a.setTo(descriptionToExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia); priorityToExpression.setBody(foundInput.getId()); a.setFrom(priorityFromExpression); a.setTo(priorityToExpression); dia.getAssignment().add(a); task.getDataInputAssociations().add(dia);
@Test public void urlEncodeConstants() throws UnsupportedEncodingException { String decoded = "<<<#!!!#>>>"; String expected = URLEncoder.encode(decoded, "UTF-8"); Assignment assignment = bpmn2.createAssignment(); FormalExpression from = bpmn2.createFormalExpression(); from.setBody(decoded); FormalExpression to = bpmn2.createFormalExpression(); to.setBody("ID"); assignment.setFrom(from); assignment.setTo(to); InputAssignmentReader iar = new InputAssignmentReader(assignment, "ID"); AssociationDeclaration associationDeclaration = iar.getAssociationDeclaration(); assertEquals(AssociationDeclaration.Type.FromTo, associationDeclaration.getType()); assertEquals(expected, associationDeclaration.getSource()); } }