Getting started with case management

Red Hat Process Automation Manager 7.8

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

  1. In Business Central, go to MenuDesignProjects. If there are existing projects, you can access the samples by clicking the MySpace default space and selecting Try Samples from the Add Project pull-down menu. If there are no existing projects, click Try samples.
  2. 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 asset to help you understand the business process flow.

orderhardware Business Processes (legacy) asset
Note

The legacy process designer in Business Central is deprecated. 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 2. 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 2.1. Default spaces

    spaces teams bc
  2. Click Add ProjectCase project.

    Figure 2.2. Case project menu

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

    Figure 2.3. Add Project window

    addproject case

The Assets view of the project opens.

Chapter 3. 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.

3.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 Save, and then click Yes, Move to confirm your changes.

3.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:

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

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

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

      • Id: satisfied
      • Label: Leave empty
      • Type: Boolean
    6. Click Create.
  6. Click Save to confirm your changes.

    Figure 3.1. Survey data object details

    survey do

Chapter 4. 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 4.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.
  3. In the Create new Case definition window, add the following required information:

    • Case Definition: 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 values for the case file variables that are accessible to the subprocesses, subcases, and business rules used in the case.

    1. In the upper-right corner, click the Diagram properties diagram properties icon.
    2. Scroll down and expand Case Management, click btn plus in the Case File Variables section, and enter the following:

      Figure 4.2. orderhardware case file variables

      Case file variables
    Note

    The following case file variables are custom data types:

    • hwSpec: org.jbpm.document.Document (type in this value)
    • survey: Survey [com.myspace.it_orders_new] (select this value)
  6. Click Save.
  7. Define the roles involved in the case.

    1. In the upper-right corner, click the Diagram properties diagram properties icon.
    2. Scroll down and expand Case Management, click btn plus in the Case Roles section, and enter the following:

      Figure 4.3. orderhardware 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.
  8. Click Save.

4.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 4, 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:

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

    start event
    new task
    user task
  9. Click the user task and in the Diagram properties panel, input Place order in the Name field.
  10. Expand Implementation/Execution, click Add below the Groups menu, click SelectNew, and input supplier.
  11. Click diagram properties in the Assignments field and add the following:

    place order io1

    For the first input assignment, select Custom for the Data Type and input org.jbpm.document.Document.

  12. Click Save.
  13. Select the Skippable check box and enter the following text in the Description field:

    Approved order #{CaseId} to be placed

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

    create end event
    sub proc
  15. Click Save to confirm your changes.

4.2. Creating the Manager approval business process

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

Procedure

  1. In Business Central, go to MenuDesignProjectsIT_Orders_Neworderhardware Business Processes.
  2. Create and configure the prepare hardware spec user task:

    1. Drag a start event onto the canvas and create an outgoing connection from the start event to a task and convert the new task to a user task.
    2. Click the new user task and in the upper-right corner click the Properties diagram properties icon.
    3. Input Prepare hardware spec in the Name field.
    4. Expand Implementation/Execution, click Add below the Groups menu, click SelectNew, and input supplier.
    5. Input PrepareHardwareSpec in the Task Name field.
    6. Select the Skippable check box and enter the following text in the Description field:

      Prepare hardware specification for #{initiator} (order number #{CaseId})

    7. Click diagram properties in the Assignments field and add the following:

      Prepare hardware I/O values
    8. Click Save.
  3. Create and configure the manager approval user task:

    1. Click the Prepare hardware spec user task and create a new user task.
    2. Click the new user task and in the upper-right corner click the Properties diagram properties icon.
    3. Click the user task and in the Properties panel input Manager approval in the Name field.
    4. Expand Implementation/Execution, click Add below the Actors menu, click SelectNew, and input manager.
    5. Input ManagerApproval in the Task Name field.
    6. Click diagram properties in the Assignments field and add the following:

      Manager approval I/O values
    7. Click Save.
    8. Select the Skippable check box and enter the following text in the Description field:

      Approval request for new hardware for #{initiator} (order number #{CaseId})

    9. Enter the following Java expression in the On Exit Action field:

      kcontext.setVariable("caseFile_managerDecision", approved);

    10. Click Save.
  4. Click the Manager approval user task and create a Data-based Exclusive (XOR) gateway.

    Creating a gateway
    Creating a Data-based Exclusive (XOR) gateway
  5. Create and configure the place order reusable subprocess:

    1. From 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.

      Creating a reusable task
    2. Connect the Data-based Exclusive (XOR) gateway to the subprocess.

      Creating a Data-based Exclusive (XOR) gateway to subprocess
    3. Click the new sub task and in the upper-right corner click the Properties diagram properties icon.
    4. Input Place order in the Name field.
    5. Expand Data Assignments and click diagram properties in the Assignments field and add the following:

      Place order I/O values
    6. Click the connection from the Data-based Exclusive (XOR) gateway to the subprocess and click the Properties diagram properties icon.
    7. Expand Implementation/Execution, select Condition, and set the following condition expressions.

      Sequence flow conditions
    8. Click the Place order user task and create an end event.
  6. Create and configure the order rejected user task:

    1. Click the Data-based Exclusive (XOR) gateway and create a new user task.
    2. Drag the new task to align it below the Place order task.

      Align new task
    3. Click the new user task and in the upper-right corner click the Properties diagram properties icon.
    4. Input Order rejected in the Name field.
    5. Expand Implementation/Execution and input OrderRejected in the Task Name field.
    6. Click Add below the Actors menu, click SelectNew, and input owner.
    7. Click diagram properties in the Assignments field and add the following:

      Order rejected I/O values
    8. Click Save.
    9. Select the Skippable check box and enter the following text in the Description field:

      Order #{CaseId} has been rejected by manager

    10. Click the Order rejected user task and create an end event.
    11. Click Save.
  7. Click the connection from the Data-based Exclusive (XOR) gateway to the Order rejected user task and click the Properties diagram properties icon.
  8. Expand Implementation/Execution, select Condition, and set the following condition expressions.

    Sequence flow conditions
  9. Click Save.

    Figure 4.4. Manager approval business process

    Manager approval business process

