Create a new .NET Action to implement custom functionality
- (page 1 of 6)
This "how to" shows you how to create a new workflow Action in .NET.
It discusses the structure of an Action and the design considerations when creating a new Action. A walkthrough of the development process is then given with examples in C# (although any .NET language may be used), and the process of deploying and testing the finished Action is shown.
In order to illustrate this process, we will build a simple synchronous action to send an email. In order to see a more complex action see
task type how to, which implements a asynchronous, user action.
It is assumed that the reader has a good knowledge of C# or another .NET language.
Structure of an Action
Each action defines:
  | | A set of properties through which the user specialises the behaviour of the action when the workflow is being designed. As an example, a Mail action may have properties for the To, Subject and Body fields of the e-mail. Properties are stored in the activity definition in the workflow using content entry. |
  | | A set of named results that define the different transitions that may occur from this action. For example, a Yes-No question will have two transitions, corresponding to the "yes" and "no" results of the question. Every action must have at least one transition. |
  | | The behaviours for starting the action, handling responses and aborting the action. |
Actions are written by implementing the Ant.Workflow.Action interface and then registering the action in the hierarchy.