Search in sources :

Example 1 with SimpleDataInputAssociation

use of org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation 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)

Example 2 with SimpleDataInputAssociation

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

the class WebServiceActivityBehavior method createDataInputAssociation.

protected AbstractDataAssociation createDataInputAssociation(DataAssociation dataAssociationElement) {
    if (dataAssociationElement.getAssignments().isEmpty()) {
        return new MessageImplicitDataInputAssociation(dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
    } else {
        SimpleDataInputAssociation dataAssociation = new SimpleDataInputAssociation(dataAssociationElement.getSourceRef(), dataAssociationElement.getTargetRef());
        ExpressionManager expressionManager = Context.getProcessEngineConfiguration().getExpressionManager();
        for (org.activiti.bpmn.model.Assignment assignmentElement : dataAssociationElement.getAssignments()) {
            if (StringUtils.isNotEmpty(assignmentElement.getFrom()) && StringUtils.isNotEmpty(assignmentElement.getTo())) {
                Expression from = expressionManager.createExpression(assignmentElement.getFrom());
                Expression to = expressionManager.createExpression(assignmentElement.getTo());
                Assignment assignment = new Assignment(from, to);
                dataAssociation.addAssignment(assignment);
            }
        }
        return dataAssociation;
    }
}
Also used : Assignment(org.activiti.engine.impl.bpmn.data.Assignment) ExpressionManager(org.activiti.engine.impl.el.ExpressionManager) 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)2 Assignment (org.activiti.engine.impl.bpmn.data.Assignment)2 SimpleDataInputAssociation (org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation)2 MessageImplicitDataInputAssociation (org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataInputAssociation)2 ExpressionManager (org.activiti.engine.impl.el.ExpressionManager)1