Create Case service

The Create Case service is used to create a case by using a service call.

When a new Add Case Layout is created in a solution, it appears by default as in the following diagram-1.

Create Case service implementation, example 1

The diagram-1 can be customized to use a service to create a case as shown in diagram-2, by using the following procedure.

Create Case service implementation, example 2

To use the Create Case service, follow the steps:
  1. At the Start, drag the Case Properties into the drop area of the Add Case coach, by selecting them from Variables.
  2. Add a button Create Case in the Add Case coach.
  3. Add a service and name it as Create Case Service and connect the Add Case coach to the service. Make sure that the Create Case button connects the Add Case coach to the Create Case Service. Otherwise, change it to this button in the connector.
  4. In the Create Case Service, select the implementation to be Create Case Service from the Case Toolkit.
  5. In the Create Case Service, map the input and output data mapping as in Table 1 and 2.
  6. Add an exclusive gateway, which has the default flow to a new coach named as Case Details and another flow to a new coach Display error. The condition on the error path needs to be set to tw.local.caseTypeObject.errorString != undefined
  7. Update the Display error coach to display the error message by binding the variable caseTypeObject.errorString to a Display text UI view. Add a Back button and connect the Display error coach back to the Add Case coach when the Back button is clicked.
  8. Update the Case Details coach to show any existing Case views like Case Summary, and configure the configuration option Case Identifier to tw.local.caseTypeObject.caseId and Target Object Store Name to tw.local.caseTypeObject.tosName. Rest of the configuration options can be ignored.
  9. Create a new End Event and connect the Case Details coach to this End Event.
Table 1. Input mapping for Create Case service
Name Description Data type Input Mapping
caseType The case type that is passed as an input to the Create Case service. Map this config option to tw.local.caseType. String Mandatory
tosName The target object store name that is passed as input to the Create Case service. Map this config option to tw.local.tosName. String Mandatory
jsonProps The string representation of the JSON value of case properties that are provided as input to the Create Case service. Map this config option to JSON.stringify(tw.local.caseProperties). For example: {"Name":{"displayName": "Name","value": "Roger"},"Age":{"displayName": "Age","value": 35},"Salary":{"displayName": "Salary","value": 300000}} where Name, Age and Salary represent the display names of the caseProperties Content Object String Mandatory
caseClientTabID The Case Client tab ID that is passed as input to the Create Case service. Map this config option to tw.local.caseClientTabID. String Optional
caseClientURI The base URI of the Case Client that is used internally by the associated view. Map this config option to tw.local.caseClientURI. String Optional
Table 2. Output mapping for Create Case service
Name Description Data type
result The caseTypeObject of type CaseObject that receives the output from the execution of the Create Case service. Map the output result(CaseObject) to tw.local.caseTypeObject CaseObject
Table 3. Structure of the CaseObject returned by the Create Case service
Name Description Data type
caseId The case identifier of the new case. String
tosName The target object store name where the new case belongs to. String
caseTitleProperty The case type of the fetched case instance. String
caseTypeName The case type name of the case instance that you query. String
isAutoLaunch The property that indicates whether the new case must be opened automatically after creation. Boolean
errorString The Create Case service error message that appears when the service fails to create the case. String
messageString The message that the service creates upon successful execution of the service, which can be used to broadcast a message back to the Case Client or Workplace. For example, this message can be bound as data to the end node. String
modified Date The last modified date of the case instance. String
healthIndicator The health of the case instance, if case health is configured. String
caseClientURI The base URI of the Case Client that is used internally by the associated views. String
caseState The state of the case instance. String
isPropertiesDirty The property that indicates whether the case properties were modified. Boolean

icnRepoId

The repository name mapping that represents the target object store in Content Navigator. It is used internally by the case views for building the Daeja Viewer URL to view case documents by using Daeja Viewer. String

caseTypeSymbolicName

The case type symbolic name of the case instance internally used by the view. String

originalCaseProperties

Copy of the case properties content object that is used for comparing with the changed values in the case properties to filter out only the modified properties that need saving. ANY

graphQLEndpointUrl

GraphQL Servers end-point URL, which can be internally used by the associated views. This value is available, if GraphQL Server is available and configured. On a traditional WebSphere Application Server, this parameter gets its value if it is set in the configuration that uses the setBPMExternalECM or updateBPMExternalECM admin commands. On Cloud Pak for Business Automation, this value is automatically set, if GraphQL is part of the Cloud Pak for Business Automation. String
solutionPrefix The prefix of the solution that is being deployed. String
solutionName The name of the solution that is being deployed. String
currentRole The current role of the logged in user. String
isCaseOwner The property that indicates whether the user is a case owner. Boolean