Search

Chapter 27. Designing the case definition

download PDF

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 27.1. orderhardware business process case definition

IT Orders case design

Prerequisites

Procedure

  1. In Business Central, go to Menu Design Projects and click IT_Orders_New.
  2. Click Add Asset Case 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 sub-processes, subcases, and business rules used in the case.

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

      Figure 27.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 Properties diagram properties icon.
    2. Scroll down and expand Case Management, click the plus sign icon in the Case Roles section, and enter the following:

      Figure 27.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.

27.1. Creating the Place order sub-process

Create the Place order sub-process, 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 27, Designing the case definition.

Prerequisites

Procedure

  1. In Business Central, go to Menu Design Projects IT_Orders_New.
  2. From the project menu, click Add Asset Business 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 Properties diagram properties icon.
  6. Scroll down, expand Process Data, click the plus sign icon in the Process Variables section, and enter the following values under Process Variables:

    Table 27.1. Process variables
    NameData Type

    CaseID

    String

    Requestor

    String

    _hwSpec

    org.jbm.doc

    ordered_

    Boolean

    info_

    String

    caseFile_hwSpec

    org.jbm.doc

    caseFile-ordered

    Boolean

    caseFile-orderinf

    String

    Figure 27.4. Completed process variables

    screen capture of the process variables list
  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.

    screen capture of Create Task icon
    screen capture of Convert into User icon
  9. Click the user task and in the Properties panel, input Place order in the Name field.
  10. Expand Implementation/Execution, click Add below the Groups menu, click Select New, and input supplier.
  11. click the Properties icon in the Assignments field and add the following data inputs and outputs in the Place order Data I/O dialog box:

    Table 27.2. Data inputs and assignements
    NameData TypeSource

    _hwSpec

    org.jbpm.document

    caseFile_hwSpec

    orderNumber

    String

    CaseId

    Requestor

    String

    Requestor

    Table 27.3. Data outputs and assignements
    NameData TypeTarget

    ordered_

    Boolean

    caseFile_ordered

    info_

    String

    CaseFile_orderInfo

    screen capture of the Place order Data I/0 dialog

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

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

    Approved order #{CaseId} to be placed

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

    screen capture of the Place order user task
    screen capture of the end event added to the Place order user task
  15. Click Save to confirm your changes.

You can open the sub-process in a new editor in Business Central by clicking the Place order task in the main process and then clicking the Open Sub-process task icon.

screen capture of the Open Sub-process icon

27.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 Menu Design Projects IT_Orders_New orderhardware Business Processes.
  2. Create and configure the Prepare hardware spec user task:

    1. Expand Tasks in the Object Library and drag a user task onto the canvas and convert the new task to a user task.
    2. Click the new user task and click the Properties diagram properties icon in the upper-right corner.
    3. Input Prepare hardware spec in the Name field.
    4. Expand Implementation/Execution, click Add below the Groups menu, click Select New, 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 the Properties icon in the Assignments field and add the following:

      Prepare hardware I/O values
    8. Click OK.
  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 click the Properties diagram properties icon in the upper-right corner.
    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 Select New, and input manager.
    5. Input ManagerApproval in the Task Name field.
    6. click the Properties icon in the Assignments field and add the following:

      Manager approval I/O values
    7. Click OK.
    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 sub-process:

    1. From the Object Library, expand sub-processes, 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 sub-process.

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

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

      Sequence flow conditions
    9. 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 click the Properties diagram properties icon in the upper-right corner.
    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 Select New, and input owner.
    7. click the Properties icon in the Assignments field and add the following:

      Order rejected I/O values
    8. Click OK.
    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 27.5. Manager approval business process

    Manager approval business process
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.