Creating Processes for Business Objects

You can use business processes in your application to automate assigning tasks to users and creating task lists. After you associate a custom business object with business processes in a Process application, you can add UI components to your pages that start processes and can be used to complete user tasks.

Note:

To create a business process, your Oracle Visual Builder instance must be associated with an Oracle Process Cloud Service instance. Visual Builder administrators can create the association between the services.

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.

When you create a process in Visual Builder, the process is associated with a custom business object, and a basic definition of tasks is created for you in yourProcess application. You edit the process definition and define the tasks using the design tools in Process Composer. After you create the process, you can use triggers and UI actions in pages in your application to initiate the process. You can use Process components in the Components palette to create task lists and to add UI components for performing user tasks.

Note:

All versions of an application are associated with the same Process application. When you edit a process definition in a project, your changes affect all the development versions of the application using that definition. You cannot develop more than one version of a process definition at a time, but there can be multiple versions of published definitions available in the production environment of your processes. When you deploy your application, your process definitions are deployed to the production environment as new versions. Older versions of process that are executing are not affected when you deploy a new version.

Creating a Business Process

Each custom business object has a Processes tab where you can create business processes for the object.

When you create a process for a business object, a tile for the process is added in the Processes tab and a new process definition and REST connector are created in the Process application that is associated with your Visual Builder application. You develop and save your process definitions in your project in the Composer until you are ready to publish them. Other users can see the processes after they are published. You can open the Process Composer from the tile’s Options menu. See What you can do using the Process Editor in Using Oracle Process Cloud Service.

Note:

The REST connector in your Process application is used to store the details for exchanging data between the project and your application. The Base URL for the REST connector is the tenant URL for the application and is the same as the base URL for the Catalog API and the REST APIs for the custom business objects. The Base URL in the REST connector is updated during the staging and publishing lifecycle to reflect the different URLs used for staged and live applications.

To create a new business process:

  1. Open the Business Objects page in the Data Designer.

    The list displays all the business objects in your application, but you can only create processes for custom business objects.

  2. Select the business object in the list and open the Processes tab.

    If you have not created any processes for the business object you are prompted to create one.


    Description of process-processes-tab1.png follows
    Description of the illustration process-processes-tab1.png

    If the business object already has some processes, the Processes tab contains a tile for each of the processes associated to that business object. Each tile has an Options menu where you can choose to edit the process in Composer or to delete the process.

  3. Click New Process to open the Create Process dialog box.
  4. Type a name and description for the process. Click Create.

    The process you create is associated with the business object.


    Description of process-processes-tab.png follows
    Description of the illustration process-processes-tab.png
  5. Click Save to create the process definition in your Process application.

    When you save the process a new process definition is created in your project in the Process workspace. The process definition contains the details about the business object, including the fields and the REST connector for connecting to the business object. You define the user tasks for the process in the Process Editor in Process Composer.

    Note:

    After creating the process definition, if you modify your business object, for example to add a new field, you must also add the new field to the description of the business type in your Process application. Process definitions are not updated when you make changes to your business object.
  6. Select Edit Process in the Options menu to open the Process Editor in Process Composer in a new window.

    You build your process definition using the design tools in the Process Editor in Composer. You need to save and publish your process in the Process Editor before you can use it in your application.


    Description of process-processes-tab-menu.png follows
    Description of the illustration process-processes-tab-menu.png
  7. When you want to use your process definitions, open the Processes tab in Visual Builder, click Deploy All to deploy all the process definitions in your application to your Process environment where the processes will run.

    To deploy processes you must be assigned a Process Administrator role. When you deploy your processes you will see a message if there are any errors in the definitions that you created in the Process Editor. All errors must be fixed before you can deploy and use your processes. You can deploy your processes as often as you need.

  8. After you deploy the process, click Manage User Roles to open yourProcess workspace and configure the user roles.

    When you define the tasks in the process you specify the roles that can perform each user task. For example, you can configure roles so that only a user with the role of Manager can see and perform an Approve task. The roles you assign to users apply to all the processes in your application. See Working with Process Roles and Swimlanes.

    Note:

    During development, when you deploy processes you are added to all the roles that are defined for the process. When you stage or publish your application, the Process application is also deployed to the production environment. Roles in the production environment are independent of the development environment so you will need to manage the user roles defined for production in the Process workspace. Deploying a Process application does not affect roles that are already assigned in the production environment. Only users with the role of Administrator can manage user accounts and assign roles. See About Oracle Process Cloud Service Roles and Users.

