Getting started with case management

Red Hat Process Automation Manager 7.5

Red Hat Customer Content Services

Abstract

This document describes how to create and test an example IT orders case project in Red Hat Process Automation Manager 7.5. The procedures in this document are based on the IT_Orders sample case project included in Business Central.

Preface

As a business rules and processes developer, you can use case management assets in Business Central to create unpredictable and ad hoc case processes. Case workers or process administrators can also use Business Central for case management and execution. Red Hat Process Automation Manager provides example projects with example business assets directly in Business Central as a reference. This document describes how to create and test an example IT orders project based on the IT_Orders sample project included in Business Central.

Prerequisites

Chapter 1. Case management

Case management is an extension of Business Process Management (BPM) that enables you to manage adaptable business processes.

BPM is a management practice used to automate tasks that are repeatable and have a common pattern, with a focus on optimization by perfecting a process. Business processes are usually modeled with clearly defined paths leading to a business goal. This requires a lot of predictability, usually based on mass-production principles. However, many real-world applications cannot be described completely from start to finish (including all possible paths, deviations, and exceptions). Using a process-oriented approach in certain cases can lead to complex solutions that are hard to maintain.

Case management provides problem resolution for non-repeatable, unpredictable processes as opposed to the efficiency-oriented approach of BPM for routine, predictable tasks. It manages one-off situations when the process cannot be predicted in advance. Case definition usually consists of loosely coupled process fragments that can be connected directly or indirectly to lead to certain milestones and ultimately a business goal, while the process is managed dynamically in response to changes that occur during run time.

In Red Hat Process Automation Manager, case management includes the following core process engine features:

  • Case file instance
  • A per case runtime strategy
  • Case comments
  • Milestones
  • Stages
  • Ad hoc fragments
  • Dynamic tasks and processes
  • Case identifier (correlation key)
  • Case lifecycle (close, reopen, cancel, destroy)

A case definition is always an ad hoc process definition and does not require an explicit start node. The case definition is the main entry point for the business use case.

A process definition can still be introduced as a supporting construct of the case and can be invoked either as defined in the case definition or dynamically to bring in additional processing when required. A case definition defines the following new objects:

  • Activities (required)
  • Case file (required)
  • Milestones
  • Roles
  • Stages

1.1. Case files

A case instance is a single instance of a case definition and encapsulates the business context. All case instance data is stored in the case file, which is accessible to all process instances that might participate in the particular case instance. Each case instance and its case file are completely isolated from the other cases. Only case instance participants can access the case file.

A case file is used in case management as a repository of data for the entire case instance. It contains all roles, the object, the data map, and any other data. The case can be closed and reopened at a later date with the same case file attached. A case instance can be closed at any time and does not require a specific resolution to be completed.

The case file can also include embedded documentation, references, PDF attachments, web links, and other options.

The Case ID prefix is an optional configurable prefix that enables you to easily distinguish different types of cases. The prefix is followed by a generated ID in the format ID-XXXXXXXXXX, where XXXXXXXXXX is a generated number that provides a unique ID for the case instance. If a prefix is not provided, the default prefix is CASE with the following identifiers:

CASE-0000000001

CASE-0000000002

CASE-0000000003

You can specify any prefix. For example, if you specify the prefix IT, the following identifiers are generated:

IT-0000000001

IT-0000000002

IT-0000000003

1.2. Comments

In case management, comments facilitate collaboration within the case instance, and allow case workers to easily communicate with each other to exchange information.

Comments are bound to the case instance. Case instances are part of the case file, so you can use comments to take action on the instances. Basic text-based comments can have a complete operations set, similar to CRUD (create, read, update, and delete).

1.3. Case roles

Case roles provide an additional layer of abstraction for user participation in case handling. Roles, users, and groups are used for different purposes in case management.

