Skip to main content

 

 

 

 

Template:OutSystems/Documentation_KB/Breadcrumb_New_Layout

 

 

Template:OutSystems/OSLanguageSwitcher

 

 

 

OutSystems

Set up a Case Management app

To start developing your Case Management app using the Case Management framework, you must start by creating and setting up a few base modules.

The steps in this topic guide you through the creation process of the following modules:

Case management app architecture

  • The User Interface (UI) module contains the screens of your app needed for end users to interact with the cases.
  • The Core Services (CS) module contains the case business entities of your app.
  • The Workflow (WF) module contains the BPT processes associated with the case business entities.
  • The configuration module contains the configuration mechanisms to aid you in setting up your app correctly.

Prerequisites

Before you proceed, make sure that you have installed the latest version of the Case Management framework in your environment.

Overview

Step 1. Create your app and the core services module

Step 2. Create the workflow module

Step 3. Create the configuration module

Step 4. Create an action to initialize the case

Optional step. Test your Reactive Web app setup

Next Steps

Step 1. Create your app and the core services module

Start by creating your app and adding the core services module, where you can later build the business logic and the corresponding public actions.

Adding the core services module

Follow these steps:

  1. In Service Studio, create a new app.

    Don't create a Service app.

  2. Create a Service module and name it <app-name>_CS.

    Replace <app-name> with the name of your app.

  3. In <app-name>_CS, open Manage Dependencies, and add the Case entity from CM_Case_CS producer as a dependency.

  4. In the Data tab, create a new entity for your business data, and set the name and add relevant attributes. For example, name the new entity Ticket, and add a Description text attribute.

  5. Set the Data Type of the Id attribute to Case Identifier.

  6. Select the entity and set the Public property to Yes.

  7. Double-click the entity. In the Advanced tab check Expose Process Events.

  8. Publish the module by selecting 1-Click Publish.

Step 2. Create a module for the workflow

In this step you create the workflow module, where you can later build your process using BPT.

Adding the workflow module

Follow these steps:

  1. In app details, create a Blank module and name it <app-name>_WF.

  2. In the <app-name>_WF module, open Manage Dependencies, add the following dependencies:

    • The business entity you created in Step 1 from the <app-name>_CS producer.
    • Case_AssociateProcess from the CaseServices_API producer.
  3. In the Process tab, create a new process.

  4. Set the Launch On property to the Create<business-entity-name> entity action, where <business-entity-name> is the name of the business entity created in Step 1.

  5. In the elements tree, right-click the process and select Add Callback Action > On Process Start.

  6. In the On Process Start action, add the Case_AssociateProcess action between the Start and End.

  7. Set the following properties of the Case_AssociateProcess action:

    On process start action of the process

    • Set CaseId as <business-entity-name>Id, where <business-entity-name> is the name of the business entity you created in Step 1.

    • Set ProcessId as ProcessId.

  8. Publish the module by selecting 1-Click Publish.

Step 3. Create the case configuration module

In this step you create the configuration module that creates and stores the case definition that you need while developing your apps with the Case Management framework.

Adding the configuration module