After you have deployed the process and configured the user roles you can start using the process in your application.

Note:

By default, during development your application allows the business processes in Process to access and retrieve data for the business objects in the application. When you want to stage and publish your application, you must explicitly enable access to the REST APIs for your business objects to allow business processes to access the data. See Exposing Your Business Objects.

Starting a Process Using Actions

You can edit the list of actions that are performed when a button is clicked to include a step that starts a process.

For components that support Actions, the behavior of the component in a page is defined in a recipe of actions using JavaScript. You can modify the component’s default behavior by editing the actions in the Configure Action dialog box. If your application uses business processes, the Configure Action dialog will contain a Process category with a Start a Process action. You can use the component to start processes by adding this action to your recipe and choosing a process. See About Configuring Button Actions.

To add a Start a Process action to a component:

  1. Open the page and select the component that will start the process.
  2. Select the Actions tab in the Property Inspector.
  3. Click Edit to open the Configure Action dialog box.
  4. Expand Process in the list of categories and drag Start a Process into the recipe.

    The data needs to be saved to the business object before the process can start.


    Description of process-action-startprocess.png follows
    Description of the illustration process-action-startprocess.png
  5. Select a process from the menu in the Start a Process step.

    The menu displays a list of deployed processes bound to the business object.


    Description of process-action-selectprocess.png follows
    Description of the illustration process-action-selectprocess.png
  6. Select Workflow is Started in the recipe and define the actions to perform when the process starts successfully.
  7. Select Workflow failed to start and define the actions to perform when the process fails to start.
  8. Click Done to save your changes.

    In the Property Inspector, Start a Process is added to the list of actions for the component.


    Description of process-action-buttonactions.png follows
    Description of the illustration process-action-buttonactions.png

Starting a Process Using a Trigger

You can use triggers if you want to start a process when an event occurs that relates to a business object. When designing a trigger you can add actions that start a process and specify conditions that need to be met before a process is started. For example, you can create a rule that is triggered by a business object event, such as inserting data, and specify the processes that are started based on some criteria related to that business object, such as the value of a field.

When you create a trigger you choose the type of start event and set some criteria for the trigger. For each criterion you can use the Configure Actions window to create a list of actions that are executed according to the type and conditions of the criterion. If the start event for the trigger is “Before Insert”, “Before Update” or “Before Delete”, the list of actions initiated by the trigger can include starting a process associated with the business object. See About Triggers for Business Objects.

To start a process using a trigger:

  1. Open the Business Rules tab of the business object associated with your process.
  2. Open the Triggers tab.
    The Triggers tab displays any triggers you have already created for the business object and a button for creating new triggers.
  3. Open the trigger that will start the process in the Trigger Designer.
    If you want to add the action to an existing trigger, click the trigger name or choose Edit in the Business Rules options menu of the trigger.
    Description of process-trigger-designer.png follows
    Description of the illustration process-trigger-designer.png

    If you want to create a new trigger, click New Trigger and specify the trigger name, the type of event that starts it, and click Create. If you create a new trigger you need to create at least one criterion before you can add any actions. A criterion can establish some conditions that need to be met before its actions are executed, or its actions can be executed unconditionally. Each criterion has an Action Group consisting of one or more actions that are executed when the criterion conditions are met.

  4. Open the Configure Actions window for the Action Group where you want to add the action for starting a process.
    To open the window, click Edit Actions if the Action Group already contains some actions. Click Add Actions if no actions have been defined.
  5. Drag the Start a Process action into the list of actions that will be executed.
    The Start a Process action is visible under the Suggested category and the Process category.
    Description of process-trigger-configureactions.png follows
    Description of the illustration process-trigger-configureactions.png

    If the Action Group already contains some actions, you can drag the action item into the most suitable position in the list. Actions in the list are executed sequentially.

  6. In the Start a Process action, select the business process in the dropdown list.
    After you add the Start a Process action to the list you need to select a process from the dropdown list. The dropdown list displays all the processes that are associated with the business object.
    Description of process-trigger-configureactions-select.png follows
    Description of the illustration process-trigger-configureactions-select.png
  7. Click Done when you are finished adding actions to the list.
  8. Click Apply to save your changes and exit the Trigger Designer.
    The trigger script is run each time the trigger’s start event occurs.

