Search in sources :

Example 1 with MessageImplicitDataOutputAssociation

use of org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataOutputAssociation in project Activiti by Activiti.

the class AbstractExternalInvocationBpmnParseHandler method createDataOutputAssociation.

public AbstractDataAssociation createDataOutputAssociation(BpmnParse bpmnParse, DataAssociation dataAssociationElement) {
    if (StringUtils.isNotEmpty(dataAssociationElement.getSourceRef())) {
        return new MessageImplicitDataOutputAssociation(dataAssociationElement.getTargetRef(), dataAssociationElement.getSourceRef());
    } else {
        Expression transformation = bpmnParse.getExpressionManager().createExpression(dataAssociationElement.getTransformation());
        AbstractDataAssociation dataOutputAssociation = new TransformationDataOutputAssociation(null, dataAssociationElement.getTargetRef(), transformation);
        return dataOutputAssociation;
    }
}
Also used : MessageImplicitDataOutputAssociation(org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataOutputAssociation) TransformationDataOutputAssociation(org.activiti.engine.impl.bpmn.data.TransformationDataOutputAssociation) AbstractDataAssociation(org.activiti.engine.impl.bpmn.data.AbstractDataAssociation) Expression(org.activiti.engine.delegate.Expression)

Example 2 with MessageImplicitDataOutputAssociation

use of org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataOutputAssociation in project Activiti by Activiti.

the class DefaultActivityBehaviorFactory method createCallActivityBehavior.

// Call activity
public CallActivityBehavior createCallActivityBehavior(CallActivity callActivity) {
    String expressionRegex = "\\$+\\{+.+\\}";
    CallActivityBehavior callActivityBehaviour = null;
    if (StringUtils.isNotEmpty(callActivity.getCalledElement()) && callActivity.getCalledElement().matches(expressionRegex)) {
        callActivityBehaviour = new CallActivityBehavior(expressionManager.createExpression(callActivity.getCalledElement()), callActivity.getMapExceptions());
    } else {
        callActivityBehaviour = new CallActivityBehavior(callActivity.getCalledElement(), callActivity.getMapExceptions());
    }
    callActivityBehaviour.setInheritVariables(callActivity.isInheritVariables());
    for (IOParameter ioParameter : callActivity.getInParameters()) {
        if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) {
            Expression expression = expressionManager.createExpression(ioParameter.getSourceExpression().trim());
            callActivityBehaviour.addDataInputAssociation(new SimpleDataInputAssociation(expression, ioParameter.getTarget()));
        } else {
            callActivityBehaviour.addDataInputAssociation(new SimpleDataInputAssociation(ioParameter.getSource(), ioParameter.getTarget()));
        }
    }
    for (IOParameter ioParameter : callActivity.getOutParameters()) {
        if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) {
            Expression expression = expressionManager.createExpression(ioParameter.getSourceExpression().trim());
            callActivityBehaviour.addDataOutputAssociation(new MessageImplicitDataOutputAssociation(ioParameter.getTarget(), expression));
        } else {
            callActivityBehaviour.addDataOutputAssociation(new MessageImplicitDataOutputAssociation(ioParameter.getTarget(), ioParameter.getSource()));
        }
    }
    return callActivityBehaviour;
}
Also used : MessageImplicitDataOutputAssociation(org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataOutputAssociation) IOParameter(org.activiti.bpmn.model.IOParameter) Expression(org.activiti.engine.delegate.Expression) SimpleDataInputAssociation(org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation) CallActivityBehavior(org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior)

Aggregations

Expression (org.activiti.engine.delegate.Expression)2 MessageImplicitDataOutputAssociation (org.activiti.engine.impl.bpmn.webservice.MessageImplicitDataOutputAssociation)2 IOParameter (org.activiti.bpmn.model.IOParameter)1 CallActivityBehavior (org.activiti.engine.impl.bpmn.behavior.CallActivityBehavior)1 AbstractDataAssociation (org.activiti.engine.impl.bpmn.data.AbstractDataAssociation)1 SimpleDataInputAssociation (org.activiti.engine.impl.bpmn.data.SimpleDataInputAssociation)1 TransformationDataOutputAssociation (org.activiti.engine.impl.bpmn.data.TransformationDataOutputAssociation)1