18 Communicating with Other Processes and Services

Learn how to design your business processes to communicate with other processes and services.

18.1 Defining Process Input and Output

When you add operations to a Business Process Model and Notation (BPMN) process, you are defining points in the process that other processes or services can use to communicate with it. The communication between processes and other processes or services generally requires an input and returns an output.

The flow events that you use to define the BPMN process operations allow you to define input and output arguments. These input and output arguments define the process input and output.

18.1.1 How to Define the Input Arguments for a Process

When you create a process that begins with a message Start event, you must define the input arguments that are passed to the process.

To define the input arguments for a process:

  1. Add a message Start event to your process.
  2. Right-click on the message Start event, then select Properties.
  3. Select the Trigger type as Message.

    Oracle Business Process Composer creates a start event by default with a Trigger type of None so in order to implement it as a Message start event you must set the trigger in the Properties dialog.

  4. Click the Implementation link to go to the Implementation tab.
  5. Select Define Interface.
  6. Click the Add icon.
  7. Determine the name and type of the argument.
  8. Click Apply Changes.

18.1.2 How to Define Data Associations for a Message Start Event

After you have defined the input arguments to your process, you must map them to data objects in your process.

To define data associations for a message start event:

  1. Select the message Start event of your process.
  2. Right click on the Start event and then click Data Associations.
  3. Drag the data objects from the list on the right-hand side to the text boxes listed under Outputs.
  4. Click Apply.

18.1.3 How to Define the Output Arguments for a Process

When you create a process that contains message End events, you must define the output arguments for each End event. These are the output arguments for the process.

To define the output arguments for a process:

  1. Add a message End event to your process.
  2. Right-click on the message End event, then select Properties.
  3. Click the Implementation tab.
  4. Select Define Interface.
  5. Click the Add icon.
  6. Determine the name and type of the argument.
  7. Click Apply Changes.

18.1.4 How to Define Data Association for a Message End Event

After you have defined the output arguments for your process, you must map them to the data objects in your process.

To define data associations for a message end event:

  1. Select a message End event in your process.
  2. Right click on the End event and then click Data Associations.
  3. Drag the data objects from the list on the right-hand side to the text boxes listed under Inputs.
  4. Click Apply.

18.2 Using the Send and Receive Tasks to Communicate Between Processes

You can use the send and receive tasks to invoke another BPMN process and receive messages back from it. Processes that begin with a receive task and contain a send task are exposed as services that can be used by other process and services within an Oracle Business Process Management (Oracle BPM) application.

Figure 18-1 outlines the basic behavior when using send and receive tasks to invoke a process and receive a response.

Figure 18-1 Using the Send and Receive Tasks to Communicate Between Processes

Description of Figure 18-1 follows
Description of "Figure 18-1 Using the Send and Receive Tasks to Communicate Between Processes"

The following steps outline a possible scenario when using the send and receive tasks to communicate between processes.

  1. Process A is invoked.

  2. A token of Process A reaches the send task.

  3. The send task invokes Process B.

    This is defined by the implementation for the send task.

  4. The token of process A proceeds to the next flow object in the process.

  5. The receive task initiates a process instance of Process B.

    The receive task must have the Create Instance property defined. See Starting a Process with the Receive Task..

  6. The newly created token proceeds through process B.

  7. Depending on the specific behavior of your process, the following scenarios may occur:

    1. If the token of Process A reaches a receive task paired with a send task from Process B, the token of Process A waits until a response is received.

      After the response is received, the token of Process A continues to the next flow object.

    2. If the token of Process B reaches a send task paired with a receive task in Process A, Process B sends a response to Process A.

      The token of Process B continues to the next flow object.

  8. Both processes continue running.

    You can use subsequent send and receive pairs to define subsequent communication between the two processes.

18.3 Using Message Throw and Catch Events to Communicate Between Processes

You can use combinations of throw and catch events to invoke and communicate with other BPMN processes.

When using a throw event to invoke another process, the following conditions must be met:

  • The process being invoked must be an asynchronous process.

    Although you can use a message throw event to invoke a synchronous process, there is no mechanism for catching messages synchronously from the process.

    If you invoke a synchronous process use the service task. See Introduction to the Service Task for more information.

  • The first time you use a message throw event it must be paired to the message start event of the other process.

    This is required to trigger the process instance. After the instance has been triggered, you can use subsequent message throw events that are caught by the second process.

Processes that begin with a message start event and end with a message end event are exposed as services that can be used by other processes and services within an Oracle BPM application.

Processes invoked from another process are not considered child processes. This is important to consider when designing processes that use the terminate end event as a process end point. For example, a terminate event in the calling process does not stop a processes invoked with a message throw event.

Figure 18-2 shows the basic behavior when using message throw and catch events to invoke a process and receive a response.

Figure 18-2 Using Message Throw and Catch Events Between Processes

Description of Figure 18-2 follows
Description of "Figure 18-2 Using Message Throw and Catch Events Between Processes"