Creating a Task List

After you have created a process you can use Process components to create a task list in your application.

You can build a page that contains tasks that a user needs to perform because a process was started. For example, a user submitting a travel request might start a process that includes getting approval from a manager. Managers see a new task in their task lists each time a user submits a new travel request. The task can be completed in the task list, or you can add a Task Actions Control component to the page that shows details about the request. The tasks displayed in a list is determined by the user’s role.

The Task List component is used to create a list of tasks a user must complete when a process starts. The task list can contain tasks from multiple processes.

To create a task list for a process
  1. Open the page where you want to add the task list.

    The page can be one that is not bound to a business object or one that is already bound to a business object associated with one or more processes.


    Description of process-task-page.png follows
    Description of the illustration process-task-page.png
  2. Locate the Process category in the Components palette and drag the Task List component onto the canvas.

    The Process category contains UI components that you bind to processes in your application. You only see the Process category in the palette if your instance was provisioned with Process when it was created.


    Description of process-task-listcomponent.png follows
    Description of the illustration process-task-listcomponent.png

    After you add the Task List component to your page you need to select the source of the tasks in the list by binding the list to one or more processes.

  3. Select one or more of your processes in the Task List Creation wizard. Click Next.

    If the page is already bound to a business object, the Task List Creation wizard displays the processes associated with that business object. If the page is not bound to a business object the wizard displays processes that you have created in your application and you can select processes associated with one or more business objects. The processes that you select determine the type of tasks that appear in the list.


    Description of process-task-sources.png follows
    Description of the illustration process-task-sources.png
  4. Specify any display fields that you want to appear in the task list.

    Description of process-task-fields.png follows
    Description of the illustration process-task-fields.png

    Only user actions such as Approve or Reject are included in the Actions menu by default. The Details page also includes optional items that you can include in the Actions menu.

  5. Select the page that displays the details for the each type of task. Click Finish to close the wizard and create the task list.

    The details page is linked from the Details item in the Actions menu for each task in the list. By default, a details page was generated for the business object if you created it by dragging a collection component onto the canvas. If no details page exists you can create one using the Create Page dialog box.

    When you finish the wizard, the task list will be empty if no processes have been started. Tasks will appear in the list if you selected a process that already has some running instances.


    Description of process-task-pagelist.png follows
    Description of the illustration process-task-pagelist.png

A task’s Actions menu contains a link to the task’s details page and the actions that the user can take.


Description of process-task-pageaction.png follows
Description of the illustration process-task-pageaction.png

Selecting an action in the menu automatically submits the change. Selecting Details in the menu opens the details page for the business object. You can add a Task Action Control component to a details page to add a menu and button for completing a task.

Adding a User Task to a Page

You can modify form pages to add a component for completing user tasks in a process.

All of your form pages are associated with business objects. When a process is associated with that business object you can add a process component that will allow users to complete user tasks in the page. For example, the details page for a travel request business object will usually have some read-only fields for displaying data and a Done button that navigates to another page. If a process is associated with the business object you can add a UI component for completing user tasks defined as part of that process, such as approving or rejecting a request. Dragging a Task Actions Control component from the Components palette onto the page will add a component that can be used to complete a user task when required by a running process.

To add a task action to a page:

  1. Open the page that you want to modify.
  2. Drag the Task Actions Control component from the Components palette and drop it on the form.

    Description of process-task-actioncomponent.png follows
    Description of the illustration process-task-actioncomponent.png

    The Task Actions Control Creation wizard opens when you add the component to the page.

  3. Select a source process in the wizard. Click Next.
  4. Specify the properties for the component. Click Finish.

    In addition to the standard display properties, you can choose options for the actions. You can also modify these properties later in the Properties Inspector.


    Description of process-task-actionwizard.png follows
    Description of the illustration process-task-actionwizard.png
The Task Action Control component contains a menu and a button. To perform a task you select an action from the menu and click the button.

Assigning Process Roles to Users

When you want to stage or publish your application you need to assign roles to real users in Process.

When you are developing your application and business processes, application developers are assigned to all user roles by default. When a process is run in a development environment, user roles are configured in test mode in the Manage Roles page in your Process application. When you stage or publish an application you will probably want to run your business processes in a live environment and assign the roles defined in the process to real users to ensure that user tasks are performed by the appropriate user.