Roles
Roles drive the authorization for a case instance, and are used for user activity assignments. A user or one or more groups can be assigned to the owner role. The owner is whoever the case belongs to. Roles are not restricted to a single set of people or groups as part of a case definition. Use roles to specify task assignments instead of assigning a specific user or group to a task assignment to ensure that the case remains dynamic.
Groups
A group is a collection of users who are able to carry out a particular task or have a set of specified responsibilities. You can assign any number of people to a group and assign any group to a role. You can add or change members of a group at any time, so you should never hard code a group to a particular task.
Users
A user is an individual who can be given a particular task when you assign them a role or add them to a group.

The following example illustrates how the preceding case management concepts apply to a hotel reservation with:

  • Role = Guest
  • Group = Receptionist, Maid
  • User = Marilyn

The Guest role assignment affects the specific work of the associated case and is unique to all case instances. The number of users or groups that can be assigned to a role is limited by the Case Cardinality, which is set during role creation in the process designer and case definition. For example, the hotel reservation case has only one guest while the IT_Orders sample project has two suppliers of IT hardware.

When roles are defined, case management must ensure that roles are not hard coded to a single set of people or groups as part of case definition and that they can differ for each case instance. This is why case role assignments are important.

Role assignments can be assigned or removed when a case starts or at any time when a case is active. Although roles are optional, use roles in case definitions to maintain an organized workflow.

Important

Always use roles for task assignments instead of actual user or group names. This ensures that the case remains dynamic and actual user or group assignments can be made as late as required.

Roles are assigned to users or groups and authorized to perform tasks when a case instance is started.

Chapter 2. Reviewing the IT_Orders sample project

Before you create your own case management project, review the existing IT_Orders sample case management project in Business Central. This sample project contains predefined case management assets as a reference for your own case projects.

Important

The business process application example includes features that are Technology Preview only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs), might not be functionally complete, and are not recommended for production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process. For more information about Red Hat Technology Preview support, see Technology Preview Features Support Scope.

Procedure

Go to the IT_Orders sample project to view the predefined assets.

  1. In Business Central, go to MenuDesignProjects.
  2. Click dots in the upper-right corner of the screen and select Try Samples.
  3. Select IT_Orders and click Ok.

The Assets view of the project opens. Select each example asset to explore how the project is designed to achieve the specified goal or workflow.

Review the orderhardware Business Processes (legacy) asset, which will help you understand the business process flow.

orderhardware Business Processes (legacy) asset
Note

The legacy process designer in Business Central is deprecated in Red Hat Process Automation Manager 7.5.1. It will be removed in a future Red Hat Process Automation Manager release. The legacy process designer will not receive any new enhancements or features. Existing users of the legacy process designer are advised to migrate projects to the new designer. For information about migrating projects to the new designer, see Managing projects in Business Central.

Chapter 3. Creating a new IT_Orders case project

Create a new IT_Orders project in Business Central to gain an understanding of all of the required assets and how they are used in the project.

Procedure

  1. Log in to Business Central and go to MenuDesignProjects.

    Business Central provides a default space called MySpace, as shown in the following image. You can use the default space to create and test example projects.

    Figure 3.1. Default spaces

    spaces teams bc
  2. Click Add ProjectCase project.

    Figure 3.2. Case project menu

    select case proj
  3. Enter IT_Orders_New in the Name field.
  4. Click Add.

    Figure 3.3. Add Project window

    addproject case

The Assets view of the project opens.

Chapter 4. Data objects

Data objects are the building blocks for the rule assets that you create. Data objects are custom data types implemented as Java objects in specified packages of your project. For example, you might create a Person object with data fields Name, Address, and DateOfBirth to specify personal details for loan application rules. These custom data types determine what data your assets and your decision services are based on.

4.1. Creating the ITOrderService data object

The ITOrderService data object specifies the data type that will be used to define the IT Orders variables.

Prerequisites

  • The IT_Orders_New project is created.

Procedure

  1. Click Add AssetData Object.
  2. In the Create new Data Object wizard, enter the following values:

    • Data Object: ITOrderService
    • Package: com.myspace.it_orders_new
  3. Click Ok.
  4. Click plus sign next to the Package pull-down menu to specify a new package for the data object.
  5. Input org.jbpm.demo.it_orders.services and click Add.
  6. Click SaveYes, Move, and then click Save to confirm your changes.

4.2. Creating the Survey data object

