Pre-requisites:
Required role privilege 'Manage Workflow Rules' on the project where a workflow needs to be created.
Steps to create a new form workflow are mentioned below:
1. Navigate to 'Workflows' tab and select the project in which a new workflow needs to be created.
2. Click on 'Create Workflow Definition' button to start creating a new workflow.
Alternatively, right click on project name and select 'Create Workflow Definition'.
3. Capture required details in mandatory fields and click on 'Create' to create a new workflow record.
Workflow Name - Name which you want to give to the new workflow.
Description - Capture a brief description about this new workflow.
Workflow Context - Select 'App' as workflow context.
App Type - You will be required to choose a form type. Active form types will be available as a dropdown. Controller based form types are not supported in workflow. For any non controller based form that was converted to controller based after the workflow was configured, workflow won't execute for that particular form type.
Total Workflow Days (Optional) - Total length of the workflow in number of days.
4. Once you click on 'Create', the visual workflow designer screen will appear. Various shapes and tools will appear as mentioned in step 4 in 'Create Workflow for Files'.
5. Example Scenario
Let us create an example workflow using the above shapes as per below mentioned scenario:
5a. Workflow starts when a new form is created.
5b. System has to change the status of newly created form automatically to 'Ready to Respond'.
5c. Workflow ends when form recipient responds to the form within 3 days.
Steps to create workflow as per above example:
5.1. Drag and drop the 'Play' shape onto drawing board to start creating a new workflow. This is the starting point of workflow.
5.2. Drag and drop a connecting object (arrow) coming out from the start event.
5.3. Add a new system task which is connected with the start event using the connecting arrow mentioned above.
5.4. Once the new system task is added, you need to configure properties for the same.
Name - Key in a name for this system task.
Description - Enter a brief description about this system task.
Task Type - Select a task type you want system to perform. In this example workflow, it will be 'Status Change'. (It is assumed here that there is already a system task created for 'Status Change' task type in selected project.
In case there are no system tasks created in advance, you won't be able to set the 'Task' property leading to a validation error while trying to publish the workflow.
Click here to understand how to create system task.
See below for a list of supported system tasks:
Context | Supported System Tasks |
App | Distribute Apps Execute Groovy Script Email Notification Status Change Clear Tasks |
Task - Based on the selected task type, a popup will appear. Select a 'Config Name' which corresponds to the selected task type.
5.5. Similarly add a new user task for form recipients to respond to the form and configure its properties using 'Respond' task with 3 days time. This user task should be connected with the 'Status Change' system task using the connecting arrow. Only 'Respond', 'Assign Status' and 'Distribute' tasks can be available in user task while creating form workflow definitions at present, based on form settings.
Name - Key in a name for this user task.
Description - Enter a brief description about this user task.
Task - Select the task you want the user to perform. In this example workflow, we will be selecting 'Respond' task. See below for a list of supported user tasks (applicable based on form settings):
Context | Supported User Tasks |
App | Respond Assign Status Distribute |
To - Select the user who needs to perform above task. You can select multiple users as well. In this example workflow, select the name of users who should respond on the form.
Roles and organizations can be selected instead of individual users if task needs to be assigned to multiple users.
Views - Select an form view that should be available to the user while performing 'Respond' task. The form views will only be available based on views created in concerned form template.
Due Days - Specify number of days you want to give to the user to complete given task, please key in 3D if you want to give 3 days of time.
Workflow Transition Condition - Select appropriate option from the dropdown.
Wait for all users to complete task - Workflow will halt until all selected users have completed the tasks assigned to them.
Proceed after any one person completes task - Workflow will start progressing the moment at least one user completes task.
5.6. Drag and drop an end event and connect it with 'Respond' user task i.e. output of the user task is input of end event.
5.7. Now the workflow is fully configured & you need to save it by clicking on the 'Save' button at top left. Completed workflow is shown in image below:
5.8. In case you are using a flow condition, below is a list of supported parameters:
Context | Supported Parameters in Flow Condition | Actual Name in Flow Condition | Supported Values |
App | App Status | status | Auto populated |
| Dynamic ADecision Variable | dynamicADecisionVariable | 1 to 99 (Numeric) |
6. System will give a prompt if the workflow needs to be published now or later, workflow once created needs to be published in order to be able to run it.
Click on 'Yes' to publish the workflow or click on 'Later' if you wish to publish it later.
7. Clicking on 'Yes' to publish the workflow, you will be prompted to create a trigger event for this workflow.
8. Click 'Yes' to configure a trigger event for this workflow. Click here to understand how to create a trigger event.
9. Once the trigger event is configured, the workflow is ready to use and it will start working the moment trigger event occurs.
As per the scenario mentioned in above example workflow, status of any newly created form will be changed to 'Ready to Respond' automatically based on the system task configured. The form will then be distributed to recipient with a 'Respond' task assigned and 3 days time to complete the task. Once this task is completed by the recipient user, the workflow ends.
For any form on which a workflow is configured and you perform any activity on it which is other than the workflow, form would behave as per the design and settings which are configured on it. For e.g. On a RFI form, workflow is configured to issue respond task to user A and B but if user C tries to respond (because form settings allow C to respond) then user C will get default 'Respond View' of RFI instead of any particular view which user A or B would get to see while responding.
Note: A maximum of 2000 workflow definitions are allowed to be created on a single project or a single project template. This can include workflows of all types including files, forms and custom objects.
Next Article: Create a Workflow for Custom Objects (in a Project)