Synchronizing cases with solution data

If you modify a solution after it is deployed, run the case synchronizer utility to update existing instances to match the changes that you made. You can run the utility by using commands or the Case Manager REST protocol.

When you change the case type of a solution and redeploy the solution, the changes are applied to new case instances. The changes are not applied to running case instances.

Use the case synchronizer utility to update the case instances to match the changes that you make to the following case type:
  • Creating a new folder structure
  • Case folder structure changes
  • New activities that are added to a case type
  • Changes to a container activity (Add or Delete) of subactivities that are associated with a container
  • Changes to activity launch modes (Manual, Automatic, Discretionary, Repeatable)
  • Changes to activity-required states (Required, Optional)
  • Changes to activity group modes (Inclusive, Exclusive)

The case synchronizer utility processes case instances in batches. The processed case instance ID is stored in the casesynchronizer.processed file in the path where the tool is run. If a batch runs without any errors, the tool deletes this file. If errors occur during the execution of the case synchronizer utility, the tool checks for the case instance IDs and so on.

The case synchronizer utility is in the IBM® Business Automation Workflow installation folder.
Table 1. Case synchronizer file name and locations
Platform File name Location
AIX® caseSynchronizer.sh /opt/IBM/CaseManagement
Linux® caseSynchronizer.sh /opt/IBM/CaseManagement
Linux for System z caseSynchronizer.sh /opt/IBM/CaseManagement
Windows caseSynchronizer.bat C:\Program Files (x86)\IBM\CaseManagement

Syntax

caseSynchronizer command parameter-list

parameter-list consists of a set of name-value pairs, where each pair has a parameter and a value, separated by a space.

Commands

launch
Start the case synchronizer utility. The launch command requires parameters.
suspend
Stop the case synchronizer utility. The suspend command does not require parameters.

Parameters

Required: -cews_uri
The web services URI to connect to Content Platform Engine, for example, http: //myserver:9080/wsi/FNCEWS40MTOM.
Required: -username
The user ID to connect to Content Platform Engine.
Required: -password
The password for the specified user ID to connect to Content Platform Engine. If the password is not specified, the case synchronizer utility prompts for the password.
Required: -target_os
The target object store that the case synchronizer checks.
Required: -caseType
The symbolic name of the case type for the tool to update.
If the name of the case type includes spaces, surround the name with single quotation marks, for example, -caseType 'Accident report'.
Optional: -caseTypeFilter
The filter criteria is used when you are retrieving the case instances to update.
Optional: -includedTaskTypes
A comma-separated list of the activity type symbolic names to add to the case instances.
Optional: -excludedTaskTypes
A comma-separated list of the activity type symbolic names to exclude from the update to the case instances.
Optional: -file
The path to an input file that contains the parameters to run the tool.
If specified, the input file must include the cews_uri, username, password, target_os, and caseType parameters without leading hyphens.
Optional: -batchSize
The number of items to retrieve and process at one time. If not specified, the default batch size is 1000 items.
Optional: -threadPoolSize
The number of active threads for the tool to use when it processes case instances. The default value is 4.

Examples

Note: The parameter values that refer to the case objects must use symbolic names. The symbolic name values are applied to the parameters -target_os, -caseType, -includedTaskTypes, -excludedTaskTypes, and the property names are used in -caseTypeFilter. In the following examples, ‘ABC_AccidentReport’ is the symbolic name for the case type, 'Accident Report' and 'ABC_VerifyData' are the symbolic names of an activity task in the solution.
The commands in example 1-3:
  • start the case synchronizer for cases of type Accident Report
  • update every case instance of that case type
  • update the changes that are made to that case type
Example 1:
caseSynchronizer launch -cews_uri http://myserver:9080/wsi/FNCEWS40MTOM 
-username administrator -password mypassword 
-target_os MyTargetOS -caseType 'ABC_AccidentReport'
Example 2:
caseSynchronizer launch -cews_uri http://myserver:9080/wsi/FNCEWS40MTOM 
-username administrator -password mypassword  -batchSize 2000
-target_os MyTargetOS -caseType ‘ABC_AccidentReport' -includedTaskTypes ABC_VerifyData, ABC_ProcessClaim
It changes the batch size to 2000 and includes a comma-separated list of activity types that are updated by the case synchronizer utility.
Example 3:
caseSynchronizer launch -cews_uri http://myserver:9080/wsi/FNCEWS40MTOM 
-username administrator -password mypassword -threadPoolSize 8
-target_os MyTargetOS -caseType 'ABC_AccidentReport' -excludedTaskTypes ABC_CheckCustomerData, ABC_ReportClaim

It changes the threadPoolSize to 8 and includes a comma-separated list of activity types that are excluded or skipped by the case synchronizer utility.

Example 4:

The following command starts the case synchronizer for cases with the file that contains the arguments to the utility. The input file must include the cews_uri, username, password, target_os, and caseType parameters.
caseSynchronizer launch -file /home/user/input_case_synchronizer
Example 5:
The following command suspends the case synchronizer.
caseSynchronizer suspend
Example 6:

The number of case instances that are processed by the case synchronizer can be further filtered by using the -caseTypeFilter argument. The value in the -caseTypeFilter argument can be based on any case instance property. The value is used as a search condition for retrieving the case instances.

The following command starts the case synchronizer for cases of type Accident Report and where the isValidCustomer property is set to true and the ClaimAmount property value is greater than or equal to 100.
caseSynchronizer launch -cews_uri http://myserver:9080/wsi/FNCEWS40MTOM  
-username administrator -password mypassword -target_os MyTargetOS -caseType 'ABC_AccidentReport' 
-caseTypeFilter '[ABC_isValidCustomer] = true AND [ABC_ClaimAmount] >= 100'

Case Manager REST protocol for the case synchronizer

You can use the Case Manager REST protocol to run the case synchronizer. The following example is a URI for the POST method:

https://host_name:port_number/CaseManager/CASEREST/v1/casesynchronizer

Request content

The request for the POST method contains the following parameters in JSON in the body:

{
   "command" : "launch -Start the case synchronizer. Required.",
              "suspend -Stop the case synchronizer.",
   "cews_uri" : "The web services URI used to connect to Content Platform Engine. Required. For example: https://myserver:9080/wsi/FNCEWS40MTOM",
   "username" : "The user ID used to connect to Content Platform Engine. Required.",
   "password" : "The password for the specified user ID used to connect to Content Platform Engine. Required.",
   "target_os" : "The target object store. Required.",
   "caseType" : "The name of the case type for which the case synchronizer is to be run. Required. If the name of the case type includes spaces, surround the name with single quotation marks. For example: -caseType 'Accident report'",     
   "caseTypeFilter" : "The filter criteria to use when retrieving the case instances to update. This parameter is optional.",
   "includedTaskTypes" : "A comma-separated list of the task type symbolic names to add to the case instances. This parameter is optional.",
   "excludedTaskTypes" : "A comma-separated list of the task type symbolic names to exclude from the update to the case instances. This parameter is optional.",
   "batchSize" : "The number of items to retrieve and process at one time. Optional. If not specified, the default batch size is 1000 items.",  
   "threadPoolSize" : "The number of active threads when processing activities. Optional. The default value is four threads."
}

The value of casesynchronizerresult in the response JSON indicates whether the case synchronizer ran successfully.

Note: To run the case synchronizer by using the REST protocol, the login modules for FileNetP8WSI must be configured on the application server.