The Survey data object contains data fields, such as deliveredOnTime and missingEquipment. You will use the data and values when you design your case.

Prerequisites

  • The IT_Orders_New project is created.

Procedure

  1. In Business Central, go to MenuDesignProjects and click IT_Orders_New.
  2. Click Add AssetData Object.
  3. In the Create new Data Object wizard, enter the following values:

    • Data Object: Survey
    • Package: com.myspace.it_orders_new
  4. Click Ok.
  5. Add the Survey data object constraints.

    1. Click add field.
    2. Enter the following values:

      • Identifier: comment
      • Label: Leave empty
      • Type: String
    3. Click Create and continue, and then enter the following values:

      • Identifier: deliveredOnTime
      • Label: Leave empty
      • Type: Boolean
    4. Click Create and continue, and then enter the following values:

      • Identifier: missingEquipment
      • Label: Leave empty
      • Type: String
    5. Click Create and continue, and then enter the following values:

      • Identifier: satisfied
      • Label: Leave empty
      • Type: Boolean
    6. Click Create.
  6. Click Save, and then click Save to confirm your changes.

    Figure 4.1. Survey data object details

    survey do

Chapter 5. Designing the case definition

You design cases using the process designer in Business Central. Case design is the basis of case management and sets the specific goals and tasks for each case. The case flow can be modified dynamically during run time by adding dynamic tasks or processes. In this procedure, you will create this same case definition to familiarize yourself with the case definition design process.

The IT_Orders sample project in Business Central includes the following orderhardware business process case definition.

Figure 5.1. orderhardware business process case definition

IT Orders case design

Prerequisites

Procedure

  1. In Business Central, go to MenuDesignProjects and click IT_Orders_New.
  2. Click Add AssetCase Definition (legacy).
  3. In the Create new Case definition window, add the following required information:

    • Case definition (legacy): Input orderhardware. This is usually the subject of the case or project that is being case managed.
    • Package: Select com.myspace.it_orders_new to specify the location that the case file is created in.
  4. Click Ok to open the process designer.
  5. Define process-level and case-level variables.

    1. Click BUSINESS PROCESSES (LEGACY)orderhardware.
    2. Click left arrows on the right side of the designer to open the Properties (BPMN-Diagram) panel.
    3. Click the down arrow in the Variable Definitions field to open the Editor for Variable Definitions.
    4. Click Add Variable, and input the following values and click Ok:

      Figure 5.2. IT Orders variables

      Editor for IT Orders variables
  6. Define the roles involved in the case.

    1. Click the down arrow in the Case Roles field to open the Editor for Case Roles.
    2. Click Add Case Role, and input the following values and click Ok:

      Figure 5.3. ITOrders Case Roles

      Case Roles
      • owner: The employee who is making the hardware order request. The role cardinality is set to 1, which means that only one person or group can be assigned to this role.
      • manager: The employee’s manager; the person who will approve or deny the requested hardware. The role cardinality is set to 1, which means that only one person or group can be assigned to this role.
      • supplier: The available suppliers of IT hardware in the system. The role cardinality is set to 2, which means that more than one supplier can be assigned to this role.
  7. Click Save.

5.1. Creating the Place order subprocess

Create the Place order subprocess, which is a separate business process that is carried out by the supplier. This is a reusable process that occurs during the course of case execution as described in Chapter 5, Designing the case definition.

Prerequisites

Procedure

  1. In Business Central, go to MenuDesignProjectsIT_Orders_New.
  2. From the project menu, click Add AssetBusiness Process.
  3. In the Create new Business Process wizard, enter the following values:

    • Business Process: place-order
    • Package: Select com.myspace.it_orders_new
  4. Click Ok. The diagram editor opens.
  5. Click an empty space in the canvas, and in the upper-right corner, click the Diagram properties diagram properties icon.
  6. Scroll down and expand Process Data and click btn plus in the Process Variables section and enter the following values:

    proc vars
  7. Click the start event and create an outgoing connection from the start event to a task and convert the new task to a user task.

    new task
    user task
  8. Click the user task and in the Diagram properties panel, input Place order in the Name field.
  9. Expand Implementation/Execution, click Add below the Groups menu, click SelectNew, and input supplier.
  10. Click diagram properties in the Assignments field and add the following new conditions in the Place order Data I/O window. For the first input assignment, select Custom for the Data Type and input org.jbpm.document.Document.

    place order IO
  11. Click Save.
  12. Select the Skippable check box and enter the following in the Description field:

    Approved order #{CaseId} to be placed

    skip description
  13. Create an outgoing connection from the Place order user task and connect it to an end event.

    create end event
    sub proc
  14. In the diagram editor, click Save and click Save again to confirm your changes.