To assign process roles to real users:

  1. In the Processes tab, click Manage Process Roles to open the Manage Roles page in Process.

    You can open the Manage Roles page from the Processes tab of any business object in your application. The Manage Roles page lists all the roles defined for the application.

  2. Switch Testing Mode to Off.

    By default, when you click Manage Process Roles you are directed to the page for managing roles in the testing environment. The user roles in the test environment are mapped to application developers. When you click Off you see a list of the user roles in the production environment.


    Description of process-publish-manageroles.png follows
    Description of the illustration process-publish-manageroles.png
  3. Map the application’s end users to their process user roles. Click Save and close the Process window.
    You can assign roles to individual end users, groups and roles. See Assigning and Managing Roles.

Enabling Authentication for Your Processes

To use your business processes in a staged or published application you need to enable access to the business objects.

When your application is in the development stage of the lifecycle, the business processes in your application are run in the test environment of your Process workspace. By default, business processes running in the test environment can communicate with the business objects in your application and development users are assigned to all the roles in the project.

When you stage or publish your application, the business processes are copied to the Process live production environment. To use processes in a staged or published application you need to enable basic authentication to allow processes to access the business objects. You must also explicitly enable access to the REST APIs for your business objects using basic authentication to allow business processes to access the data. See Exposing Your Business Objects.

To enable authentication for a staged or published application:

  1. Open the Processes tab for one of your business objects.
  2. Open the Options menu for one of your processes and choose Process Editor to open your Process application in a new window.
  3. Open the Application Home of your Process application and click Integrations in the menu.
  4. Click the project’s REST connector to open the Rest Connector Editor.

    The REST connector is a wadl file that describes the connection between your Process application and your application and was created automatically when you created the process in your application.


    Description of process-integrations-page.png follows
    Description of the illustration process-integrations-page.png
  5. Click Edit in the Rest Connector Editor.
  6. In the Security section, select APP Id — Basic Authentication as the Security Type.

    By default, the Security Type was set to None when the connector was created. You will see details about the credentials when you select Basic Authentication in the menu.

  7. Select the credential for the connection in the Keystore Credential list menu. Click Apply.

    If the credential is incorrect or missing you will need to create a new one by selecting New Key and supplying the credential details.


    Description of process-rest-connector-editor.png follows
    Description of the illustration process-rest-connector-editor.png

    Note:

    To update data in a business object, the PUT operation in your REST connector needs to contain Origin in the header. You can modify the parameters of a REST connector in the Rest Connector Editor in yourProcess application. You might need to create a new REST connector and add a PUT operation and the required parameter if you can’t edit your existing REST connector.
  8. Save and publish your project.

Connecting to Process Cloud Service

To use business processes in your application, an administrator needs to create an association between the Visual Builder instance and a Process Cloud Service instance in the same identity domain. Administrators use the Administration Options window to create associations between services.

After the connection between the service is created, developers can create business process in the Data Designer and integrate processes in pages in the application. A developer will also need a user account for Process Cloud Service to create and edit processes in projects.

Note:

Only users with the role of administrator can see the Administration Options menu on the Home page and open the Administration options window. See Understanding Administrator Roles in Administrator's Guide for Oracle Visual Builder.

To connect to a Process Cloud Service instance:

  1. Open the Administration Options menu on the Home page and select Administer Visual Builder.

    The Administration Options menu is visible to administrators of a Visual Builder instance.

    Description of admin-options-menu.png follows
    Description of the illustration admin-options-menu.png
  2. Open the Associated Service Instances tab in the Administration options window.

    You use the Associated Service Instances tab to manage associations with other services in the same identity domain. The tab contains a field for adding the Base URL of a Process Cloud Service instance.


    Description of admin-options-services.png follows
    Description of the illustration admin-options-services.png
  3. Enter the Base URL for your Process Cloud Service instance.
  4. Open the Allowed Origins tab.

    You use the Allowed Origins tab to add the URLs for services that you want to allow to read information from your domain. The list of permitted origins is applied to all applications in your domain.


    Description of admin-options-cors-pcs.png follows
    Description of the illustration admin-options-cors-pcs.png
  5. Click New Origin and enter the URL of your Process Cloud Service instance. Click Save and close the dialog box.