Using Custom Windows Workflow (WF) Activities in a K2 Server Event
K2 supports a subset of Windows Workflow (WF, sometimes also called WinWF) toolbox items. The toolbox is filtered to the supported code objects when in the view code mode of a server event. If a custom activity uses a code object that is not supported, that whole custom activity will be unavailable.
For example: Correlation to the WinWF schedule is not supported, since hydration and dehydration are not supported. This excludes all activities that are event driven or that modify the WinWF state - like the Delay activity. As Synchronous execution is required it will fail at runtime, and can cause thread locking, (in which case the process instance would need to be deleted).
Considerations
- A custom WF activity must inherit from one of the items available in the toolbox or from the base Activity class.
- The activity should not suspend or hydrate the workflow schedule.
- Correlation sets are not usable as they are handled by the workflow server.
- The custom WF activity should run from top to bottom (synchronously).