5.2. Creating the Manager approval business process

The manager approval process determines whether or not the order will be placed or rejected.

Figure 5.4. Business Process (legacy) editor

Editor navigation

1: The canvas where you build your process diagram. Drag elements from the Object Library to the canvas to design your process.

2: The Object Library.

3: The Properties panel displays the properties of the selected element. If no element is selected, the panel contains process properties.

Procedure

  1. In Business Central, go to MenuDesignProjectsIT_Orders_Neworderhardware Business Process (legacy).
  2. In the process designer, expand Tasks in the Object Library drag a new User task on to the canvas.
  3. Click the new user, click left arrows to open the Properties panel, and input the following values:

    • Groups - supplier
    • Name - Prepare hardware spec
    • Task Name - PrepareHardwareSpec
    • Description - Prepare hardware specification for #{initiator} (order number #{CaseId})
  4. Click the down arrow in the Assignments field, add the following new conditions in the Prepare hardware spec Data I/O window. For the first output assignment, select Custom for the Data Type and input org.jbpm.document.Document. Click Save.

    Prepare hardware I/O values
  5. Click the Prepare hardware spec user task and create an new user task.

    Creating a new user task
  6. Click the new user task, click left arrows to open the Properties panel, and input the following values:

    • Actors - manager
    • Name - Manager approval
    • Task Name - ManagerApproval
    • Description - Approval request for new hardware for #{initiator} (order number #{CaseId})
  7. Click the down arrow in the Assignments field, add the following new conditions in the ManagerApproval Data I/O window. For the first output assignment, select Custom for the Data Type and input org.jbpm.document.Document. Click Save.

    Manager approval I/O values
  8. Click the Manager approval user task and create a Data-based Exclusive (XOR) gateway.

    Creating a Data-based Exclusive (XOR) gateway
  9. Click right arrow to open the Object Library, expand Subprocesses, click Reusable, and drag the new element to the canvas on the right side of the Data-based Exclusive (XOR) gateway.
  10. Connect the Data-based Exclusive (XOR) gateway to the subprocess.

    Creating a Data-based Exclusive (XOR) gateway to subprocess
  11. Click the subprocess, click left arrows to open the Properties panel, and input or select the following values:

    • ActivityType - Sub-Process
    • Name - Place order
    • Called Element - Select place-order.bpmn from the Asset Name column, and click Save.
    • Independent - false
  12. Click the down arrow in the Assignments field, add the following new conditions in the Place order Data I/O window, and click Save.

    Place order I/O values
  13. Click the connection from the Data-based Exclusive (XOR) gateway to the subprocess and click left arrows to open the Properties panel.

    Exclusive gateway to subprocess
  14. Click the down arrow in the Expression field and add the following Sequence Flow Conditions and click Ok.

    Sequence flow conditions
  15. Click the Place order user task and create an end event.

    Create an end event
  16. Click the Data-based Exclusive (XOR) gateway and create a new user task and drag the new task to align it below the Place order task.

    Align new task
  17. Click the new user task, click left arrows to open the Properties panel, and input the following values:

    • Actors - owner
    • Name - Order rejected
    • Task Name - OrderRejected
    • Description - Order #{CaseId} has been rejected by manager
  18. Click the down arrow in the Assignments field, add the following new conditions in the Order rejected Data I/O window, and click Save.

    Order rejected I/O values
  19. Click the connection from the Data-based Exclusive (XOR) gateway to the Order rejected task and click left arrows , click the down arrow in the Expression field, and add the following Sequence Flow Conditions and click Ok.

    Sequence flow conditions
  20. Click the Place order user task, create an end event, click Save, and then Save to confirm your changes.

    Prepare hardware spec flow

