This is the continue blog of Message wait and notification in OBPM
The exp file is under Avio-OBPM Training\Message Wait\
Tasks_4_5_6
Open “Process to Notify With Correlation” , double click “Begin” activity
add new correlation and add property
The initial code about customerId is in “Task 4 – Create Instance”.
input "Customer Id" : customerIdArg
using title = "Create instance",
buttons = ["Ok", "Cancel"]
returning selectedButton = selection
Here is the UI.
Double click the “Wait” activity, add argument
Add correlation
The initiate should be “No” as it is already initiated in the “Begin” activity.
In process “Notification using a Correlation”, put the code below in “Task 6 – Notification using a correlation”
custId as String
args as Any[Any]
input "Enter customer Id to notify" : custId
using title = "customer id",
buttons = ["Ok", "Cancel"]
returning selectedButton = selection
// Set the value to the argument in the Message Wait
args["customerIdArg"] = custId
send Notification
using processId = "/ProcessToNotifyWithCorrelation",
activityName = "Wait",
arguments = args,
argumentSetName = "WaitIn"
To test it
Since there is no interactive activity, nothing will be show in the inbox. It will simply wait here until it is notified.
input the same customer id to notify
The instance is notified and displayed in the inbox.
The correlation initiate could be done in code
In the “Beginning” activity
Put in an automatic activity with this code
valuesToUse as Any[]
valuesToUse[] = customerId
initiate Correlation
using name = "customer",
values = valuesToUse
No comments:
Post a Comment