Search in sources :

Example 1 with Assignment

use of org.activiti.engine.impl.bpmn.data.Assignment in project Activiti by Activiti.

the class AbstractExternalInvocationBpmnParseHandler method createDataInputAssociation.

public AbstractDataAssociation createDataInputAssociation(BpmnParse bpmnParse, DataAssociation dataAssociationElement) {
    if (dataAssociationElement.getAssignments().isEmpty()) {
        return new MessageImplicitDataInputAssociation(dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
    } else {
        SimpleDataInputAssociation dataAssociation = new SimpleDataInputAssociation(dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
        for (org.activiti.bpmn.model.Assignment assigmentElement : dataAssociationElement.getAssignments()) {
            if (StringUtils.isNotEmpty(assigmentElement.getFrom()) && StringUtils.isNotEmpty(assigmentElement.getTo())) {
                Expression from = bpmnParse.getExpressionManager().createExpression(assigmentElement.getFrom());
                Expression to = bpmnParse.getExpressionManager().createExpression(assigmentElement.getTo());
                Assignment assignment = new Assignment(from, to);
                dataAssociation.addAssignment(assignment);
            }
        }
        return dataAssociation;
    }
}
Also used : Assignment(org.activiti.engine.impl.bpmn.data.Assignment) Expression(org.activiti.engine.delegate.Expression) SimpleDataInputAssociation(org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation) MessageImplicitDataInputAssociation(org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataInputAssociation)

Aggregations

Expression (org.activiti.engine.delegate.Expression)1 Assignment (org.activiti.engine.impl.bpmn.data.Assignment)1 SimpleDataInputAssociation (org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation)1 MessageImplicitDataInputAssociation (org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataInputAssociation)1