18 Work with Business Processes

You can use business processes in your application to automate assigning tasks to users and creating task lists. After registering your business processes in your visual application, you can add UI components to your pages that start processes and that can be used to complete user tasks.

Note:

If you have an Oracle Traditional Cloud Account, your application can work with business processes only if your Oracle Visual Builder instance is associated with an Oracle Process Cloud Service instance. Oracle Visual Builder administrators can create the association between the services.

If you have an Oracle Cloud Account with IDCS and want to work with business processes, you need to provision the Enterprise edition of Oracle Integration, which includes the Processes and Oracle Visual Builder features.

Note:

  • This chapter describes working with Oracle Process Cloud Service, which is included in the Enterprise edition of Oracle Integration Gen 2. This service is now deprecated; for details, see Deprecated Features.
  • Oracle Process Cloud Service is not the same as OCI Process Automation. OCI Process Automation is a separate product.

About Using Processes in Your Application

You can create business processes to help automate tasks that need to be performed by application users. A process might include tasks such as reviewing data, approving or rejecting requests, and submitting files.

For example, completing a service or travel request is a process that might have several steps and involve several people. You can create a business process that is automatically initiated when a user submits a travel request in the application. Your process can generate the user tasks, such as getting approvals and submitting documents, and assign them to the appropriate users when they need to be performed. Logged in users might see a list of tasks they need to do or the status of their requests. Employees might see a list of requests that they submitted, and managers might see the requests that they need to approve or reject.

After you create a process in an Oracle Process Cloud Service application, you can register the process in your visual application and add code to pages in your web or mobile applications to initiate the process. You can also add process actions to action chains that can be triggered by events in your application.

Add a Business Process to an Application

When adding a business process to an application, you can use business process aliases that are registered on the Process Server.

When you use an alias, the code that you add to the page refers to the alias rather than to a specific version of the process, and you can update the process version without changing the code by updating the alias in the Process Alias editor.

The process must be one that exists on the Oracle Process Cloud Service instance.

To add a business process to an application:

  1. Open Processes in the Navigator. As soon as you open Processes for the first time, Visual Builder configures a Process Server.

  2. Click + Register Deployed Process to open the Register Deployed Process dialog box.



  3. Select the process you want to add.

  4. Type the alias you want to use for the process, if you want to change it. Click Add.



  5. Repeat steps 2 and 3 to add aliases for more business processes. Click Close when you are finished adding aliases.

The aliases for each of the business processes that you added to your application are listed in the Processes pane. You can select an alias to open it in the editor.

Modify a Business Process Alias

A business process alias points to a revision of a process in a specific Process application registered in a test instance or a production instance.

You can use the process editor to modify the target of your process alias to point to a different process and to automatically point to a default or more recent revision instead of a specific revision.

When you are developing your application, you will want your alias to point to a process on a test instance. When you are ready to stage or publish your application, you will need to modify the alias to point to a process on a production instance.

To update a process alias:

  1. In the Processes pane, open the alias in the Process Alias editor.

    The Process Alias editor's Settings tab contains read-only fields that identify the name of the alias, the Process Application, and the Process Name that the alias points to. The editor's Code Snippets tab shows the code that you will copy into pages in your application.


    Description of process-alias-editor.png follows
    Description of the illustration process-alias-editor.png
  2. Click the Choose a different process icon (Choose a different process icon) next to the Registered Deployed Process field to select a new process in the Registered Deployed Process dialog box.

    The read-only text field displays the process that the alias points to.


    Description of process-alias-editor-detail.png follows
    Description of the illustration process-alias-editor-detail.png

    If you select the Static option when the alias points to a process on a test instance, you will see the following warning: A test instance has been selected. When the application is staged or published, another deployed process will need to be selected. The default is Dynamic.

Navigate to Your Process Instance

If you have a configured connection to a Process Server, you can use the Processes menu to navigate directly to your Process instance.

Click the menu and select Design Processes to navigate to the Process Applications tab of Oracle Process Cloud Service, where you can create, edit, publish, and test processes.

Click the menu and select Manage Processes to navigate to the My Tasks tab of Oracle Process Cloud Service , where you can complete assigned tasks.

Click the menu and select Test Connection to test the connection to your Process Server.



Add a Process to a Page

After you create an alias for a business process, you can add the code for the process by copying the process’s HTML and JSON code into the page’s source code in the editor. The Code Snippets tab in the Process Alias editor contains a description and code used for each of the process’s available operations.