Follow these steps:

  1. In app details, create a Service module and name it <app-name>_ Configuration.

  2. In <app-name>_Configuration, open Manage Dependencies, and add the following dependencies:

    • Process_Definition entity from the (System) producer.

    • CaseDefinition_CreateOrUpdate action from the CaseConfigurations_API producer.

    • CaseStatus_CreateOrUpdate action from CaseConfigurations_API producer.

  3. In the Data tab, create a static entity, and name it CaseDefinitionConfiguration.

  4. Set the Public property to Yes.

  5. Rename the Id attribute to CaseDefinitionId, and the Data Type as Text.

  6. Rename the Label attribute as ModuleWF_SSKey.

  7. Delete Order and Is_Active attributes.

  8. Add a record to the CaseDefinitionConfiguration static entity. Name the record CaseDefinition.

    CaseDefinitionConfiguration static entity

  9. Generate a GUID and paste that GUID into the value field of the CaseDefinitionId attribute of the CaseDefinition record.

    A Globally Unique IDentifier, or GUID, is used as a unique identifier to ensure integrity across environments.
    You can use an online GUID generator to create a GUID for each record.

    Check the RFC 4122 for more information on GUIDs and their format.

  10. Open Manage Dependencies, and add the Espace entity from the (System) producer as a dependency.

  11. Publish the module by selecting 1-Click Publish.

  12. In the element tree of the Data tab, right-click the Espace entity and select View Data.

  13. In Filters, add a filter and define it as Espace.Name="<app-name>_WF", where <app-name> is the name of your app.

  14. Still in Espace Data, select the value shown for the SS_Key column and use Ctrl + C to copy the value.

  15. Set the ModuleWF_SSKey attribute of the CaseDefinition record as the SS_Key value you copied in the previous step.

  16. In Espace Data, delete the filter you created in step 13.

  17. Create a static entity, and name it CaseStatusConfiguration.

  18. Set the Public property to Yes.

  19. Rename the Id attribute to CaseStatusId, and the Data Type as Text.

  20. Rename the Label attribute as Name.

  21. Add a new Text attribute named Alias.

  22. Add a new Boolean attribute named IsInitial.

  23. Add a new Boolean attribute named IsTerminal.

  24. Add a record to the CaseStatusConfiguration static entity.

  25. Name the record <initial-state>, where <initial-state> represents the initial state of a case in your app, for example Submitted.

    CaseStatusConfiguration static entity

  26. Set IsInital as True and IsTerminal as False.

  27. Generate a GUID and paste that GUID into the value field of the CaseStatusId attribute of the <initial-state> record.

    A Globally Unique IDentifier, or GUID, is used as a unique identifier to ensure integrity across environments.
    You can use an online GUID generator to create a GUID for each record.

    Check the RFC 4122 for more information on GUIDs.

  28. In the Processes tab, add a new timer and name it Bootstrap_CaseConfigurations.

  29. Set the Schedule property of the timer as When Published.

  30. In the Action property of the new timer, select New Server Action.

  31. In the new action, add an Aggregate between the Start and End, and name it GetCaseDefinitionData.

  32. Set the Max. Records of the aggregate to 1.

  33. Double-click the aggregate and add the Espace entity as a source.

  34. In Sources, add the CaseDefinitionConfiguration static entity and the Process_Definition entity as sources.

    Make sure that a join exists between Espace and Process_Definition, of the Only With type and with the Espace.Id = Process_Definition.Espace_Id condition.
  35. Add a join between Espace and CaseDefinitionConfiguration.

  36. Set the condition as Espace.SS_Key = CaseDefinitionConfiguration.ModuleWF_SSKey.

    Make sure the join is set as Only With.

    GetCaseDefinitionData aggregate

  37. In the action flow, add a CaseDefinition_CreateOrUpdate action after the aggregate.

  38. Select Expand CaseDefinitionRec and set the inputs of the action with the data from the aggregate:

    CaseDefinition_CreateOrUpdate

    • Set the Id as TextToIdentifier(GetCaseDefinitionData.List.Current.CaseDefinitionConfiguration.CaseDefinitionId).

    • Set the Name as GetCaseDefinitionData.List.Current.Process_Definition.Name.

    • Set the EntityId as GetCaseDefinitionData.List.Current.Process_Definition.Process_Entity_Id.

    • Set the IsActive as True.

  39. After the CaseDefinition_CreateOrUpdate, add an aggregate that fetches all records in CaseStatusConfigurations by dragging the CaseStatusConfigurations static entity to the action flow.

  40. After the aggregate created in the previous steps, add a For Each.

  41. Set the Record List of the For Each as GetCaseStatusConfigurations.List.

  42. Add a CaseStatus_CreateOrUpdate action next to the For Each.

  43. Connect the For Each to the CaseStatus_CreateOrUpdate, and then connect the CaseStatus_CreateOrUpdate to the For Each.

    For each in Bootstrap_CaseConfigurations action

  44. Set the CaseStatusRec of the CaseStatus_CreateOrUpdate as GetCaseStatusConfigurations.List.Current.CaseStatusConfiguration.

  45. Set the inputs of the action with the data from the aggregate:

    • Set Id as TextToIdentifier(CaseStatusId).

    • Set CaseDefinitionId as CaseDefinition_CreateOrUpdate.CaseDefinitionId.

    • Set IsActive as Is_Active.

    Ensure the following mapping is set:

    • Name = Name
    • Alias = Alias
    • IsInitial = IsInitial
    • IsTerminal = IsTerminal

  46. Publish the module by selecting 1-Click Publish.

Step 4. Create an action to initialize the case

In this step you add an action to the core services module that initializes the cases. Follow these steps:

  1. In <app-name>_CS, open Manage Dependencies and add the following dependencies:

    • Case_Initialize action from the CaseServices_API producer.

    • CaseDefinitionConfiguration static entity from <AppName>_Configuration producer.

  2. In the Logic tab, create a server action, and name it <business-entity-name>_Create, where <business-entity-name> is the name of the entity created in Step 1. This action is used to encapsulate the logic to initialize the case.

  3. Set the Public property of the action to Yes.

  4. Add an input parameter and name it <business-entity-name>.

  5. In the action flow of <business-entity-name>_Create, add a Case_Initialize action between the Start and End.

  6. Set CaseDefinitionId of the Case_Initialize action as TextToIdentifier(Entities.CaseDefinitionConfiguration.CaseDefinition).

  7. Add an Assign after the Case_Initialize action, and set the <business-entity-name>.Id (the identifier of the input parameter) as Case_Initialize.CaseId (the output of Case_Initialize).

  8. Add a Create<business-entity-name> action after the assign, and set the Source as the input parameter.

    Create entity action wrapper

  9. Publish the module by selecting 1-Click Publish.

If you created a Reactive Web app you can check out the next optional step to learn how to create the UI module and test the setup of your case management app.

Otherwise you can check out the next steps on developing your case management app.

Optional step. Test your Reactive Web app setup

The following steps are for Reactive Web apps only.

Let's make sure the setup of your case management app is complete by adding a UI module that you can use to test your app.

Adding the UI module

Follow these steps:

  1. Create a Reactive Web App module and name it <app-name>_UI.

  2. Open Manage Dependencies and add <business-entity-name>_Create and <business-entity-name> entity from <app-name>_CS producer. Where <business-entity-name> is the name of the business entity you created in step 1.

  3. In the Interface tab, add a new empty screen to the Main Flow.

  4. Add a local variable with <business-entity-name> data type.

  5. Set your screen as Anonymous, in the Roles properties.

  6. Add a Form to your screen.

  7. Drag your local variable into the form widget.

  8. Define a new action for the OnClick event of the generated button.

  9. Add a <business-entity-name>_Create action after the OnClick event flow.

  10. Set the <business-entity-name>_Create action input as the local variable created in step 4.

  11. Publish the module by selecting 1-Click Publish.

  12. Open in browser by selecting Open in browser.

  13. In your app, fill in the form and submit it.

  14. Access the Service Center for your environment by going back to Service Studio and selecting Module Management in Service Center.

  15. In Monitoring > Processes, find your process. Verify that it ran and is now closed.

Next steps

After completing the steps in this topic you are ready to start developing your case management app. The typical next steps include the following:

  • Was this article helpful?