6.4. Activities

Activity has no state (only started and finished date). Notion of state at this level depends only on the type of behavior defined within the activity. A specific body of the activity is created according the type of the activity (Task, Subflow, Route, Automatic). The state is implemented by the body. At now only task has a life cycle.

States of task are: INITIAL, READY, EXECUTING, SUSPENDED, FINISHED. Suspended state can be reached either from READY or from EXECUTING. Transition is also reciproque.

6.4.1. Activity Basics

The activity is the basic unit of work within a process.

Several types of activity exist according on the activity definition.

  • Manual activity (startMode = manual, Implementation = No): When the execution enters a manual activity a task (aka human task or user task) is created. QueryRuntimeAPI allows to get access to the task according on its state. RuntimeAPI allows to manage the task (start, suspend, resume, finish). In further release task could be managed by an other module.

  • Automatic activity (startMode = automatic, Implementation = No) : the activity is automatically executed by the engine.

  • Route: (Route element): the activity is automatically executed by the engine.

  • Subflow activity (implementation = Subflow startMode = automatic): the activity is automatically executed by the engine.

Task has its own life cycle whith the folowing states:

  • Initial: This is the state of an activity ready to be started. There are two possible situations for this state to occur. In the first, an activity has no parent activity (this is the first activity of the workflow process). In the second, a normal activity has parent activities that have all terminated successfully, and whose transition conditions to the activity have been successfully evaluated.

  • Ready: This is the state of an activity waiting for some processing to complete before being ready to run. In the case of normal activities, at least one of the parent activities is still executing. In the case of an activity that can be anticipated, at least one of the parent activities has not started.

  • Executing: An activity in execution.

  • Suspended: An activity having initially a Ready state or Executing state has been suspended. Resume operation put back the activity with its initial state. Its intial assigned user is also restored.

  • Finished: An activity that has terminated successfully.

Bonita engine creates a common object in order to manage runtime informations for all activities. The interface InstanceActivity is returned by a lot of the QueryRuntimeAPI methods to give access to these runtime informations. According the type of the activity, a specialized body can be acceeded.

  • Task body

  • Automatic body

  • Route body

  • Subflow body

Activity itself has no states. Only start and finish date are managed.

Route and subflow activity type can't execute hook. Task has its own hook events. Automatic activity can execute one type of hook event executed after the execution enters in the activity.