To use code snippets to add a process to a page:

  1. Open the process you want to add in the Process Alias editor.
  2. Click the Code Snippets tab and select the action you want to add.

    When you select an action, the Info tab contains details about the action, including descriptions of objects, and the properties, parameters, and outcomes of actions.


    Description of process-alias-code-operations.png follows
    Description of the illustration process-alias-code-operations.png
  3. Click the HTML tab to copy the HTML source for the action.
  4. Open the page where you want to add the process in the Page Designer.
  5. Click Code in the toolbar to open the page’s HTML code in the editor.
  6. Paste the HTML code you copied into the page’s HTML editor.

    When you paste the HTML code into the page you might see errors in the editor. The errors should be resolved after you add the JSON metadata.

  7. In the Process Alias editor, click the alias' JSON tab to copy the content.
  8. Click the page's JSON tab to edit the page’s JSON file.

    Each page uses a JSON file to describe the page’s metadata, such as the variables and action chains that are defined for the page.


    Description of process-alias-paste-json.png follows
    Description of the illustration process-alias-paste-json.png
  9. Paste the JSON metadata for the process into the correct location in the page’s JSON file.

    The JSON metadata for a process might contain definitions for various artifacts, including action chains, variables, and imports. You need to edit the page’s JSON to add the process’s metadata in the correct location. The editor will show warnings and hints in the margins to indicate where there are possible problems with the syntax.

Code snippets are not the only way to add a process to a page. You can also display processes and tasks in tables and lists, and you can use the Add Task Actions quick start for a table or list to allow users to complete tasks.

Add a Process to an Action Chain

When you are building an action chain in the editor, you can add business process actions to the chain.

You can add process actions to an action chain by dragging the actions from the Process category in the Action Chain editor. The actions correspond to the operations described in the Code Snippets tab of the Process Alias editor. The Info tab in the Code Snippets tab contains a description of each action and its properties and parameters. A business process might have multiple interfaces. In the editor, when selecting a process, you will need to select one of the process’s interfaces, and the interface you select will determine the action parameters that you will need to specify in the Properties pane. See Visually Create an Action Chain.

To add a process operation to an action chain:

  1. Open the action chain in the Action Chain editor. Select the component on the canvas.

    Alternatively, you can create a new action chain that is triggered by a component event and add process actions to the chain.

  2. Locate the Process category in the Action Chain editor.

    The Process category in the Action Chain editor contains process actions. Each action is described in the Info tab in the Process Alias editor. See Add a Process to a Page.


    Description of process-action-chain-editor.png follows
    Description of the illustration process-action-chain-editor.png
  3. Drag the action you want to add onto the Add icon ( Add icon ) in the action chain where you want to add the action.
    The following steps apply if you select the Start Process action.
  4. Click Select next to Process Interface in the Properties pane.
  5. Select the process interface for the business process in the Select Process Interface dialog box. Click Select.

    The Select Process Interface dialog box lets you choose a process alias that you have created or a process definition available on the Process server.

    The business process that you select may have one or more process interfaces. Expand the process node in the dialog box to see the available interfaces.


    Description of process-action-chain-select.png follows
    Description of the illustration process-action-chain-select.png
  6. Specify the interface’s required properties and parameters in the Properties pane.

    Depending on the process interface for the process, you might need to map the interface’s required input parameters to variables.


    Description of process-action-chain-properties.png follows
    Description of the illustration process-action-chain-properties.png

Start and Complete Processes from Visual Builder

To be able to start a process from Visual Builder, you must configure it in your Process instance to use a Message Start or Form Start event.

You can use the following kinds of start events in Oracle Process Cloud Service:

  • Message Start events with simple type parameters

  • Message Start events with complex business type parameters

  • Form Start events, which can use a mixture of types as parameters

In Visual Builder, you can map the message parameters to page variables, business objects, or service connection endpoints. You can then set up forms and action chains that execute your processes, and tables or lists that display processes and tasks. An Add Task Actions Quick Start for lists and tables allows you to add components that perform a task.

If you want to display the contents of the message parameters that you specify, you can set up a data association for the message in Oracle Process Cloud Service and then use it in a description property in the getTask endpoint in Visual Builder.

Configure the Connection to a Process Server

When developing applications that use business processes, you have considerable flexibility in configuring the settings used to connect to Process Servers and the credentials that are used when communicating with the processes on a Process Server.

