Skip to main content
All CollectionsWorkflow ManagerCreate a Workflow Trigger in a Project
Create a Workflow Trigger for Files in a Project
Create a Workflow Trigger for Files in a Project

This article helps you understand how to create a workflow trigger for files in a project.

Updated today

Pre-requisites:

  • You must have the 'Manage Workflow Rules' role privilege on the project where a workflow trigger needs to be created.

The steps to create a workflow trigger event on a document are as mentioned below:

You can configure a workflow trigger for files immediately after publishing a workflow from the workflow designer. You will receive a prompt message stating, 'Do you want to configure a Trigger now?'. Click the 'Yes' option and follow the steps below from step number 3 onward.

1. Navigate to the 'Workflows' tab and select the project.

2. Click the 'Create Trigger' button at the top right.

Alternatively, right-click on the project name and select the 'Create Trigger' option.

3. Enter the required details for all the mandatory fields in the 'Configure Trigger' screen:

3.1. Name - Name of the trigger.

3.2. Priority - Only one running workflow is allowed on a document at any time. Below are the key factors to be considered while setting the priority of a workflow:

  • A new workflow can only commence on a document once the previous workflow has been completed.

  • The 'Priority' field determines which trigger takes precedence when multiple triggers have matching conditions. The triggers with a higher priority will be kicked off first, followed by those with lower priorities, which will be triggered sequentially.

  • All the triggers configured with the system task event will execute, while only one trigger with the workflow definition event will execute.

  • If multiple triggers have matching conditions and priorities, then any one of them will get kicked off. If this particular trigger fails, the next trigger with a matching condition will be initiated immediately.

  • In the 'Pre' task mode, only one trigger will execute with higher priority, regardless of the number of triggers with matching conditions.

3.3. Description - A brief description of the trigger to be created.

3.4. Context - Select 'Document' as the trigger context.

3.5. Trigger Conditions - You can establish various trigger conditions using 'AND' / 'OR' (logical operators). Workflow triggers for project files can be created based on a combination of folders, purpose of issues, document status and configurable attributes set up within a project.

The rule is the single logical statement derived from the conditions defined by the user.

The trigger is executed based on this statement under different matching conditions. You can see the actual rule (statement) that will get applied based on the conditions defined for workflow trigger just like below:

Different brackets and text colours used to present the 'Applied Rule' can help you understand how the workflow trigger would get applied based on the conditions entered, regardless of the complexity of the rule.

Working of logical operators:-
------------------------------------------------------------------------------------------------------------------
<Condition 1> <logical operator (AND)> <Condition 2>

Description:- For 'AND' logical operator, both conditions must be satisfied (true).

<Condition 1> <logical operator (OR)> <Condition 2>

Description:- For 'OR' logical operator, any condition should be satisfied (true).

------------------------------------------------------------------------------------------------------------------

If I want the workflow to trigger when any revision is published in the folder named 'Architecture' having the status 'Design Draft', I need to select:

Condition One: Folder is equal to 'Architecture' AND


Condition Two: When the file status is 'Design Draft'

You can use a combination of logical operators to cover a business process.

Example

<Condition 1> <logical operator (AND)> <Condition 2> <logical operator (AND)> <Condition 3> <logical operator (OR)> <Condition 4>

Description: The above scenario should work as:

{( <Condition 1> <logical operator (AND)> <Condition 2> <logical operator (AND)> <Condition 3>) <logical operator (OR)> <Condition 4>}

If I want the workflow to trigger when any revision is published in the folder named 'Architecture' with the purpose of issue as 'A' or 'B' and when the file's status is X or Y...

Condition One: When the purpose of the issue is 'A' OR


Condition Two: When the purpose of the issue is 'B' AND

Condition Three: When file status is 'X' OR


Condition Four: When file status is 'Y' AND

Condition Five: The Folder is equal to 'Architecture'
Interpreted As: (poi=A OR poi=B) AND (status=X OR status=Y) AND (folder=Architecture) - Correct Way

The system automatically uses parenthesis (brackets) starting from the left for the same logical operator.

The logic for the parenthesis is as below:

Start with an opening bracket for the initial field. You must not close the bracket until you encounter the same operator. When the operator changes, close the bracket and start a new bracket.

Example

A = 2 or A = 4 and C = 3 or C = 5 and B = 1 will be interpreted as (A = 2 or A = 4) and (C = 3 or C = 5) and (B = 1)

Suppose the workflow has to be kicked off when the user publishes a document in folder 'A' having either document status as 'S1' or purpose of issuing file as 'P1', then the same has to be configured as mentioned below:

Folder == A AND Status == S1 OR POI == P1 - Interpreted as (Folder ==A AND Status == S1) OR (POI == P1) - Wrong way

Status == S1 OR POI == P1 AND Folder == A - Interpreted as (Status == S1 OR POI == P1) AND (Folder == A) - Correct way

The folder name is kept as 'Design' and the document status as 'Review' for explanation.

1) Folder == Design AND Status == Review

If both conditions are satisfied, the workflow should be triggered immediately.

2) Folder == Design OR Status == Review

If any condition is true, then the workflow should be triggered.

3) Folder == Design AND Status == Review OR POI == For Acceptance

System uses braces as {(Folder == Design AND status== Review) OR (POI == For Acceptance)}

In this scenario, workflow will be triggered only if either (Folder == Design AND Status == Review) is true or (POI == For Acceptance) is true.

(If you want the design folder to remain common, then first the conditions need to be added for document status and purpose of issue, and then use the folder condition with AND operator at the end, i.e. Status == Review OR POI == For Acceptance AND Folder == Design)

Click here for detailed help on how to use independent system tasks.

3.6 Trigger Event - Select the appropriate event which should trigger the workflow (as configured by the user). Trigger events for files can be:

3.7. Task Mode - Select the task mode, either 'Pre', 'On-Load' or 'Post' for which this trigger will be used.

  • Pre - An event occurring before the desired event is completed, such as publishing a file or creating a form. System tasks with 'pre' task mode can only be created using Groovy scripts. 'Pre' task mode is currently available for the following events:
    Publish Documents, Edit Attributes, Download Document, Print Document, View Document

  • On-Load - An event executed just before the event-specific page or screen loads in the user interface, i.e. edit status page load or download document page load. System tasks with on-load task mode can be created using Groovy scripts only. On-load task mode is currently available for the following events:
    Publish Documents, Change Status, Edit Attributes, Download Documents, Create Discussion, Create Discussion Reply, QR Code Scan

  • Post - An event executed after the desired event is completed, such as publishing a file or creating a form. 'Post' task mode is currently available for the following events:
    Publish Documents, Change Status, Static Link, Edit Attributes

3.8. Task Type - Select the type of task to be performed based on the selected trigger event and task mode.

3.9. Task - Choose the appropriate system task if this trigger is for an independent system task or select the relevant workflow definition if this trigger is for a workflow.

4. Click 'Create' to create a trigger event for the workflow for files in a project.


Check: FAQs


Did this answer your question?