User interface windows
Workflow definitions dialog
The workflow definitions dialog lists all the workflow definitions saved in the database. You can open it by using TWorkflowUserInterface component:
WorkflowUserInterface1.ShowWorkflowDefinitionsDlg;
A windows like this will open:
In this window you can add, edit and delete workflow definitions. Buttons available:
Add: Adds a new workflow definition to database.
Edit: Opens the workflow definition editor to edit the selected item.
Delete: Removes the workflow definition from the database
Refresh: Updates the list of workflow definitions from the database
Run new: Creates and runs a new workflow instance based on the selected workflow definition.
Workflow definition editor
The workflow definition editor is where you create and edit workflow definitions. You can open it to edit a workflow definition by using TWorkflowUserInterface component:
WorkflowUserInterface1.EditWorkflowDefinition(MyWorkflowDefinitionObject);
A windows like this will open:
In the workflow definition editor you can do several tasks. Below are the most common ones:
Adding objects to diagram
To add objects to diagram, click one of the objects in the object toolbar, and then click in the diagram at the position you want the object to be inserted (or press the mouse button, move the mouse and release the button, to insert the object with a specified size).
Creating transitions between objects
You can create a transition between block by choosing one of the transitions types in the transition toolbar:
If a transition type is already selected (button pressed), you don't need to reselect the transition type every time you want to create a transition.
Once a transition type is selected, press the mouse button in any link point of the source block (a link point is the blue "x" displayed in the diagram object), drag the mouse, and then release the mouse button in any link point of the target block. A transition will be created connecting the source block to the target block.
Changing visual appearance of diagram objects
You can change visual appearance of diagram objects by using some options in the menu and/or the toolbars. You can change background color, border color, border style, brush style, pen width, font, and more. The appearance of diagram objects do not affect the way the workflow definition will behave, it's just for visual purposes.
Saving
Once the diagram is built, save it by choosing the menu option File | Save, or pressing the save button in the toolbar.
Workflow definition options
Using the menu Workflow, you can click one of the submenu options to define some specific options for the workflow definition, like workflow variables and workflow attachments.
Workflow validation
By pressing Ctrl+F9 or choosing menu option "Workflow | Check Workflow", you invoke the workflow definition validator which will check for problems in the workflow. If there are any issues with the workflow definition, a panel with errors and warnings will be displayed at the bottom of editor:
Other operations
The workflow definition editor also provides:
- preview/printing capabilities;
- clipboard operations;
- diagram navigator;
- top and left rulers;
- grid;
- and other features.
Task list dialog
The task list dialog is the main window for user interface. It displays all the task instances assigned to an user or to a specific workflow instance. In a production environment, this dialog will be used daily by users to check the pending tasks for all current business processes.
To open the task list dialog, use the TWorkflowUserInterface component:
//Shows all tasks assigned to the user 'scott'
WorkflowUserInterface1.ShowUserTasksDlg('scott');
//Shows all tasks assigned to users scott, tina and john
WorkflowUserInterface1.ShowUsersTasksDlg('scott,tina,john');
//Shows all tasks created from a specific workflow instance (key 29)
WorkflowUserInterface1.ShowWorkInsTasksDlg('29');
Note that you must pass the user id to the function, not the user name. To make the example above more clear, we considered that the user name is also the user id.
The following window will open:
Task list view
The task list view shows all the pending tasks for the user (it can also show closed tasks by using popup menu View | Show all tasks). The information displayed is:
Key: The unique id for the task.
Name: The name of the task definition which generated the task.
Workflow: The name of the workflow definition which generated the workflow instance which the task belongs to.
Subject: The subject of the task, as specified in the task definition.
Status: Current status of the task.
User: The user which the task is assigned to.
Task tab
The task tab shows the details of the task selected in the task list view. It shows the subject, the description of the task and the current status of the task.
Users can change the status by changing the combo value.
Workflow tab
The workflow tab shows the workflow diagram and in which situation the diagram is, related to the selected task in the task list view. It's the status of the workflow instance, not the task status. In general, if a task is opened, the workflow diagram is in a task block, because the task block waits for the task to be completed.
Fields tab
The fields tab shows the available fields for the current selected task. The fields are defined in the task definition properties.
Here users can see the value and also change the value of fields (if the field is not read-only).
Are mentioned in the task definition properties section, field values are read and written from/to workflow variables.
Fields marked with an asterisk (*) are required, and users cannot save changes to the task until such fields are filled.
Attachments tab
The task list dialog shows a tab for each attachment in the workflow instance. In the screenshot below, a single attachment named "Attachments" was created, that's why the tab is named "Attachments". But you can have as many tabs as the number of attachments defined.
In each attachment tab you can add, remove, open and also edit attachments (depending on the attachment permissions defined in the task definition properties). You use the buttons at the right to perform these operations. You can also drag and drop files to the attachment area to add new attachment files.
The changes made to the attachment files are only saved when the user clicks the "Save changes" button.
Log tab
The log tab shows all operations performed in the task by users. It's a log view where you can see when the task was created, updated, finished, and which user did that. The log also shows the status changes of the task.