Create Case service

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

When a new Add Case Layout is created in a solution, it would be 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 the 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 per 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 should be set to tw.local.caseTypeObject.errorString != undefined
  7. Make changes to 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. Make changes to 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
caseType The Case Type that is passed as input to the Create Case service. Map this config option to tw.local.caseType. String
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
jsonProps The string representation of the JSON value of case properties that is passed as input to the Create Case service. Map this config option to JSON.stringify(tw.local.caseProperties). String
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
caseClientURI The base URI of the Case Client, that can be used internally by the associated view. Map this config option to ttw.local.caseClientURI. String
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 resides. 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 error message that is sent by the Create Case service, when the service failed 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 can be used internally by the associated views. String
caseState The state of the Case instance. String
isPropertiesDirty: The indicator that indicates if the Case properties got modified. Boolean
 22.0.2 

icnRepoId

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

caseTypeSymbolicName

The Case Type Symbolic name of the case instance internally used by the view. String
 22.0.2 

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 needs saving. ANY
 22.0.2 

graphQLWEndpointURL

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 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 CP4BA, this value is automatically set, if GraphQL is part of the Cloud Pack for Business Automation. String