org.activiti.engine.delegate.event.impl

## Class ActivitiEventBuilder

- java.lang.Object
- - org.activiti.engine.delegate.event.impl.ActivitiEventBuilder

-     public class ActivitiEventBuilder
      extends Object

  Builder class used to create `ActivitiEvent` implementations.
  Author:
    Frederik Heremans

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ActivitiEventBuilder()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ActivitiActivityCancelledEvent` | `createActivityCancelledEvent(String activityId, String activityName, String executionId, String processInstanceId, String processDefinitionId, String activityType, String behaviourClass, Object cause)`
    `static ActivitiActivityEvent` | `createActivityEvent(ActivitiEventType type, String activityId, String activityName, String executionId, String processInstanceId, String processDefinitionId, String activityType, String behaviourClass)`
    `static ActivitiCancelledEvent` | `createCancelledEvent(String executionId, String processInstanceId, String processDefinitionId, Object cause)`
    `static ActivitiEntityEvent` | `createEntityEvent(ActivitiEventType type, Object entity)`
    `static ActivitiEntityEvent` | `createEntityEvent(ActivitiEventType type, Object entity, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiEntityEvent` | `createEntityExceptionEvent(ActivitiEventType type, Object entity, Throwable cause)`
    `static ActivitiEntityEvent` | `createEntityExceptionEvent(ActivitiEventType type, Object entity, Throwable cause, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiEntityWithVariablesEvent` | `createEntityWithVariablesEvent(ActivitiEventType type, Object entity, Map variables, boolean localScope)`
    `static ActivitiErrorEvent` | `createErrorEvent(ActivitiEventType type, String activityId, String errorCode, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiEvent` | `createEvent(ActivitiEventType type, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiEvent` | `createGlobalEvent(ActivitiEventType type)`
    `static ActivitiMembershipEvent` | `createMembershipEvent(ActivitiEventType type, String groupId, String userId)`
    `static ActivitiMessageEvent` | `createMessageEvent(ActivitiEventType type, String activityId, String messageName, Object payload, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiProcessStartedEvent` | `createProcessStartedEvent(Object entity, Map variables, boolean localScope)`
    `static ActivitiSequenceFlowTakenEvent` | `createSequenceFlowTakenEvent(ActivitiEventType type, String sequenceFlowId, String sourceActivityId, String sourceActivityName, String sourceActivityType, String sourceActivityBehaviorClass, String targetActivityId, String targetActivityName, String targetActivityType, String targetActivityBehaviorClass)`
    `static ActivitiSignalEvent` | `createSignalEvent(ActivitiEventType type, String activityId, String signalName, Object signalData, String executionId, String processInstanceId, String processDefinitionId)`
    `static ActivitiVariableEvent` | `createVariableEvent(ActivitiEventType type, String variableName, Object variableValue, org.activiti.engine.impl.variable.VariableType variableType, String taskId, String executionId, String processInstanceId, String processDefinitionId)`
    `protected static void` | `populateEventWithCurrentContext(ActivitiEventImpl event)`

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

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

- - ### Constructor Detail

    - #### ActivitiEventBuilder

          public ActivitiEventBuilder()

  - ### Method Detail

    - #### createGlobalEvent

          public static ActivitiEvent createGlobalEvent(ActivitiEventType type)

      Parameters:
        `type` - type of event
      Returns:
        an `ActivitiEvent` that doesn't have it's execution context-fields filled, as the event is a global event, independant of any running execution.

    - #### createEvent

          public static ActivitiEvent createEvent(ActivitiEventType type,
                                                  String executionId,
                                                  String processInstanceId,
                                                  String processDefinitionId)

    - #### createEntityEvent

          public static ActivitiEntityEvent createEntityEvent(ActivitiEventType type,
                                                              Object entity)

      Parameters:
        `type` - type of event
        `entity` - the entity this event targets
      Returns:
        an `ActivitiEntityEvent`. In case an `ExecutionContext` is active, the execution related event fields will be populated. If not, execution details will be reteived from the `Object` if possible.

    - #### createProcessStartedEvent

          public static ActivitiProcessStartedEvent createProcessStartedEvent(Object entity,
                                                                              Map variables,
                                                                              boolean localScope)

      Parameters:
        `entity` - the entity this event targets
        `variables` - the variables associated with this entity
      Returns:
        an `ActivitiEntityEvent`. In case an `ExecutionContext` is active, the execution related event fields will be populated. If not, execution details will be reteived from the `Object` if possible.

    - #### createEntityWithVariablesEvent

          public static ActivitiEntityWithVariablesEvent createEntityWithVariablesEvent(ActivitiEventType type,
                                                                                        Object entity,
                                                                                        Map variables,
                                                                                        boolean localScope)

      Parameters:
        `type` - type of event
        `entity` - the entity this event targets
        `variables` - the variables associated with this entity
      Returns:
        an `ActivitiEntityEvent`. In case an `ExecutionContext` is active, the execution related event fields will be populated. If not, execution details will be reteived from the `Object` if possible.

    - #### createSequenceFlowTakenEvent

          public static ActivitiSequenceFlowTakenEvent createSequenceFlowTakenEvent(ActivitiEventType type,
                                                                                    String sequenceFlowId,
                                                                                    String sourceActivityId,
                                                                                    String sourceActivityName,
                                                                                    String sourceActivityType,
                                                                                    String sourceActivityBehaviorClass,
                                                                                    String targetActivityId,
                                                                                    String targetActivityName,
                                                                                    String targetActivityType,
                                                                                    String targetActivityBehaviorClass)

    - #### createEntityEvent

          public static ActivitiEntityEvent createEntityEvent(ActivitiEventType type,
                                                              Object entity,
                                                              String executionId,
                                                              String processInstanceId,
                                                              String processDefinitionId)

      Parameters:
        `type` - type of event
        `entity` - the entity this event targets
      Returns:
        an `ActivitiEntityEvent`

    - #### createEntityExceptionEvent

          public static ActivitiEntityEvent createEntityExceptionEvent(ActivitiEventType type,
                                                                       Object entity,
                                                                       Throwable cause)

      Parameters:
        `type` - type of event
        `entity` - the entity this event targets
        `cause` - the cause of the event
      Returns:
        an `ActivitiEntityEvent` that is also instance of `ActivitiExceptionEvent`. In case an `ExecutionContext` is active, the execution related event fields will be populated.

    - #### createEntityExceptionEvent

          public static ActivitiEntityEvent createEntityExceptionEvent(ActivitiEventType type,
                                                                       Object entity,
                                                                       Throwable cause,
                                                                       String executionId,
                                                                       String processInstanceId,
                                                                       String processDefinitionId)

      Parameters:
        `type` - type of event
        `entity` - the entity this event targets
        `cause` - the cause of the event
      Returns:
        an `ActivitiEntityEvent` that is also instance of `ActivitiExceptionEvent`.

    - #### createActivityEvent

          public static ActivitiActivityEvent createActivityEvent(ActivitiEventType type,
                                                                  String activityId,
                                                                  String activityName,
                                                                  String executionId,
                                                                  String processInstanceId,
                                                                  String processDefinitionId,
                                                                  String activityType,
                                                                  String behaviourClass)

    - #### createActivityCancelledEvent

          public static ActivitiActivityCancelledEvent createActivityCancelledEvent(String activityId,
                                                                                    String activityName,
                                                                                    String executionId,
                                                                                    String processInstanceId,
                                                                                    String processDefinitionId,
                                                                                    String activityType,
                                                                                    String behaviourClass,
                                                                                    Object cause)

    - #### createCancelledEvent

          public static ActivitiCancelledEvent createCancelledEvent(String executionId,
                                                                    String processInstanceId,
                                                                    String processDefinitionId,
                                                                    Object cause)

    - #### createSignalEvent

          public static ActivitiSignalEvent createSignalEvent(ActivitiEventType type,
                                                              String activityId,
                                                              String signalName,
                                                              Object signalData,
                                                              String executionId,
                                                              String processInstanceId,
                                                              String processDefinitionId)

    - #### createMessageEvent

          public static ActivitiMessageEvent createMessageEvent(ActivitiEventType type,
                                                                String activityId,
                                                                String messageName,
                                                                Object payload,
                                                                String executionId,
                                                                String processInstanceId,
                                                                String processDefinitionId)

    - #### createErrorEvent

          public static ActivitiErrorEvent createErrorEvent(ActivitiEventType type,
                                                            String activityId,
                                                            String errorCode,
                                                            String executionId,
                                                            String processInstanceId,
                                                            String processDefinitionId)

    - #### createVariableEvent

          public static ActivitiVariableEvent createVariableEvent(ActivitiEventType type,
                                                                  String variableName,
                                                                  Object variableValue,
                                                                  org.activiti.engine.impl.variable.VariableType variableType,
                                                                  String taskId,
                                                                  String executionId,
                                                                  String processInstanceId,
                                                                  String processDefinitionId)

    - #### createMembershipEvent

          public static ActivitiMembershipEvent createMembershipEvent(ActivitiEventType type,
                                                                      String groupId,
                                                                      String userId)

    - #### populateEventWithCurrentContext

          protected static void populateEventWithCurrentContext(ActivitiEventImpl event)

Copyright © 2016 Alfresco. All rights reserved.