Search in sources :

Example 1 with UserTaskActivityBehavior

use of org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior in project Activiti by Activiti.

the class CdiEventSupportBpmnParseHandler method addCreateListener.

private void addCreateListener(ActivityImpl activity) {
    UserTaskActivityBehavior behavior = getUserTaskActivityBehavior(activity.getActivityBehavior());
    behavior.getTaskDefinition().addTaskListener(TaskListener.EVENTNAME_CREATE, new CdiTaskListener(activity.getId(), BusinessProcessEventType.CREATE_TASK));
}
Also used : UserTaskActivityBehavior(org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior)

Example 2 with UserTaskActivityBehavior

use of org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior in project Activiti by Activiti.

the class CdiEventSupportBpmnParseHandler method addCompleteListener.

private void addCompleteListener(ActivityImpl activity) {
    UserTaskActivityBehavior behavior = getUserTaskActivityBehavior(activity.getActivityBehavior());
    behavior.getTaskDefinition().addTaskListener(TaskListener.EVENTNAME_COMPLETE, new CdiTaskListener(activity.getId(), BusinessProcessEventType.COMPLETE_TASK));
}
Also used : UserTaskActivityBehavior(org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior)

Example 3 with UserTaskActivityBehavior

use of org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior in project Activiti by Activiti.

the class CdiEventSupportBpmnParseHandler method addDeleteListener.

protected void addDeleteListener(ActivityImpl activity) {
    UserTaskActivityBehavior behavior = getUserTaskActivityBehavior(activity.getActivityBehavior());
    behavior.getTaskDefinition().addTaskListener(TaskListener.EVENTNAME_DELETE, new CdiTaskListener(activity.getId(), BusinessProcessEventType.DELETE_TASK));
}
Also used : UserTaskActivityBehavior(org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior)

Example 4 with UserTaskActivityBehavior

use of org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior in project Activiti by Activiti.

the class CdiEventSupportBpmnParseHandler method addAssignListener.

private void addAssignListener(ActivityImpl activity) {
    UserTaskActivityBehavior behavior = getUserTaskActivityBehavior(activity.getActivityBehavior());
    behavior.getTaskDefinition().addTaskListener(TaskListener.EVENTNAME_ASSIGNMENT, new CdiTaskListener(activity.getId(), BusinessProcessEventType.ASSIGN_TASK));
}
Also used : UserTaskActivityBehavior(org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior)

Example 5 with UserTaskActivityBehavior

use of org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior in project Activiti by Activiti.

the class ExecutionEntity method signal.

// methods that translate to operations /////////////////////////////////////
public void signal(String signalName, Object signalData) {
    ensureActivityInitialized();
    SignallableActivityBehavior activityBehavior = (SignallableActivityBehavior) activity.getActivityBehavior();
    try {
        String signalledActivityId = activity.getId();
        activityBehavior.signal(this, signalName, signalData);
        // If needed, dispatch an event indicating an activity was signalled
        boolean isUserTask = (activityBehavior instanceof UserTaskActivityBehavior) || ((activityBehavior instanceof MultiInstanceActivityBehavior) && ((MultiInstanceActivityBehavior) activityBehavior).getInnerActivityBehavior() instanceof UserTaskActivityBehavior);
        if (!isUserTask && Context.getProcessEngineConfiguration() != null && Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) {
            Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createSignalEvent(ActivitiEventType.ACTIVITY_SIGNALED, signalledActivityId, signalName, signalData, this.id, this.processInstanceId, this.processDefinitionId));
        }
    } catch (RuntimeException e) {
        throw e;
    } catch (Exception e) {
        throw new PvmException("couldn't process signal '" + signalName + "' on activity '" + activity.getId() + "': " + e.getMessage(), e);
    }
}
Also used : UserTaskActivityBehavior(org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior) SignallableActivityBehavior(org.activiti.engine.impl.pvm.delegate.SignallableActivityBehavior) PvmException(org.activiti.engine.impl.pvm.PvmException) ActivitiException(org.activiti.engine.ActivitiException) PvmException(org.activiti.engine.impl.pvm.PvmException) MultiInstanceActivityBehavior(org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior)

Aggregations

UserTaskActivityBehavior (org.activiti.engine.impl.bpmn.behavior.UserTaskActivityBehavior)6 ActivitiException (org.activiti.engine.ActivitiException)1 MultiInstanceActivityBehavior (org.activiti.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior)1 PvmException (org.activiti.engine.impl.pvm.PvmException)1 SignallableActivityBehavior (org.activiti.engine.impl.pvm.delegate.SignallableActivityBehavior)1 ActivityImpl (org.activiti.engine.impl.pvm.process.ActivityImpl)1 ProcessDefinitionImpl (org.activiti.engine.impl.pvm.process.ProcessDefinitionImpl)1 ScopeImpl (org.activiti.engine.impl.pvm.process.ScopeImpl)1