Executing custom code when worklist item is opened

  • 24 April 2015
  • 2 replies
  • 0 views

Badge

Hello,

 

We'd like to be able to execute some custom code using K2 Designer for Visual Studio. We have a client event that spawns a worklist item, and once that worklist item goes from 'Available' to 'Open' (and is therefore locked to a specific user), we'd like to be able to make some changes in a separate SQL table. When looking through the Event Item code, we were unable to find a location that references this condition and were wondering if there was any way we could make this happen.

 

Does anyone have any ideas? Please advise.

 

Thank you!


2 replies

Badge +10

I think this will require some code. There are out of the box webservices that you can use to return if a task is allocated to someone. You can get this value and you can execute your confitional code according to this.  There are some documentation available that will explain what these do in the k2 portal at portal.k2.com if you have membership.

Badge +10

A thought here might be to create a web service that handles your code.  From there, you can wrap the webservice in a smartobject, and then call the appropriate method at that time. 

 

My thought would be, when the user recieves the client event notification, direct them to a form to action the item.  That form, as part of it's "When form is initializing" rule, fires a smartobject method for the web service.

 

You could also do this without custom code now that I think about it using this method.  You could have the initilization of the form trigger a workflow as well to accomplish this.

Reply