Auto-complete a work item

  • 24 August 2012
  • 4 replies
  • 1 view

Badge +1

Hi,

Do you know of any way where we can automatically close a work item based on a value in a data field. Here is the scenario. K2 sends a work item to a user. User clicks on the link and updates a form. Is there a way to use that information in the form and complete that workitem?

Thanks
Sundeep.


4 replies

Badge +9


Workflow Tasks can be auctioned/updated via the runtime
object model, so if you have all the info on the form to make a decision you
can certainly check your conditions and if all passed simply complete the task
via the object model.


Badge +1

Hi Reiner,


 


I am not very technical. Can you elaborate on the Runtime object model and how that would work in K2. Can you provide examples of that?


 


Thanks


Sundeep.

Badge +1

How can we access the runtime object model through K2? Do you have any examples of this?

Badge +4

Hi Sundeep,


Renier is referring to actioning a worklist item from code, using the runtime API, to complete the task. Here's an example of doing that:


http://help.k2.com/helppages/k2blackpearlDevRef4.6.2/Working_with_a_Process2.html


Based on your scenario, it sounds to me like what you should do is set an action/outcome on your activity. The action can be "Complete" or "Save". There will be two lines coming from the activity. These lines each have a line rule that checks your field. If your field does not contain what you're looking for, this line can loop back into the activity and re-assign the task. The other line will have the opposite condition and continue as needed.


HTH,


Tyler

Reply