Writing Custom Code in workflows when using K2 for Visual Studio

When using K2 for Visual Studio to build K2 workflows, it is possible to write your own custom code by using the Default Server Event Wizards, or by accessing the code generated for a workflow and modifying that code.

This section describes how to write custom code in server events in a workflow. Developers can write their own code in K2 workflows using the Default Server Event (Code) or Default Server Event (WF) K2 event templates, or can modify the code in any workflow item by using the View Code option for components in the workflow design such as lines, activities, events, escalations, exceptions.

This capability allows developers to create or modify code so that the workflow does exactly that they need it to do – they are not limited to the standard functionality provided by K2 wizards

You can only write code in server events when using K2 for Visual Studio. Other workflow design tools like K2 Studio and the web-based workflow design tools do not offer a code editor and therefore will not allow you to access the code behind server events. However, you are able to create a process in K2 Studio, save it, then open the process in K2 for Visual Studio and write custom code, save the process and then open and continue editing the workflow with K2 Studio again. Your code customizations will still exist, but cannot be modified by the K2 Studio design tool.

K2 blackpearl Developers Reference4.7
Video Links Learn Support
No videos found for this article
K2 on YouTube
No Additional links found for this article
No self-learning content for this article
Try some scenarios...
No relevant support links available for this article