org.jbpm.services.task.lifecycle.listeners

## Class BAMTaskEventListener

- java.lang.Object
- - org.jbpm.services.task.persistence.PersistableEventListener
  - - org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener

- All Implemented Interfaces:
    EventListener, org.kie.api.task.TaskLifeCycleEventListener

      public class BAMTaskEventListener
      extends PersistableEventListener

  This listener implementation populates a table named BAMTASKCUMMARY in order to allow BAM module to query all tasks.

  The available status for a task instance are:

  See Also:
    `
    - Created
    - Ready
    - Reserved
    - InProgress
    - Suspended
    - Completed
    - Failed
    - Error
    - Exited
    - Obsolete

    The BAM module does not use all task predefined stauts, the following list shows the status for a jBPM task and the relationship with the BAM task status:

    - Kie Task status - BAM task status
    - Created - Created
    - Ready - Ready
    - Reserved - Reserved
    - InProgress - InProgress
    - Suspended - Suspended
    - Completed - Completed
    - Exited - Exited
    - Failed - Error
    - Error - Error
    - Obsolete - Error
    `

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static interface` | `BAMTaskEventListener.BAMTaskWorker` Interface for performing additional operations to a `org.jbpm.services.task.impl.model.BAMTaskSummaryImpl` instance.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BAMTaskEventListener(boolean flag)`
    `BAMTaskEventListener(javax.persistence.EntityManagerFactory emf)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterTaskActivatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskAddedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskClaimedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskCompletedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskDelegatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskExitedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskFailedEvent(org.kie.api.task.TaskEvent event)` When a task is failed, the status for dashbuilder integration task must be Exited.
    `void` | `afterTaskForwardedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskForwaredEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskNomiatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskNominatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskReleasedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskResumedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskSkippedEvent(org.kie.api.task.TaskEvent event)` When a task is skipped, the status for dashbuilder integration task must be Exited.
    `void` | `afterTaskStartedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `afterTaskStoppedEvent(org.kie.api.task.TaskEvent event)` When a task is stopped, the status for dashbuilder integration task must be Exited.
    `void` | `afterTaskSuspendedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskActivatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskAddedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskClaimedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskCompletedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskDelegatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskExitedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskFailedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskForwardedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskNominatedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskReleasedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskResumedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskSkippedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskStartedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskStoppedEvent(org.kie.api.task.TaskEvent event)`
    `void` | `beforeTaskSuspendedEvent(org.kie.api.task.TaskEvent event)`
    `protected BAMTaskSummaryImpl` | `createOrUpdateTask(org.kie.api.task.TaskEvent event, org.kie.api.task.model.Status newStatus)` Creates or updates a bam task summary instance.
    `protected BAMTaskSummaryImpl` | `createTask(org.kie.api.task.TaskEvent event, org.kie.api.task.model.Status newStatus, BAMTaskEventListener.BAMTaskWorker worker)` Creates or updates a bam task summary instance.
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `protected BAMTaskSummaryImpl` | `updateTask(org.kie.api.task.TaskEvent event)` Creates or updates a bam task summary instance.
    `protected BAMTaskSummaryImpl` | `updateTask(org.kie.api.task.TaskEvent event, BAMTaskEventListener.BAMTaskWorker worker)` Creates or updates a bam task summary instance.
    `protected BAMTaskSummaryImpl` | `updateTask(org.kie.api.task.TaskEvent event, org.kie.api.task.model.Status newStatus, BAMTaskEventListener.BAMTaskWorker worker)`

    - ### Methods inherited from class org.jbpm.services.task.persistence.PersistableEventListener

      `cleanup, getPersistenceContext`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BAMTaskEventListener

          public BAMTaskEventListener(boolean flag)

    - #### BAMTaskEventListener

          public BAMTaskEventListener(javax.persistence.EntityManagerFactory emf)

  - ### Method Detail

    - #### afterTaskStartedEvent

          public void afterTaskStartedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskActivatedEvent

          public void afterTaskActivatedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskClaimedEvent

          public void afterTaskClaimedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskCompletedEvent

          public void afterTaskCompletedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskAddedEvent

          public void afterTaskAddedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskSkippedEvent

          public void afterTaskSkippedEvent(org.kie.api.task.TaskEvent event)

      When a task is skipped, the status for dashbuilder integration task must be Exited.
      Parameters:
        `ti` - The task.

    - #### afterTaskStoppedEvent

          public void afterTaskStoppedEvent(org.kie.api.task.TaskEvent event)

      When a task is stopped, the status for dashbuilder integration task must be Exited.
      Parameters:
        `ti` - The task.

    - #### afterTaskFailedEvent

          public void afterTaskFailedEvent(org.kie.api.task.TaskEvent event)

      When a task is failed, the status for dashbuilder integration task must be Exited.
      Parameters:
        `ti` - The task.

    - #### afterTaskExitedEvent

          public void afterTaskExitedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskReleasedEvent

          public void afterTaskReleasedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskDelegatedEvent

          public void afterTaskDelegatedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskForwaredEvent

          public void afterTaskForwaredEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskNomiatedEvent

          public void afterTaskNomiatedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskResumedEvent

          public void afterTaskResumedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskSuspendedEvent

          public void afterTaskSuspendedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskForwardedEvent

          public void afterTaskForwardedEvent(org.kie.api.task.TaskEvent event)

    - #### afterTaskNominatedEvent

          public void afterTaskNominatedEvent(org.kie.api.task.TaskEvent event)

    - #### updateTask

          protected BAMTaskSummaryImpl updateTask(org.kie.api.task.TaskEvent event,
                                      BAMTaskEventListener.BAMTaskWorker worker)

      Creates or updates a bam task summary instance.
      Parameters:
        `ti` - The source task
        `worker` - Perform additional operations to the bam task summary instance.
      Returns:
        The created or updated bam task summary instance.

    - #### updateTask

          protected BAMTaskSummaryImpl updateTask(org.kie.api.task.TaskEvent event)

      Creates or updates a bam task summary instance.
      Parameters:
        `ti` - The source task
      Returns:
        The created or updated bam task summary instance.

    - #### createOrUpdateTask

          protected BAMTaskSummaryImpl createOrUpdateTask(org.kie.api.task.TaskEvent event,
                                              org.kie.api.task.model.Status newStatus)

      Creates or updates a bam task summary instance.
      Parameters:
        `ti` - The source task
        `newStatus` - The new state for the task.
      Returns:
        The created or updated bam task summary instance.

    - #### createTask

          protected BAMTaskSummaryImpl createTask(org.kie.api.task.TaskEvent event,
                                      org.kie.api.task.model.Status newStatus,
                                      BAMTaskEventListener.BAMTaskWorker worker)

      Creates or updates a bam task summary instance.
      Parameters:
        `ti` - The source task
        `newStatus` - The new state for the task.
        `worker` - Perform additional operations to the bam task summary instance.
      Returns:
        The created or updated bam task summary instance.

    - #### updateTask

          protected BAMTaskSummaryImpl updateTask(org.kie.api.task.TaskEvent event,
                                      org.kie.api.task.model.Status newStatus,
                                      BAMTaskEventListener.BAMTaskWorker worker)

    - #### beforeTaskActivatedEvent

          public void beforeTaskActivatedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskClaimedEvent

          public void beforeTaskClaimedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskSkippedEvent

          public void beforeTaskSkippedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskStartedEvent

          public void beforeTaskStartedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskStoppedEvent

          public void beforeTaskStoppedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskCompletedEvent

          public void beforeTaskCompletedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskFailedEvent

          public void beforeTaskFailedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskAddedEvent

          public void beforeTaskAddedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskExitedEvent

          public void beforeTaskExitedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskReleasedEvent

          public void beforeTaskReleasedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskResumedEvent

          public void beforeTaskResumedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskSuspendedEvent

          public void beforeTaskSuspendedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskForwardedEvent

          public void beforeTaskForwardedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskDelegatedEvent

          public void beforeTaskDelegatedEvent(org.kie.api.task.TaskEvent event)

    - #### beforeTaskNominatedEvent

          public void beforeTaskNominatedEvent(org.kie.api.task.TaskEvent event)

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2001–2016 JBoss by Red Hat. All rights reserved.