Chapter 6. Milestones

Milestones are a special service task that can be configured in the case definition designer by adding the milestone node to the process designer palette. When creating a new case definition, a milestone configured as Adhoc autostart is included on the design palette by default. Newly created milestones are not set to Adhoc autostart by default.

Case management milestones generally occur at the end of a stage, but they can also be the result of achieving other milestones. A milestone always requires a condition to be defined in order to track progress. Milestones react to case file data when data is added to a case. A milestone represents a single point of achievement within the case instance. It can be used to flag certain events, which can be useful for Key Performance Indicator (KPI) tracking or identifying the tasks that are still to be completed.

Milestones can be in any of the following states during case execution:

  • Active - The condition has been defined on the milestone but it has not been met.
  • Completed - The milestone condition has been met, the milestone has been achieved, and the case can proceed to the next task.
  • Terminated - The milestone is no longer a part of the case process and is no longer required.

While a milestone is available or completed it can be triggered manually by a signal or automatically if `Adhoc autostart`is configured when a case instance starts. Milestones can be triggered as many times as required, however, it is directly achieved when the condition is met.

6.1. Creating the Hardware spec ready milestone

Create a Hardware spec ready milestone that is reached when the required hardware specification document is completed.

Procedure

  1. In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas and place it on the right side of the Place order end event.
  2. Click the new milestone and in the upper-right corner, click left arrows to open the Properties panel.
  3. Input Hardware spec ready in the Name field.
  4. Select true from the Adhoc autostart menu.
  5. Click the down arrow in the Assignments field and add the following new conditions in the Hardware spec ready Data I/O window.

    Add CaseData(data.get("hwSpec") != null) by selecting Constant from the Source menu.

    Hardware spec ready I/O values
  6. Click Save.

6.2. Creating the Manager decision milestone

This milestone is reached when the managerDecision variable has been given a response.

Procedure

  1. In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Notify requestor script task.
  2. Click the new milestone and in the upper-right corner, click left arrows to open the Properties panel.
  3. Input Manager decision in the Name field.
  4. Select true from the Adhoc autostart menu.
  5. Click the down arrow in the Assignments field and add the following new conditions in the Manager decision Data I/O window.

    Add CaseData(data.get("managerDecision") != null) by selecting Constant from the Source menu.

    Manager decision I/O values
  6. Click Save.

6.3. Creating the Order placed milestone

This milestone is reached when the ordered variable, which is part of the Place order sub-process, has been given a response.

Procedure

  1. In the process designer, click the default Milestone object.
  2. In the upper-right corner, click left arrows to open the Properties panel.
  3. Input Milestone 1: Order placed in the Name field.
  4. Select true from the Adhoc autostart menu.
  5. Click the down arrow in the Assignments field to add a new condition in the Milestone 1: Order placed Data I/O window.
  6. Click the Source column drop-down, select Constant, and input org.kie.api.runtime.process.CaseData(data.get("ordered") == true). This means that a case variable named ordered exists with the value true.

    Milestone evaluation condition configuration
  7. Click Save.
  8. Click Milestone 1: Order placed and create a new script task.

    new task creation
    convert to a script task
  9. Click the new script task and in the upper-right corner, click left arrows to open the Properties panel.
  10. Input Notify requestor in the Name field.
  11. Click the down arrow in the Script field, input System.out.println("Notification::Order placed");, and click Ok.
  12. Click the Notify requestor scipt task and create a signal end event.

    new end event
    convert to a signal event
  13. Click the signal event and click left arrows to open the Properties panel.
  14. Click the down arrow in the Signal Scope field, select Process Instance.
  15. Click the down arrow in the SignalRef field, input Milestone 2: Order shipped, and click Ok.

6.4. Creating the Order shipped milestone

The condition for this milestone is that a case file variable named shipped is true. Adhoc autostart is not enabled for this milestone. Instead, it is triggered by a signal event when the order is ready to be sent.

