Asite Visual Workflow enables users to configure and control interface options on the edit file status function. Click the links below to access their detailed help:
A. Configure Edit Status Page
Users can configure a workflow to control the values available for updating the status and configuring options such as 'Create Discussion Automatically', 'Mark Document Revision as Private', 'Clear own/all users’ incomplete tasks on revision', etc.
Workflow provides flexibility on the visibility of setting options based on the selected status’s value and the default status to be changed.
Workflow can be configured by following the steps below:
1. Pre-requisites
To set up the edit status page, the necessary attributes must be present in the project.
Click here to learn how to define the purpose of issuing files in a project.
Click here to learn how to define file statuses in a project.
Click here to learn how to define custom attributes in a project.
2. Configure System Task
Select your desired project and ‘Configure System Task’ with the following details:
Name - Enter the system task name.
Task Context - Select the context type as ‘Document’ from the dropdown.
Task - Select task ‘Execute Groovy Script’ from the dropdown.
3. Configure Groovy Script
You can set up the following Groovy script according to the required results and add it to the newly created system task. The following configurations can be included in the Groovy script:
Availability of values within the edit status page
The default status value to be selected
Availability of setting options based on selected values
Manage setting options based on values - visibility, allow editing or not
|
The above-mentioned groovy script is divided into logical sections as mentioned below:
Script | Description |
| This script section defines the attributes used for the combination in the Groovy script. It can include standard and custom attributes. (In the case of the custom attribute, add the script to fetch the list of custom attributes (Click here for reference), then define the custom attribute’s name.
Create an alias name and attribute function to retrieve the values of the defined attribute, sample format is as mentioned below,
String <<Alias Name>> = document.get<<Attribute Name>>(); String <<Alias Name>> = document.get<<Attribute Name>>();
In script code, the given attributes are used for retrieving the value:
poi = Alias name document.getPurposeOfIssue = To retrieve the values of the purpose of issues from the project
status = Alias name document.getStatus = To retrieve the values of statuses from the project |
| This function is used to define the list of setting options.
The following are the options added in the sample script: 1. Create a discussion automatically 2. Mark document revision as private 3. Mark all users' outstanding tasks on this document revision complete (except 'For Comment Incorporation') 4. Mark all my outstanding tasks on this document revision complete (except 'For Comment Incorporation') 5. Update the status for Static Links, and Dynamic Links will always be updated. 6. Reason for Status Change
This section of the script is not to be edited and is to be used as is.
|
| This script section defines the configuration options for the above-mentioned setting options. Within the Groovy script, the user can use appropriate options from the given sample script:
PUBLIC = 0, Mark all selected documents as public PRIVATE = 1 Mark all selected documents as private. RETAIN_EXISTING =2 Retain existing access level.
EDITABLE = true, the system allows editing the option
NON_EDITABLE = false, the system is not allowed to edit the option
CHECKED = 1, the default option is displayed as enabled (Checked) UNCHECKED = 0, the default option is displayed disabled (unchecked)
VISIBLE = true, the system displays an option on the interface HIDE = false, the system doesn't display the option on the interface
This section of the script is not to be edited and is to be used as is. |
| This section of the script defines the combination of values from the attributes defined in the above script.
The script can be created by adding alias names of one or more attributes, defined in the above script, with the attribute’s value.
Or and & conditions can be used to create a combination. The format of the script is as mentioned,
if( ( <<Attribute’s Alias Name>>.equals(“<<Attribute’s value1>>”) || <<Attribute’s Alias Name>>.equals("<<Attribute’s value1>>") && <<Attribute’s Alias Name>>.equals("Attribute’s value1"))
In the given sample script, poi = Attribute’s alias name defined in the script above (“S1”), (“S2”), (“S3”), (“S4”), (“S5”), (“S6”), (“S7”), = Values created within purpose of issue of the project || = OR condition to create the combination of values && = AND condition to create the combination of values status = 2nd Attribute’s alias name defined in the script above (“For Sharing”) = Values created as file status in the project. |
| This section of the script defines, 1. The default selected status when the user opens the edit status page. 2. Availability of status values to select from the dropdown of the edit status page. 3. Default configuration of setting options based on the selected value. 4. Configuration of setting options based on the selected value.
The format of the script is mentioned below,
statusOptions.addProperty("<<status_name", "<<Please select/Status value>>"); JsonObject selectedFilterObject = new JsonObject(); setStatusOptions(<<Setting Option’s name>>, <<Configuration option 1>>, <<Configuration option 2>>, selectedFilterObject); setStatusOptions((<<Setting Option’s name>>, <<Configuration option 1>>, <<Configuration option 2>>, selectedFilterObject); In the given sample script, 1. For the availability of values while opening the edit status page, statusOptions.addProperty("status_name", "Please select"); Added value = Please select, Shared 2. To set the default selected value statusOptions.addProperty(IGroovyConstant.SELECTED, true); true = Selected value is displayed by default false = Selected value is not displayed by default. The value will be available in the dropdown. 3. Setting options and their configuration setStatusOptions(createDiscussionAutomatically, EDITABLE, CHECKED, VISIBLE, selectedFilterObject); Setting Options = createDiscussionAutomatically, markAllUsersOutstandingTaskComplete, markAllMyOutstandingTaskComplete MarkDocumentRevisionasPrivate, updateStatusForStaticLink Configuration options = Editable, NON_EDITABL, CHECKED, UNCHECKED, VISIBLE, HIDE
|
| This script defines the alternate combination of the attribute’s values when the above-mentioned does not match.
The process of defining the condition is the same as the first one. Refer <<Link if condition section>>
The format of the script is as mentioned,
else if ( ( <<Attribute’s Alias Name>>.equals(“<<Attribute’s value1>>”) || <<Attribute’s Alias Name>>.equals("<<Attribute’s value1>>") && <<Attribute’s Alias Name>>.equals("Attribute’s value1"))
In the given sample script, poi = Attribute’s alias name defined in the script above (“A0”), (“A1”), (“A2”), (“A3”), (“A4”), (“A5”), (“A6”), = Values created within purpose of issue of the project || = OR condition to create the combination of values && = AND condition to create the combination of values status = 2nd Attribute’s alias name defined in the script above (“For Publishing”) = Values created as file status in the project. |
| This section of the script defines functions for the following configuration, as defined for the above combination. 1. The default selected value of status when a user opens the edit status page 2. Availability of status values to select from the dropdown of the edit status page 3. Default configuration of setting options based on the selected value. 4. Configuration of setting options based on the selected value.
The format of the script is the same as mentioned for the above combination.
In the given sample script,
1. For the availability of values while opening the edit status page, statusOptions.addProperty("status_name", "Please select"); Added value = Please select, Published
2. To set the default selected value statusOptions.addProperty(IGroovyConstant.SELECTED, true); true = Selected value displays by default selected false = Selected value doesn't display by default. The value will be available in the dropdown.
3. Options and configurations are the same as above.
|
| This section of the Groovy script returns the logical values to the system and is used to display the response.
This section of the script is not to be edited and is to be used as is.
|
4. Create Trigger
Once the system task is configured, create a new ‘Trigger’ on the selected project with the following details:
Add Details - Add all the trigger details, including name, description, priority and conditions with the context as ‘Document’.
Condition - Folder/Status/POI on which the trigger can be invoked.
Event - Select the trigger event as ‘Change Status’.
Task Mode - Select ‘On-Load’ as the task mode. (On-load mode allows the user to edit the status and available setting options on the user interface.)
Task - Select the name of the above-created Groovy script.
This will invoke the configured system task when the condition is matched and the user tries to update the status for the selected file.
B. Example
Folder Name - Drawings
Purpose of Issue - A0, A1, A2, A3, A4,A5, S1, S2, S3, S4, S5
Status - For Sharing, Shared, Rejected, For Publishing, Published
Trigger condition - Folder: Drawing and Status = For Sharing
The system task is created with the following Groovy script:
|
In the above 'Drawing' folder, a drawing is uploaded with the POI as 'S1' and status as 'For Sharing'. The privileged users can go to the 'Files' tab, right-click on the file name and select 'Edit > Status' to update the status as per the Groovy script and options.
Output
The default screen and availability of options based on the combination:
By selecting the status value as ‘Rejected’, the ‘Create discussion automatically’ option will get unchecked as defined in the script:
Next Article: Rename Files using Custom Attribute Values