Let me explain you an interesting concept of adding smart object as a reference to workflow and the benefits of doing it.
Let us assume there is a SmartObject which gets you all the details of students like Roll Number, Name, Branch, Address and Percentage.
Now we need to build a workflow where we need to use multiple properties of students smart object at multiple activities, in a traditional approach we do call the smart object every time in the activity whenever we need. But here, using the concept of references we just have to add a reference to that smart object once and can use its properties anywhere in workflow multiple times.
By doing this way we are optimizing the process design as the calls to Smart Object server will drastically decrease and it will improve the performance of the workflow.
Let us see an example with sample workflow for a student admission approval, where at each level/activities we need a student address, marks or percentage and other details.
Now let’s see how we add a reference of that Students Smart object to this workflow.
Navigate to K2 Object Browser, Process/Activity Data Tab and right click on References and Click Add.
Provide some Name and Description to your reference and select the smart object method that gets you the student details. as below Screenshot.
Provide the input parameter, here I’m passing the Roll Number Data field as an input parameter to the Smart Object’s Roll Number property so that for an process instance it holds reference of a single student details.
Finally the Click finish and you should see your reference added in K2 Object Browser as shown below.
That’s it. Your reference to Student’s Smart Object has been added. Pretty Simple but Interesting and Useful feature right!! Now you just have to drag and drop these properties where ever you need in the workflow.
This is how we can add and make use of these references in Workflow designing and improve the performance.