The following steps outline a possible scenario when using the message throw and catch events to communicate between processes.

  1. Process A is invoked.

  2. The token of Process A reaches a message throw event that is configured to invoke Process B.

  3. The message throw event sends a message to the message start event of Process B.

  4. The token of Process A proceeds to the next flow object.

  5. The message start event triggers an instance of Process B.

  6. The newly created token proceeds through Process B.

  7. Depending on the behavior of your process, the following scenarios may occur:

    1. If the token of Process A reaches a catch event paired with a throw event from Process B, the token of Process A waits until the message is received.

      After the message is received, the token of Process A continues to the next flow object.

    2. If the token of Process B reaches a throw event paired with a catch event in Process A, Process B throws a message to Process A.

      The token of Process B continues to the next flow object.

  8. Both processes continue running.

    You can use subsequent catch and throw event pairs to define subsequent communication between the two processes.

18.4 Defining Conversations

Conversations group the message exchange between two or more processes. The message exchange between processes is called collaboration. Within a project you can define multiple conversations that you can reuse amongst the processes in that project.

18.4.1 Introduction to Conversations

Conversations group the message exchange between two or more processes. The message exchange between processes is called collaboration. Within a project you can define multiple conversations that you can reuse amongst the processes in that project.

Collaboration diagrams allow you to view the process flow together with the interactions your process has with other participants in the conversation.

Your BPM project defines a conversation by default. If you do not want to define multiple conversations you must use this default conversation to gather all the message exchanges amongst the processes in your project.

You can only define one default conversation per project. However you can modify your project to use a different default conversation than the one it uses by default.

The different types of conversations allow you to specify the different types of interaction your process can establish with other processes or services. The following list describes the different types of conversations:

  • Define Interface: Use to define the operations that other services and processes can invoke to interact with a BPMN process.

  • Use Interface: Use to configure your process to use an interface from a component in the Business Catalog.

  • Process Call: Use to invoke another BPMN process.

  • Service Call: Use to invoke a service defined in your BPM project.

18.4.2 Working with Conversations

The following sections describe how to define and configure conversations using Oracle Business Process Composer.

18.4.2.1 How to Define a Conversation
  1. Open your process.
  2. Click the Edit Conversation button in the process editor toolbar.
  3. Click the Add Conversation button.
  4. Provide a name for the conversation.
  5. Select the type of conversation you want to define.
  6. Click OK.
18.4.2.2 How to Set the Default Conversation
  1. Open your process.
  2. Click the Edit Conversation button in the process editor toolbar.
  3. Select a conversation from the list, then click the Edit button.
  4. Click the Default Conversation check box.
  5. Click OK.
18.4.2.3 How to Define a Conversation for a BPMN Flow Object
  1. Open your process.
  2. Right-click one of the following types of BPMN flow objects:
    • Message events (throw and catch)

    • Send and receive tasks

    • Service tasks

    You can only define conversations for these BPM flow objects.

  3. Select Implement.
  4. In the Implementation tab, click the Browse button next to the Conversation text field.
  5. Select a conversation from the list, then click OK.
18.4.2.4 How to View a Collaboration Diagram

To view the collaboration diagram for a process, click the View Collaboration button in the process editor toolbar.

Note:

In the collaboration view, you cannot make changes to the process. To return to normal process editing, click the View Collaboration button again.

18.5 Working with Services

Oracle Business Process Composer allows you to create new services in the business catalog. These services are based on standard web services.

The following sections describe how to create services using Oracle Business Process Composer.

18.5.1 How to Create New Services in the Business Catalog

Services based on web services are defined using a Web Services Description Language (WSDL) file. A WSDL file is an XML file used to describe how web services are implemented. When creating a new service using Oracle Business Process Composer, you can specify a WSDL file stored locally on your machine or one that is available online.

Process developers are responsible for providing a WSDL file or a URL location.

18.5.1.1 Creating New Services

To create a new service:

  1. Open the project where you want to create a new service.
  2. From the main menu, select New then New Service.
  3. Provide the following information:
    • Name: Defines the name of the service as it appears in the business catalog.

    • Type: Defines the type of service being created.

    • WSDL: The source of the WSDL used to create the new service can be one of the following:

      • URL: Specifies the remote URL of the WSDL.

      • File: Specifies either a WSDL or ZIP file on your local file system.

        If using a ZIP file, it can include only WSDL and XSD files. The WSDL file should have valid references.

    • Port Type: Port type specifies the service used.

      A WSDL file exposes one or more port types.

    • Callback Type: Determines the call back type used for this web service.

      This is only applicable to asynchronous services.

    • Transaction Participation.

    • Version.

  4. Click OK.
18.5.1.2 Creating New Services in the Process Editor

To create a new service in the process editor:

  1. Change the palette from BPMN to business catalog.
  2. Click the + button located near services.

    The New Service dialog appears.

  3. Provide the required information.
  4. Click OK.