Starting a Process Instance

Starting a process instance involves "creating" an instance of a process template.

The way in which you create, or start, an instance of a process template depends on the trigger type of the start event in the process template definition, as follows:

  • "None" - A process with a start event with this trigger type can be directly started using the createProcessInstance function. This topic describes starting a process instance using the createProcessInstance function
  • "Message" - A process with a start event with this trigger type can be started in the following ways:
    • If the process was "published as a business service", an instance of the process is started by starting the business service. For information, see Starting a Business Service. This is a common way to start a process instance.
    • If the process was "published as a REST service", an instance of the process is started by using the startProcessIncomingReceiveTask function.

The following diagram shows an example of how calls to the ProcessManagementService API can be used to start a process instance.

Starting a Process Instance

Procedure

  1. Find the available process templates.

    The listProcessTemplates function can be used to list available process templates on the node. (You could also use the queryProcessTemplates or queryProcessTemplatesAlt functions to get a list of process templates.)

    The response from the listProcessTemplates function provides module names, process name, and versions of the available process templates. These are needed when calling the createProcessInstance function to start a process instance.

  2. Get starter operations using the listStarterOperations function.

    Starter operations refer to start events of processes. To be able to directly start an instance of a process template, the start event of the process must have a trigger type of "None" (as opposed to a trigger type of "Message", which requires that the process be started by a business service).

  3. If the process template for which you are starting an instance has "start parameters" (also known as "formal parameters"), which are used to pass data into the process instance being started, you should also call the getStarterOperationInfo function to get the names of the available start parameters.
  4. Start the process instance.

    The createProcessInstance function is used to start the process instance and pass in start parameters, if required.

    The function returns the process ID of the instance that is started.