-
Language:
English
-
Language:
English
Red Hat Training
A Red Hat training course is available for Red Hat Process Automation Manager
Chapter 7. Ad hoc and dynamic tasks
You can use case management to carry out tasks in an ad hoc way, rather than following a strict end-to-end process. Tasks can also be added to a case dynamically during run time when required.
Ad hoc tasks are defined in the case modeling phase. Ad hoc tasks that are not configured as Adhoc autostart are optional and may or may not be worked on during a case. Therefore, they must be triggered by a signal event or by Java API to be available to be worked on during a case.
Dynamic tasks are defined during the case execution and are not present in the case definition model. Dynamic tasks address specific needs that arise during the case. They can be added to the case and worked on at any time using a case application, as demonstrated in the Red Hat Process Automation Manager Showcase application. Dynamic tasks can also be added by Java and Remote API calls.
Dynamic tasks can be user or service activities, while ad hoc tasks can be any type of task.
Dynamic processes are any reusable sub-process from a case project.
Ad hoc nodes with no incoming connections can be configured with the Adhoc autostart property, which is a property of the node itself. These tasks are triggered automatically when the case instance is started.
7.1. Adding ad hoc tasks
Ad hoc tasks are optional tasks that are configured in a case definition. Because they are ad hoc, they must be triggered in some way, usually by a signal event or Java API call.
Prerequisite
- A case project has been created in Business Central.
- A case definition has been created.
Procedure
-
In the process designer, click
to open the Object Library on the left of the design palette.
From the list, select a task that you want to add to the case definition as an ad hoc task.
For example, you might want to add a user task to fill out a warranty claim if goods that are received are faulty. A warranty claim may or may not need to be completed during the course of the case, but it is available to be performed in an ad hoc way if required.
- Configure the ad hoc task properties in the Properties panel on the right.
-
Trigger the task during run time using a Java API call. For example, the
Order rejectedad hoc task is triggered by the following API call:CaseService.triggerAdHocFragment
7.2. Starting dynamic tasks and processes
You can add dynamic tasks and processes to a case during run time. Dynamic actions are a way to address changing situations, where an unanticipated change during the case requires a new task or process to be incorporated into the case.
Use a case application to add a dynamic task during run time. For demonstration purposes, the Business Central distribution includes a Showcase application where you can start a new dynamic task or process for the IT Orders application. For more information about installing and running the Showcase application, see Chapter 11, Case management Showcase application.
Prerequisites
- The Process Server is deployed and connected to Business Central.
- The IT Orders project is deployed to Process Server.
-
The Showcase application
.warfile has been deployed alongside Business Central.
Procedure
With the IT Orders project deployed and running in the Process Server, in a web browser, navigate to the Showcase login page
http://localhost:8080/rhpam-case-mgmt-showcase/.Alternatively, if you have configured Business Central to display the Apps launcher button, use it to open a new browser window with the Showcase login page.

For instructions on how to configure the Apps launcher button in Business Central see Section 11.1, “Installing and logging in to the Showcase application”.
- Log in to the Showcase application using your Business Central login credentials.
- Select an active case instance from the list to open it.
Under Overview → Actions → Available, click the
button next to New user task or New process task to add a new task or process task.
Figure 7.1. Showcase dynamic actions

To create a dynamic user task, start a New user task and complete the required information:

To create a dynamic process task, start a New process task and complete the required information:

To view a dynamic user task in Business Central, click Menu → Track → Task Inbox. The user task that was added dynamically using the Showcase application appears in the Task Inbox of users assigned to the task during task creation.

- Click the dynamic task in the Task Inbox to open the task. A number of action tabs are available from this page.
- Using the actions available under the task tabs, you can begin working on the task.
- In the Showcase application, click the refresh button in the upper-right corner. Case tasks and processes that are in progress appear under Overview → Actions → In progress.
- When you have completed working on the task, click the Complete button under the Work tab.
- In the Showcase application, click the refresh button in the upper-right corner. The completed task appears under Overview → Actions → Completed.
To view a dynamic process task in Business Central, click Menu → Manage → Process Instances.

- Click the dynamic process instance in the list of available process instances to view information about the process instance.
- In the Showcase application, click the refresh button in the upper-right corner. Case tasks and processes that are in progress appear under Overview → Actions → In progress.