0 votes
629 views
in IBM BPM Case Management by (30.6k points)

1 Answer

0 votes
by (30.6k points)

A BPD that was started by a case (as a case activity) already knows its case: tw.system.currentProcessInstance.caseFolderId and caseFolderServerName identify the case folder. Through them the process reads and writes case properties, adds documents and completes the activity:

// service flow inside the case activity's BPD
var folderId = tw.system.currentProcessInstance.caseFolderId;
var server   = tw.system.currentProcessInstance.caseFolderServerName;
// read the case folder (ECMFolder) with its properties
var caseFolder = tw.system.ecm.getFolder(server, folderId);
var amount = caseFolder.properties.get("CLM_Amount");
// update a case property (property list of ECMProperty)
var props = new tw.object.listOf.ECMProperty(); var p = new tw.object.ECMProperty(); p.objectTypeId = "CLM_Status"; p.value = "REVIEWED"; props[0] = p;
tw.system.ecm.updateFolderProperties(server, folderId, props);
// file a document into the case folder
tw.system.ecm.createDocument(server, folderId, "Decision.pdf", "application/pdf", tw.local.pdfBase64, true /*base64*/, null);

When the process ends, the case activity completes automatically and the case's rules / other activities react (activity preconditions on properties). Three more channels:

  • Case properties as BPD variables: the activity's data mapping (case properties <-> process variables) is declared in Case Builder; values mapped as output are written to the case when the activity completes - no code.
  • Case REST API from any BPD (also processes that are not case activities): PUT /CaseManager/CASEREST/v1/cases/{caseId} with the properties; POST .../cases/{caseId}/comments for comments.
  • Events: a BPD can send an event message (UCA) that a Case "wait on message" activity or an integration listens to, and Case can start BPDs (question 2926).

References

Related questions

0 votes
1 answer 1.2k views
0 votes
1 answer 1.2k views
0 votes
1 answer 2.2k views
0 votes
2 answers 4.0k views
0 votes
1 answer 3.4k views
0 votes
3 answers 4.7k views
0 votes
1 answer 2.5k views
+1 vote
1 answer 1.8k views

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...