Activities

Building custom activities

Code Activities

If new activities are needed these may be developed as code activities based on the activity classes provided in Windows Workflow Foundation.

Normally, activities are subclassed from CodeActivity or CodeActivity<T>. Both activites do the main work in an overridden function:

protected override void Execute(CodeActivityContext context)

If the activity needs to access information from the WorkZone Process datamodel it is done through calls to the OData service provided by WorkZone Content Server 2014.

The WorkZone Process Workflow Host exposes OData through a WorkflowHostExtension which makes the job easier for the activity developer.

To get an ODataService, use the following code:

ODataService ctx = context.GetExtension<WorkflowHostExtension>().ODataContext();

The ODataService is per default impersonated to the calling user. If, for some reason, you want to access registers and avoid the normal access code protection, you can get an ODataService which is not impersonated but runs as the user which is used by the workflow host:

ODataService ctx = context.GetExtension<WorkflowHostExtension>().ODataContext(false);

Phase activities

In WorkZone Process 2014 R2 HF01 you have the following options for configuring phase activities.

Configuring phase names in multiple languages

Configuring Phase Start Time and End Time logic

  • Duration in Days
  • Relative Deadlines

Configuring phase events

You can configure phase events on:

  • Start
  • Exit
  • Restart
  • Near Due
  • Due

Configuring several sub processes for each event. The events will be executed in sequence of configuration.