Visual Builder automatically sets up a default Process Server configuration when you create an application in Visual Builder. To see the configuration, click the Backends tab in the Navigator's Services tab. In the Backends tab, click Process Applications, then Servers. You'll see a Default Target Server, which in development mode, is configured to point to a test environment on the Oracle Process Cloud Service instance.



Note:

If you have an Oracle Traditional Cloud Account, you will see a message in the Processes browser if no instance of Oracle Process Cloud Service is associated with your instance. You will need an administrator to specify the URL of a Process Server in the Tenant Settings window before you can configure the connection between the visual application and the Process Server.

When a Process-related interaction occurs (say, you clicked Processes in the Navigator and tried to register a process, or used a Process Quick Start), the Tenant settings are overridden and you'll see another target server, the Player Target Server, as shown here:
Description of process-services-vbs.png follows
Description of the illustration process-services-vbs.png

The Player Target Server is useful when you want to "play" the process for testing, without making it live to your users.

The target server is set up in a default Application Profile. For basic information on Application Profiles, see What Are Application Profiles?

When you click the Application Profiles tab under Settings, you can see a base configuration that is set up to use the Player Target Server. This configuration is the default for the publishing, staging, and development phases of application development.
Description of process-app-prof.png follows
Description of the illustration process-app-prof.png

Once you finish developing your application, you'll want to duplicate the base configuration, rename it, and specify the use of the Default Target Server instead of the Player for the staging and/or publishing phases. To do this:

  1. Click the Duplicate button and specify a new Name and ID (for example, Publish).

  2. Click the Publish configuration and select Default Target Server from the drop-down list. By default, an application profile is always connected to the Player Target Server to avoid accidentally kicking off a live process.
  3. From the configuration's Options menu (Options menu icon), select Make stage default or Make publish default.

Process Server Authentication Options

For each Process Server configured, like the Player Target Server and the Default Target Server, you can specify an authentication mechanism.

For example, you may want to specify basic authentication for development and testing, and the user's Oracle Cloud Account for the published app.

To specify authentication:

  1. Click the Services tab under Settings (if you aren't already in Settings, select Settings from the top right menu).

  2. Click the Edit icon next to the target server you want to edit.

  3. In the Edit Server dialog box, select the authentication mechanism you want to use for that server from the Authentication drop-down list. The list has several choices, but for processes only Oracle Cloud Account and Basic are supported.



  4. Click Save.

At any stage of development, a developer can choose to enable Basic Authentication and provide the credentials of a user registered on the Process server. Selecting Basic Authentication enables the developer to log in to the Process server as a different user and access processes that they would not be able to otherwise. When selected, the developer can provide the credentials of different users to access the processes available to that user. These credentials and Basic Authentication are not used when the application is staged or published.

Selecting Test Connection in the options menu for the Processes navigator will by default use Oracle Cloud Account authentication details to test the connection. This means that to test the connection your user credentials must be valid to access the Process Server.

Note:

Developers using Traditional Oracle Cloud accounts can only use Basic Authentication for access to the Process Server. Access to all the processes is as a single user when designing the application and when accessing the staged and published applications. Access to processes is based on the user credentials that are supplied in the Process Configuration window, not the credentials of the developer or user. This means that the access to processes for the developer and a logged in user will be the same.

Add the Oracle Process Cloud Service URL

If you have a Traditional Oracle Cloud account, you can use business processes in your application after an administrator has specified the server URL of the Oracle Process Cloud Service that will be used with the instance.

After the server URL for the Oracle Process Cloud Service instance is added, developers can create aliases for business processes on the Process Server, and access the processes in their visual applications by adding code snippets in the Source editor. The developer will need a user account for Oracle Process Cloud Service to add aliases. Only users with the role of administrator can see the Settings item in the navigation pane on the Home page and open the Tenant Settings window.

After you make changes in the Tenant Settings window, you need to reload your browser window for the settings to take effect.

To set up a connection to your Oracle Process Cloud Service instance:

  1. Open the main navigation pane on the Home page and select Settings.

    When service administrators open the navigation pane on the Home page, they will see the Settings item for the service.


    Description of admin-settings-menu.png follows
    Description of the illustration admin-settings-menu.png
  2. On the Settings page, click the Services tab.
  3. Click the + sign (Create Backend) opposite Backends.
  4. In the Backend Service Type dialog box, select Process and click Close.
  5. In the Add Server dialog box, enter the Instance URL for your Oracle Process Cloud Service, and select Basic from the Authentication drop-down list.
  6. Click Save.