Search in sources :

Example 1 with FlowNodeActivityBehavior

use of org.camunda.bpm.engine.impl.bpmn.behavior.FlowNodeActivityBehavior in project camunda-bpm-platform by camunda.

the class PvmAtomicOperationActivityLeave method execute.

public void execute(PvmExecutionImpl execution) {
    execution.activityInstanceDone();
    ActivityBehavior activityBehavior = getActivityBehavior(execution);
    if (activityBehavior instanceof FlowNodeActivityBehavior) {
        FlowNodeActivityBehavior behavior = (FlowNodeActivityBehavior) activityBehavior;
        ActivityImpl activity = execution.getActivity();
        String activityInstanceId = execution.getActivityInstanceId();
        if (activityInstanceId != null) {
            LOG.debugLeavesActivityInstance(execution, activityInstanceId);
        }
        try {
            behavior.doLeave(execution);
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new PvmException("couldn't leave activity <" + activity.getProperty("type") + " id=\"" + activity.getId() + "\" ...>: " + e.getMessage(), e);
        }
    } else {
        throw new PvmException("Behavior of current activity is not an instance of " + FlowNodeActivityBehavior.class.getSimpleName() + ". Execution " + execution);
    }
}
Also used : ActivityImpl(org.camunda.bpm.engine.impl.pvm.process.ActivityImpl) FlowNodeActivityBehavior(org.camunda.bpm.engine.impl.bpmn.behavior.FlowNodeActivityBehavior) ActivityBehavior(org.camunda.bpm.engine.impl.pvm.delegate.ActivityBehavior) ActivityBehaviorUtil.getActivityBehavior(org.camunda.bpm.engine.impl.util.ActivityBehaviorUtil.getActivityBehavior) FlowNodeActivityBehavior(org.camunda.bpm.engine.impl.bpmn.behavior.FlowNodeActivityBehavior) PvmException(org.camunda.bpm.engine.impl.pvm.PvmException) PvmException(org.camunda.bpm.engine.impl.pvm.PvmException)

Aggregations

FlowNodeActivityBehavior (org.camunda.bpm.engine.impl.bpmn.behavior.FlowNodeActivityBehavior)1 PvmException (org.camunda.bpm.engine.impl.pvm.PvmException)1 ActivityBehavior (org.camunda.bpm.engine.impl.pvm.delegate.ActivityBehavior)1 ActivityImpl (org.camunda.bpm.engine.impl.pvm.process.ActivityImpl)1 ActivityBehaviorUtil.getActivityBehavior (org.camunda.bpm.engine.impl.util.ActivityBehaviorUtil.getActivityBehavior)1