Asite Visual Workflow enables users to configure and control interface options on the edit file status function. Click on the below links 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 available options such as 'Create Discussion Automatically', 'Mark Document Revision as Private', 'Clear own/all user’s incomplete tasks on revision', etc.
Workflow provides flexibility on the visibility of setting options based on selected status’s value and default status to be changed.
Workflow can be configured by following below steps:
1. Pre-requisites
In order to configure edit status page, Required attributes should be available on the project.
Click here to understand how to define purpose of issues in a project.
Click here to understand how to define file statuses in a project.
Click here to understand 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 system task name.
Task Context - Select context type as ‘Document’ from the dropdown.
Task - Select task ‘Execute Groovy Script’ from the dropdown.
3. Configure Groovy Script
Configure following groovy script as per the required results and add within newly created system task. Following configurations can be included in groovy script:
Availability of values within edit status page
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
|
Above mentioned groovy script is divided into logical parts as mentioned below:
Script | Description |
| This part of script is to define the attributes that are being used for the combination in groovy script. User can define standard as well as custom attributes. (In case of custom attribute, add the script of fetching the list of custom attributes (Click here for reference) then define custom attribute’s name.
Create an alias name and attribute function to retrieve the values of 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, given attributes are used for retrieving the value:
poi = Alias name document.getPurposeOfIssue = To retrieve values of purpose of issues from the project
status = Alias name document.getStatus = To retrieve values of statuses from the project |
| This function is used to define the list of setting options, to use in the groovy script.
Following are the options added in sample script: 1. Create discussion automatically 2. Mark document revision as private 3. Mark all user's outstanding tasks on this document revision complete (except 'For Comment Incorporation') 4. Mark all my outstanding task on this document revision complete (except 'For Comment Incorporation') 5. Update the status for Static Links, Dynamic Links will be updated always 6. Reason for Status Change
This part of script is not be edited, and is to be used as is.
|
| This part of script defines the configuration options for the above mentioned setting options. Within groovy script, user can use appropriate options from the given sample script:
PUBLIC = 0, Mark all selected documents public PRIVATE = 1 Mark all selected documents private. RETAIN_EXISTING =2 Retain existing access level.
EDITABLE = true, system allows to edit the option
NON_EDITABLE = false, system is not allowed to edit the option
CHECKED = 1, default option is displays enabled (Checked) UNCHECKED = 0, default option is displays disabled (unchecked)
VISIBLE = true, system displays option on the interface HIDE = false, system doesn't display option on the interface
This part of script is not be edited, and is to be used as is. |
| This part of script defines the combination of values from the attributes defined in above script.
Script can be created by adding one or multiple attribute’s alias name, defined in above script with the attribute’s value.
Or and & condition can be used to create a combination. Format of 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 given sample script, poi = Attribute’s alias name defined in 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 script above (“For Sharing”) = Values created as file status in the project. |
| This part of script defines, 1. Default selected value of status when user opens the edit status page. 2. Availability of status values to select from the dropdown of edit status page. 3. Default configuration of setting options based on selected value. 4. Configuration of setting options based on selected value.
Format of script is mentioned as 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 open 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 display default selected false = Selected value is not display by default. Value will be available in 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 attribute’s values when above mentioned combination do not match.
The process of defining the condition is same as first one. Refer <<Link if condition section>>
Format of 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 given sample script, poi = Attribute’s alias name defined in 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 script above (“For Publishing”) = Values created as file status in the project. |
| This part of script defines functions for following configuration as defined for above combination, 1. Default selected value of status when user opens the edit status page 2. Availability of status values to select from the dropdown of edit status page 3. Default configuration of setting options based on selected value. 4. Configuration of setting options based on selected value.
Format of script is same as mentioned for above combination,
In the given sample script,
1. For the availability of values while open 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. Value will be available in dropdown
3. Setting options and their configuration are same as for above mentioned combination.
|
| This part of groovy script returns the logical values back to the system. And is used to display the response.
This part of script is not 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 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 trigger can invoke.
Event - Select the trigger event as ‘Change Status’.
Task Mode - Select task mode as ‘On-Load’. (On-load mode allow user to edit the status and available setting options on user interface).
Task - Select the name of above created groovy script.
This will invoke the configured system task when the condition is matched and user tries to update status for 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
System task is created with the below groovy script:
|
In above 'Drawing' folder, a drawing is uploaded with the POI as 'S1' and status as 'For Sharing'. Privileged user can go to 'Files' tab, then right click on file name and select 'Edit > Status' to update the status as per the groovy script and options.
Output
Default screen and availability of options based on combination:
By selecting status value as ‘Rejected’, ‘Create discussion automatically’ option will get unchecked as defined in the script:
Next Article: Rename Files using Custom Attribute Values