Chapter 5. 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.

5.1. Creating the Hardware spec ready milestone

Create a HardwareSpecReady 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 the Properties diagram properties icon.
  3. Input Hardware spec ready in the Name field.
  4. Expand Implementation/Execution and select Adhoc Autostart.
  5. Expand Data Assignments, click diagram properties in the Assignments field, and add the following:

    HardwareSpecReady I/O values

    Click the Source column drop-down, select Constant, and input org.kie.api.runtime.process.CaseData(data.get("hwSpec") != null).

  6. Click Save.

5.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 to the canvas below the HardwareSpecReady milestone.
  2. Click the new milestone and in the upper-right corner click the Properties diagram properties icon.
  3. Input Manager decision in the Name field.
  4. Expand Implementation/Execution and select Adhoc Autostart.
  5. Expand Data Assignments and click diagram properties in the Assignments field and add the following:

    ManagerDecision I/O values

    Click the Source column drop-down, select Constant, and input org.kie.api.runtime.process.CaseData(data.get("managerDecision") != null).

  6. Click Save.

5.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, expand Milestone in the Object Library and drag a new milestone on the canvas below the Prepare hardware spec user task.
  2. Click the new milestone and in the upper-right corner click the Properties diagram properties icon.
  3. Input Milestone 1: Order placed in the Name field.
  4. Expand Implementation/Execution and select Adhoc Autostart.
  5. Expand Data Assignments, click diagram properties in the Assignments field, and add the following:

    Milestone evaluation condition configuration

    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.

  6. Click Save.
  7. Click Milestone 1: Order placed and create a new script task.

    new task creation
    convert to a script task
  8. Click the new script task and in the upper-right corner click the Properties diagram properties icon.
  9. Input Notify requestor in the Name field.
  10. Expand Implementation/Execution and input System.out.println("Notification::Order placed");.
  11. Click the Notify requestor script task and create a signal end event.
  12. Click the signal event and in the upper-right corner click the Properties. diagram properties icon.
  13. Expand Implementation/Execution, click the down arrow in the Signal field, and select New.
  14. Input Milestone 2: Order shipped.
  15. Click the down arrow in the Signal Scope field, select Process Instance.
  16. Click Save.

    Figure 5.1. Order placed milestone

    Order placed milestone

5.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 the Properties diagram properties icon.
  3. Input Milestone 2: Order shipped in the Name field.
  4. Expand Implementation/Execution and ensure that Adhoc Autostart is not selected.
  5. Expand Data Assignments, click diagram properties in the Assignments field, and add the following:

    Order shipped ready I/O values

    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.

  6. Click Save.
  7. Click Milestone 2: Order shipped and create a new script task.
  8. Click the new script task and in the upper-right corner click the Properties diagram properties icon.
  9. Input Send to tracking system in the Name field.
  10. Expand Implementation/Execution and input System.out.println("Order added to tracking system");.
  11. Click the Send to tracking system script task and create a signal end event.
  12. Click the signal event and in the upper-right corner click the Properties. diagram properties icon.
  13. Expand Implementation/Execution, click the down arrow in the Signal field, and select New.
  14. Input Milestone 3: Delivered to customer.
  15. Click the down arrow in the Signal Scope field, select Process Instance.
  16. Click Save.

    Figure 5.2. Order shipped milestone

    Order shipped milestone

5.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 the Properties diagram properties icon.
  3. Input Milestone 3: Delivered to customer in the Name field.
  4. Expand Implementation/Execution and ensure that Adhoc Autostart is not selected.
  5. Expand Data Assignments, click diagram properties in the Assignments field, and add the following:

    Delivered to customer I/O values

    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.

  6. Click Save.
  7. Click Milestone 3: Delivered to customer and create a new user task.

    1. Click the new user task and in the upper-right corner click the Properties diagram properties icon.
    2. Input Customer satisfaction survey in the Name field.
    3. Expand Implementation/Execution, click Add below the Actors menu, click SelectNew, and input owner.
    4. Input CustomerSurvey in the Task Name field.
    5. Select the Skippable check box and enter the following text in the in the Description field:

      Satisfaction survey for order #{CaseId}

    6. Click diagram properties in the Assignments field and add the following:

      survey I/O values
    7. Click Save.
  8. Click the Customer satisfaction survey user task and create an end event.
  9. Click Save to confirm your changes.

    Figure 5.3. Delivered to customer milestone

    Delivered to customer milestone

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.

Chapter 6. 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 7. Additional resources

Appendix A. Versioning information

Documentation last updated on Thursday, September 08, 2020.

Legal Notice

Copyright © 2020 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.