Procedure

  1. In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Notify requestor script task.
  2. Click the new milestone and in the upper-right corner, click left arrows to open the Properties panel.
  3. Input Milestone 2: Order shipped in the Name field.
  4. Select false from the Adhoc autostart menu.
  5. Click the down arrow in the Assignments field to add a new condition in the Data Inputs and Assignments window.
  6. Click the Source column drop-down, select Constant, and input org.kie.api.runtime.process.CaseData(data.get("shipped") == true). This means that a case variable named shipped exists with the value true.
  7. Click Save.
  8. Click Milestone 2: Order shipped and create a new script task.
  9. Click the new script task and in the upper-right corner, click left arrows to open the Properties panel.
  10. Input Send to tracking system in the Name field.
  11. Click the down arrow in the Script field, input System.out.println("Order added to tracking system");, and click Ok.
  12. Click the Send to tracking system scipt task and create a signal end event.
  13. Click the signal event and click left arrows to open the Properties panel.
  14. Click the down arrow in the Signal Scope field, select Process Instance.
  15. Click the down arrow in the SignalRef field, input Milestone 3: Delivered to customer, and click Ok.

6.5. Creating the Delivered to customer milestone

The condition for this milestone is that a case file variable named delivered is true. Adhoc autostart is not enabled for this milestone. Instead, it is triggered by a signal event after the order has successfully shipped to the customer.

Procedure

  1. In the process designer, expand Milestone in the Object Library and drag a new milestone on the canvas below the Send to tracking system script task.
  2. Click the new milestone and in the upper-right corner, click left arrows to open the Properties panel.
  3. Input Milestone 3: Delivered to customer in the Name field.
  4. Select false from the Adhoc autostart menu.
  5. Click the down arrow in the Assignments field to add a new condition in the Milestone 3: Delivered to customer window.
  6. Click the Source column drop-down, select Constant, and input org.kie.api.runtime.process.CaseData(data.get("delivered") == true). This means that a case variable named delivered exists with the value true.
  7. Click Save.
  8. Click Milestone 3: Delivered to customer and create a new user task.
  9. Click the new user task and in the upper-right corner, click left arrows to open the Properties panel.
  10. Input owner in the Actors field.
  11. Input Customer satisfaction survey in the Name field.
  12. Input CustomerSurvey in the Task Name field.
  13. Click the down arrow in the Assignments field to add data input and output assignments in the Milestone 3: Delivered to customer Data I/O window as shown below. For the output Data Type column, select Constant, and input Survey [com.myspace.it_orders_new]. Click Save.

    survey I/O values
  14. Click the Customer satisfaction survey user task and create an end event.
  15. Click Save, and then Save to confirm your changes.

The IT Orders case can be closed after all milestone sequences are completed. However, due to the ad hoc nature of cases, the case could be reopened if, for example, the order was never received by the customer or the item is faulty. Tasks can be re-triggered or added to the case definition as required, even during run time.

For more information about ad hoc processes, see Chapter 8, Ad hoc and dynamic tasks.

Chapter 7. Deploying and testing the IT order case project

Prerequisites

Procedure

  1. In Business Central, go to MenuDesignProjects and click IT_Orders_New.
  2. Click Deploy.
  3. Go to MenuManageProcess DefinitionsManage Process InstancesNew Process Instance.
  4. Go to MenuDeploy and click Execution Servers and verify that a new container is deployed and started.

    new container
  5. Use the Case Management Showcase application to start a new case instance. For instructions about using the Showcase application, see Using the Showcase application for case management.

Chapter 8. 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 might not be used 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 are configured in the node’s Adhoc autostart property and are triggered automatically when the case instance is started.

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.

8.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.

Prerequisites

  • A case project has been created in Business Central.
  • The IT_Orders_New case project has been created in Business Central.
  • A case definition has been created.

