Create Workflows
Prerequisites
If Workflow Composer is configured to connect directly to the database, Insert and Update permissions for the following database tables are required:
- WorkflowDefinition
- WorkflowDefinitionVersion
The permissions are required for the logged in user when using integrated security and for the login credentials (username and password) specified if installing via Installation Manager and integrated security is not used.
Also ensure that you have installed the Activities and Contracts packages applicable to your environment. For more information, see Package Manager.
Workflow Types
Workflow Composer can be used to create the following workflow types:
Sequence
- Most common type of workflow.
- Executes a set of child activities according to a single, defined ordering.
Flowchart
-
Typically used to implement non-sequential workflows but can be used for sequential workflows if no FlowDecision nodes are used. Flowchart components include:
State Machine
-
Allows you to model your workflow in an event-driven manner.
-
Typically used for human workflow scenarios.
-
A state machine can be in one state at any particular time.
- Initial State – represents the starting point of the state machine.
- Final State – represents the completion of the state machine.
- Transition – a directed relationship between two states which represents the response of the state machine to an occurrence of an event.
- Transition Action – an activity executed when performing a transition.
- Entry Action – an activity executed when entering the state.
- Exit Action – an activity executed when exiting the state.
- Trigger – a triggering activity that causes a transition to occur.
- Condition – a constraint which must evaluate to true after the trigger occurs for the transition to complete.
State machine workflow are used with Forms Builder. See help for Forms Builder 3.x.
Basic Workflow Example
In this example, we will create a workflow for a Saved event on the Person entity. The event occurs when the Save button is clicked on the Student Master form of Anthology Student. This workflow sets a value for a specific field whenever a Student record is saved.
-
On your desktop, double-click to start the Workflow application.
-
Click . The New Event Driven Workflow window is displayed.
-
In the Entities area:
-
Click next to Cmc.Nexus.Contracts.
-
Click next to Cmc.Nexus.
-
Click Person (Person).
-
-
In the Events area, click Saved (SavedEvent).
-
In the Name field, specify a Name for the workflow definition and click OK.
The New Event Driven Workflow window is closed and the name of the workflow, PersonSaved in our example, is displayed at the top left of the Designer pane and in the Properties pane. The Sequence flow is displayed in the center of the Designer pane.
-
In the Toolbox, under Control Flow, select the If activity and drag it into the sequence.
-
In the Condition field, specify the following VB expression: entity.HasChanged()
Refer to Helpful Hints to learn more about the purpose of this condition.
-
In the Toolbox, under Primitives, select the Assign activity and drag it into the Then branch of the If condition.
-
In the To field of the Assign activity, type entity..
Note: When the period is entered, an IntelliSense completion list displays all properties that can be associated with the selected entity in the Anthology domain (). Icons indicate the property type, e.g.:
Fields Methods Events -
In the value field of the Assign activity, enter a VB expression. Type entity. and select a property from the drop-down list. In our example, we want to use the Nickname property to assign the string "Gator" to the Nickname field.
Notes:
-
When you define a VB expression in the workflow, click the ellipsis button in the Properties pane next to the field to which the expression applies. The Expression Editor window is displayed. This enables you to view each expression and also provides the drop-down lists for valid options.
-
While you are creating the expressions, the hosted compiler validates expressions. Errors are marked with in the Sequence and in the Expression Editor. Detailed information about the errors is displayed in the Error tab at the bottom of the Designer pane.
-
-
In the Toolbox, under Cmc.Nexus.Workflow, select the SavePerson activity and drag it into the sequence.
-
In the Properties pane of the SavePerson activity, type entity in the Person field.
-
Click Save in the File section of the Home tab to store the workflow definition in a local file system if you are not ready to publish it.
-
Click Publish in the Server section of the Home tab to save the workflow definition in the SQL Server database and publish it to the server that runs the workflows.
Note: The Windows Service NextGen Nexus Event Workflows handles the workflow events. The service must be running on platform that hosts the application.
-
To verify the workflow, in Anthology Student, open a Student Master form. Edit the form to remove any data from the Nickname field.
-
Click Save and verify that Gator is displayed in the Nickname field.