Search in sources :

Example 11 with CamundaTaskListener

use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaTaskListener in project camunda-bpmn-model by camunda.

the class AbstractUserTaskBuilder method camundaTaskListenerClass.

/**
 * Add a class based task listener with specified event name
 *
 * @param eventName - event names to listen to
 * @param fullQualifiedClassName - a string representing a class
 * @return the builder object
 */
public B camundaTaskListenerClass(String eventName, String fullQualifiedClassName) {
    CamundaTaskListener executionListener = createInstance(CamundaTaskListener.class);
    executionListener.setCamundaEvent(eventName);
    executionListener.setCamundaClass(fullQualifiedClassName);
    addExtensionElement(executionListener);
    return myself;
}
Also used : CamundaTaskListener(org.camunda.bpm.model.bpmn.instance.camunda.CamundaTaskListener)

Example 12 with CamundaTaskListener

use of org.camunda.bpm.model.bpmn.instance.camunda.CamundaTaskListener in project camunda-bpm-platform by camunda.

the class TaskListenerProcessEngineServicesAccessTest method createModelAccessTask.

protected Task createModelAccessTask(BpmnModelInstance modelInstance, Class<?> delegateClass) {
    UserTask task = modelInstance.newInstance(UserTask.class);
    task.setId("userTask");
    CamundaTaskListener executionListener = modelInstance.newInstance(CamundaTaskListener.class);
    executionListener.setCamundaEvent(TaskListener.EVENTNAME_CREATE);
    executionListener.setCamundaClass(delegateClass.getName());
    task.builder().addExtensionElement(executionListener);
    return task;
}
Also used : CamundaTaskListener(org.camunda.bpm.model.bpmn.instance.camunda.CamundaTaskListener) UserTask(org.camunda.bpm.model.bpmn.instance.UserTask)

Aggregations

CamundaTaskListener (org.camunda.bpm.model.bpmn.instance.camunda.CamundaTaskListener)12 Test (org.junit.Test)6 UserTask (org.camunda.bpm.model.bpmn.instance.UserTask)2 CamundaField (org.camunda.bpm.model.bpmn.instance.camunda.CamundaField)1 CamundaScript (org.camunda.bpm.model.bpmn.instance.camunda.CamundaScript)1 ModelTypeInstanceContext (org.camunda.bpm.model.xml.impl.instance.ModelTypeInstanceContext)1 ModelElementTypeBuilder (org.camunda.bpm.model.xml.type.ModelElementTypeBuilder)1 SequenceBuilder (org.camunda.bpm.model.xml.type.child.SequenceBuilder)1