Procedure

  1. In Business Central, go to MenuDesignProjects and IT_Orders_New.
  2. Click the IT_Orders_New case project Business Process (legacy) asset.
  3. In the process designer, click right arrows to open the Object Library on the left of the design palette.
  4. 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.

  5. Configure the ad hoc task properties in the Properties panel on the right.
  6. Trigger the task during run time using a Java API call. For example, the Order rejected ad hoc task is triggered by the following API call: CaseService.triggerAdHocFragment

8.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.

Prerequisites

  • Process Server is deployed and connected to Business Central.
  • The IT Orders project is deployed to Process Server.
  • The Showcase application .war file has been deployed alongside Business Central.

Procedure

  1. With the IT_Orders_New 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.

    apps launcher showcase button
  2. Log in to the Showcase application using your Business Central login credentials.
  3. Select an active case instance from the list to open it.
  4. Under OverviewActionsAvailable, click the dotdotdotbutton button next to New user task or New process task to add a new task or process task.

    Figure 8.1. Showcase dynamic actions

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

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

      showcase dynamic process task
  5. To view a dynamic user task in Business Central, click MenuTrackTask 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.

    task inbox dynamic task
    1. Click the dynamic task in the Task Inbox to open the task. A number of action tabs are available from this page.
    2. Using the actions available under the task tabs, you can begin working on the task.
    3. In the Showcase application, click the refresh button in the upper-right corner. Case tasks and processes that are in progress appear under OverviewActionsIn progress.
    4. When you have completed working on the task, click the Complete button under the Work tab.
    5. In the Showcase application, click the refresh button in the upper-right corner. The completed task appears under OverviewActionsCompleted.
  6. To view a dynamic process task in Business Central, click MenuManageProcess Instances.

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

8.3. Closing a case in the Showcase application

A case instance is complete when no more activities need to be performed and the business goal has been achieved. After a case is complete, you can close the case to indicate that the case is complete and that no further work is required. When you close a case, consider adding a specific comment about why you are closing the case. If needed, you can reopen the case later with the same case ID.

You can use the Showcase application to close a case instance at any time. From Showcase, you can easily view the details of the case or leave a comment before closing it.

Prerequisites

  • You are logged in to the Showcase application and are the owner or administrator for a case instance that you want to close.

Procedure

  1. In the Showcase application, locate the case instance you want to close from the list of case instances.
  2. To close the case without viewing the details first, click Close.
  3. To close the case from the case details page, click the case in the list to open it.

    From the case overview page you can add comments to the case and verify that you are closing the correct case based on the case information.

  4. Click Close to close the case.
  5. Click Back to Case List in the upper-left corner of the page to return to the Showcase case list view.
  6. Click the drop-down list next to Status and select Canceled to view the list of closed and canceled cases.

Chapter 9. Canceling or destroying a case

Cases can be canceled if they are no longer required and do not require any case work to be performed. Cases that are canceled can be reopened later with the same case instance ID and case file data. In some cases, you might want to permanently destroy a case so that it cannot be reopened.

Cases can only be canceled or destroyed using an API request. Red Hat Process Automation Manager includes the Swagger client, which includes endpoints and documentation for REST API requests. Alternatively, you can use the same endpoints to make API calls using your preferred client or Curl.

Prerequisites

  • A case instance has been started using Showcase.
  • You are able to authenticate API requests as a user with the admin role.

Procedure

  1. Open the Swagger REST API client in a web browser:

    /http://localhost:8080/kie-server/docs

  2. Under Case Instances :: Case Management, open the DELETE request with the following endpoint:

    /server/containers/{id}/cases/instances/{caseId}

    You can cancel a case using the DELETE request. Optionally, you can also destroy the case using the destroy parameter.

  3. Click Try it out and fill in the required parameters:

    Table 9.1. Parameters

    NameDescription

    id

    itorders

    caseId

    IT-0000000001

    destroy

    true

    (Optional. Permanently destroys the case. This parameter is false by default.)

  4. Click Execute to cancel (or destroy) the case.
  5. To confirm the case is canceled, open the Showcase application and change the case list status to Canceled. If the case has been destroyed, it will no longer appear in any case list.

Chapter 10. Additional resources

Appendix A. Versioning information

Documentation last updated on Thursday, October 31, 2019.

Legal Notice

Copyright © 2019 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.