Skip to main content

Hello K2 experts,


I am a beginner and like to clarify some basic concepts, it would be great if someone can help to explain:


 (1) Is a kprx file representing a K2 workflow? How can we trigger a workflow then from a calling module? Is calling the WorkList Item's Action.Execute the only way to trigger it?


(2) When we mention "Outcome", does it mean the result of rules evaluation?


(3) At the last node of workflow, the workflow ends, but is there a concept for the "return value" of the workflow? If such concept is not appropriate but the workflow is supposed to return a status, what can be the mechanism to return something to the caller or the module that triggers the workflow?


Many thanks in advance.


Thanks! 


 


 

Answers below:

 (1) Is a kprx file representing a K2 workflow? How can we trigger a
workflow then from a calling module? Is calling the WorkList Item's
Action.Execute the only way to trigger it?

Yes, the KPRX is the project file that contains the workflow definition as designed in Visual Studio (or other process designers).  How you interact with the workflow at run time can depend on what type of workflow you've developed (ASP.NET based, InfoPath, SharePoint...), but in the end they all use the SourceCode.Workflow.Client API in some fashion to kick off a process (Connection.StartProcessInstance()) or respond to a task (Action.Execute()).


(2) When we mention "Outcome", does it mean the result of rules evaluation?

Yes... generally it means the results of evaluating the Actions as submitted by the destination user(s) for that worklist item.


(3) At the last node of workflow, the workflow ends, but is there a
concept for the "return value" of the workflow? If such concept is not
appropriate but the workflow is supposed to return a status, what can
be the mechanism to return something to the caller or the module that
triggers the workflow?

No, there really isn't any concept of a return value built in.  Generally this is accomplished by storing what ever it is you need back in a database somewhere and then retrieving the data from there.  Alternatively if you simply looking for some workflow metadata you can also leverage the out of the box K2 reporting smartobjects (see here for more detail: http://k2underground.com/blogs/fromthebench/archive/2008/06/02/how-to-retrieve-process-instance-reporting-data.aspx).

HTH.


Thanks for the quick response and detail explanation, deeply appreciate it.


Regarding the mechanism to return value from a workflow, is it possible to define events in workflow steps to invoke a web services (or calling an object) to "inform" the calling module on the return status? Because even if we use database as a storage, to avoid repeatly polling the database, it would be good to have an alternative that uses a call-back approach. 


Yes you can call a web service from within a K2 process.  You have a couple of options:

1.  Invoke the web service directly by adding a web reference and then calling from within a server event (http://k2underground.com/forums/thread/21550.aspx).

2.  Utilize the Web Service Service Broker (http://k2underground.com/k2/ProjectHome.aspx?ProjectID=45) to create a SmartObject, then use the SmartObject Event Wizard within the process.

HTH.

 


Reply