Skip to main content

Hi everyone.


I'm a total K2 newbie and I need some help on something that's probably very basic, but despite my googling and searching this forum, can't seem to find an answer to.


I've created a Default Server Event (Code) and I see I have access to a 'K2' object in the Main method. I have 10 possible lines leading out of the activity containing the Default Server Event and I want to programmatically select which ones to traverse based on some information I get from a web service.


So my question is in a nutshell: How do I tell the activity to take a line to the next activity from within the Default Server Event programmatically?


Thanks for helping a newbie out!

Ok, I think I can help you out here. What I think you would want to do here instead of a server code event is to use a "Code Reference Event" to call your web service and get the results stored in a data field on your activity. Then, each line coming out of your activity can look at the value in that data field (via line rules) to determine if that is the path to take. Before you can invoke your web service via Code Reference Event, though, you have to add a "Process Reference" to it - you'll find that wizard in the upper right corner of your process design canvas (the Icon has a tooltip that reads "Process References").


I hope I wasn't being too vague... give it a shot and let me know if you get stuck on something.


No, that's perfect. I just needed a conceptual idea of how that would work and your answer makes sense.


Thanks for your help!


Reply