- The shared object is created
- The business process or task is persisted to the database
Tuesday, 18 February 2014
Shared Business Objects Usage in IBM BPMv8.0
Hello friends I would like to share scenario on usage of Shared Business Objects Usage in IBM BPMv8.0
About Shared Business Object:-
Shared Business object values should be accessible to other instances at run time. Shared business objects only apply to a complex structure type. The data within a shared business object is shared between business processes and tasks.
A shared business object uses database resources. The data within a shared object is persisted to the database when:
Declaring Shared Business Object:-
This Scenario display a employee details on simple coach .One employee variable is shared Bo type and another one is unshared Bo type.
Variable declaration in BPD and Human Service:-
Running the Sample:-
Employee HS output:-
This is first coach which is displaying the default values and click on ok button.Then flow will create a token on Employee1 (Usertask ) and Employee1(Usertask ) as I used parallel gateway it will wait until two tasks done.
Edit Employee1 HS output:-
Change the values in Enter Last name field in Employee share and Employee Noshare fields(i.e D to Dondeti)
Click on Ok button then flow waits at Edit Employee2 HS out put. Run the service.
If you observe the above coach the value which I changed in EditEmployee1HS is affected to Employee Share BO because it was shared business object type.
Ability to explicitly load shared Business Object if required using theunique key associated with it
• Loading a shared Business Object
• Getting the unique key:
// Create shared object
var empShare = new tw.object.EMPLOYEESHARE();
empShare.lastName = "Dondeti";
// Create key for shared object
tw.local.empShareKey = empShare.metadata("key");
log.info("empShareKey: " + tw.local. empShareKey);
// Retrieve shared object by key
var empShare2 = new tw.object.EMPLOYEESHARE (tw.local.empShareKey);
log.info("empShare2. lastName: " + empShare2. lastName);
Thanks for reading .I hope this post helps you. So far this is my best effort to explain. Please correct me if I do anything wrong.
Please share your valuable suggestions and feedback to my mail id"firstname.lastname@example.org" to improve myself.