20 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:

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.

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.

To add a business process to an application:

  1. Open Processes in the Navigator. As soon as you open Processes for the first time, VB Studio 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 deploy 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 deployed, 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 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 VB Studio

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

  • 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 VB Studio, 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.

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.

If the Visual Builder instance that you use in your environment is provided by Oracle Integration, VB Studio includes a default Process Server configuration when you create a visual application in VB Studio. 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 the Default Target Server, which points to the Process server from the Tenant settings of your environment's Visual Builder instance.

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 Visual Builder's 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. Application profiles help you define different combinations of servers and security settings for each of your environments, and use them when deploying the application to an environment. For more information, 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 development phase of application development.
Description of process-app-prof-vbs.png follows
Description of the illustration process-app-prof-vbs.png

Once you finish developing your application, you'll want to duplicate the base configuration, rename it, and use the Default Target Server instead of the Player for the final phases of application development. 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 development default.

    With this configuration, the application profile specifying the Default Target Server is used when you deploy the application to your environment.