What is an Automation Node?
Note: Automation node is an advanced feature and may not be available for your system. For more information, please contact your administrator.
The Automation node is a task within the workflow that allows for custom JavaScript code to be executed when the task is active or becomes in progress. The expressions in the custom code can be used to:
Set certain values such as:
– Changing Sub-Process Names
– Generating Sub-Process Numbers
– Changing Project Numbers
– Custom Field Values
Connect to BLUEConnect Rest Services for more complex updates
– Requires development resources
Who can create or add an Automation node?
The Automation node may be created by any user who has permissions to create a process template. Knowledge of JavaScript would be helpful for advance expression scripting. However, more complex coding may require development resources.
Exploring the Automation node in the process template
The Automation node is used in process templates. It is located under the list of Tasks and is called Automation with this icon
. The Automation node may be anywhere in the workflow and will execute once the previous tasks complete and the automation task becomes active or in progress.

See Task Node Settings for more information on setting up in nodes in a Process Template.

Below is a list of properties that can be read (get) or set when using the Automation node:
Note: If you are copying and pasting expressions, make sure the quotes are the straight up-and-down ones (“) and not the curvy ones (” and ” ) which other programs (like Word) create. The expression will not work with the curvy quotes.
ITEM
|
GET
|
SET
|
PROJECT |
||
Project ID |
project.getId() |
no |
Project Name |
project.getName() |
project.setName (“value”) |
Project Number |
project.getNumber() |
project.setNumber (“value”) |
Project level custom fields (all types) |
project.getCustomFieldValue(“BusinessID”) |
project.setCustomFieldValue(“BusinessID”, “value”) |
Project Description |
n/a |
n/a |
Project Owner |
project.getOwner() |
project.setOwner(“Owner Login Id”) |
Project Owner Group Name |
project.getProjectOwnerGroupName() |
project.setProjectOwnerGroupName(“Owner Group Name”) |
Project Owner Group Id |
project.getProjectOwnerGroupId() |
project.setProjectOwnerGroupId(“Owner Group Id”) |
Project Status |
n/a |
n/a |
Project level date custom field |
project.getCustomFieldDateValue(“BusinessID”, “Date Format”) |
project.setCustomFieldDateValue(“BusinessID”, “value”, “Date Format”) |
Project Company Type Custom Fields |
project.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Project Contact Type Custom Fields |
project.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Project Note Type Custom Fields |
project.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
SUB-PROCESS |
||
Parent Sub-process ID |
subprocess.getId() |
n/a |
Parent Sub-process Name |
subprocess.getName() |
subprocess.setName(“name”) |
Parent Sub-process Number |
n/a |
n/a |
Parent Sub-process level custom fields (all types) |
subprocess.getCustomFieldValue(“BusinessID”) |
subprocess.setCustomFieldValue(“BusinessID”, “value”) |
Parent Sub-process Owner |
subprocess.getOwner() |
n/a |
Parent Sub-process Owner Group |
n/a |
n/a |
Parent Sub-process project path |
subprocess.getProjectPath(“Separator”) |
n/a |
Parent Sub-process date custom field |
subprocess.getCustomFieldDateValue(“BusinessID”, “Date Format”) |
subprocess.setCustomFieldDateValue(“BusinessID”, “value”, “Date Format”) |
Parent Sub-process Company Type Custom Fields |
subprocess.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Parent Sub-process Contact Type Custom Fields |
subprocess.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Parent Sub-process Note Type Custom Fields |
subprocess.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
TASK |
||
Current Task ID |
task.getId() |
n/a |
Current Task Name |
task.getName() |
n/a |
Current task level custom fields (all types) |
task.getCustomFieldValue(“BusinessID”) |
task.setCustomFieldValue(“BusinessID”, “value”) |
Current Task date custom field |
task.getCustomFieldDateValue(“BusinessID”, “Date Format”) |
task.setCustomFieldDateValue(“BusinessID”, “value”, “Date Format”) |
Current Task Company Type Custom Fields |
task.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Current Task Contact Type Custom Fields |
task.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Current Task Note Type Custom Fields |
task.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
Current task owner |
task.getOwner() |
n/a |
Current task owner Group |
n/a |
n/a |
Current task status |
n/a |
n/a |
Current task project path |
task.getProjectPath(“Separator”) |
n/a |
Previous task ID |
previousTask.getId() |
n/a |
Previous task Name |
previousTask.getName() |
n/a |
Previous task level custom fields (all types) |
previousTask.getCustomFieldValue(“BusinessID”) |
n/a |
Previous Task date custom field |
previousTask.getCustomFieldDateValue(“BusinessID”, “Date Format”) |
n/a |
Previous Task Company Type Custom Fields |
previousTask.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Previous Task Contact Type Custom Fields |
previousTask.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Previous Task Note Type Custom Fields |
previousTask.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
Previous task owner |
previousTask.getOwner() |
n/a |
Previous task owner Group |
n/a |
n/a |
Previous task status |
n/a |
n/a |
Previous task project path |
previousTask.getProjectPath(“Separator”) |
n/a |
TRANSFERRED ASSET
|
||
Transferred Asset ID |
transferredAsset.getElementId() |
n/a |
Transferred Asset Name |
transferredAsset.getName() |
transferredAsset.setName(“name”); |
Transferred Asset File Name |
transferredAsset.getFileName() |
n/a |
Transferred Asset Number |
transferredAsset.getNumber() |
transferredAsset.setNumber(“number”); |
Transferred Asset Type ID |
transferredAsset.getTypeId() |
n/a |
Transferred Asset Type Name |
transferredAsset.getTypeName() |
n/a |
Transferred Asset Status ID |
transferredAsset.getStatusId() |
transferredAsset.setStatusId(“Status Id”); |
Transferred Asset Status Name |
transferredAsset.getStatusName() |
transferredAsset.setStatusName(“My status”); |
Transferred Asset Status Description |
transferredAsset.getStatusDecription() |
transferredAsset.setStatusDescription(“My Status Description”); |
Transferred Asset Way Finder |
transferredAsset.getWayFinder() |
n/a |
Transferred Asset Custom Fields |
transferredAsset.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID. |
transferredAsset.setCustomFieldValue(“A_001”, “BLUE Daily”); |
Transferred Asset Company Type Custom Fields |
transferredAsset.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Transferred Asset Contact Type Custom Fields |
transferredAsset.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Transferred Asset Note Type Custom Fields |
transferredAsset.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
Transferred Asset Expiry In Days |
n/a |
transferredAsset.setExpiryInDays(“Expiry Days”); |
Transferred Asset Expiry Date |
transferredAsset.getExpiryDate(“Date Format”) |
transferredAsset.setExpiryDate(“Expiry Date”); |
Transferred Asset Expiry Status Id |
transferredAsset.getExpiryStatusId() |
transferredAsset.setExpiryStatusId(“Expiry Status Id”); |
Transferred Asset Expiry Status Name |
transferredAsset.getExpiryStatusName() |
transferredAsset.setExpiryStatusName(“Expiry Status Name”); |
Transferred Asset Expiry Status Description |
transferredAsset.getExpiryStatusDescription() |
transferredAsset.setExpiryStatusDescription(“Expiry Status Description”); |
Transferred Asset Previous Version |
transferredAsset.getPreviousVersion() |
n/a |
Transferred Asset Group Rights |
transferredAsset.getElementRights(“Group Name”) |
var elementRightsEnabled = new com.schawkds.workflow.automation.command.ElementRights(); elementRightsEnabled.setAdminRights(true); transferredAsset.setGroupElementRights(“Group Name”, elementRightsEnabled1); |
APPROVED ASSET
|
||
Approved Asset ID |
approvedAsset.getElementId() |
n/a |
Approved Asset Name |
approvedAsset.getName() |
n/a |
Approved Asset File Name |
approvedAsset.getFileName() |
n/a |
Approved Asset Number |
approvedAsset.getNumber() |
n/a |
Approved Asset Type ID |
approvedAsset.getTypeId() |
n/a |
Approved Asset Type Name |
approvedAsset.getTypeName() |
n/a |
Approved Asset Status ID |
approvedAsset.getStatusId() |
n/a |
Approved Asset Status Name |
approvedAsset.getStatusName() |
n/a |
Approved Asset Status Description |
approvedAsset.getStatusDecription() |
n/a |
Approved Asset Custom Fields |
approvedAsset.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID. |
n/a |
Approved Asset Company Type Custom Fields |
approvedAsset.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID |
n/a |
Approved Asset Contact Type Custom Fields |
approvedAsset.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID |
n/a |
Approved Asset Note Type Custom Fields |
approvedAsset.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
Approved Asset Expiry Date |
approvedAsset.getExpiryDate(“Date Format”) |
n/a |
Approved Asset Expiry Status Id |
approvedAsset.getExpiryStatusId() |
n/a |
Approved Asset Expiry Status Name |
approvedAsset.getExpiryStatusName() |
n/a |
Approved Asset Expiry Status Description |
approvedAsset.getExpiryStatusDescription() |
n/a |
BASE ARTWORK ASSET
|
||
Base Artwork ID |
baseArtwork.getElementId() |
n/a |
Base Artwork Name |
baseArtwork.getName() |
baseArtwork.setName(“name”); |
Base Artwork File Name |
baseArtwork.getFileName() |
n/a |
Base Artwork Number |
baseArtwork.getNumber() |
baseArtwork.setNumber(“number”); |
Base Artwork Type ID |
baseArtwork.getTypeId() |
n/a |
Base Artwork Type Name |
baseArtwork.getTypeName() |
n/a |
Base Artwork Status ID |
baseArtwork.getStatusId() |
baseArtwork.setStatusId(StatusId); |
Base Artwork Status Name |
baseArtwork.getStatusName() |
baseArtwork.setStatusName(“Status Name”); |
Base Artwork Status Description |
baseArtwork.getStatusDecription() |
baseArtwork.setStatusDescription(“Status Description”); |
Base Artwork Custom Fields |
baseArtwork.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID |
baseArtwork.setCustomFieldValue(“A_001”, “BLUE Daily”); |
Base Artwork Company Type Custom Fields |
baseArtwork.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Base Artwork Contact Type Custom Fields |
baseArtwork.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID |
n/a |
Base Artwork Note Type Custom Fields |
baseArtwork.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID |
n/a |
Base Artwork Expiry In Days |
n/a |
baseArtwork.setExpiryInDays(“Expiry Days”); |
Base Artwork Expiry Date |
baseArtwork.getExpiryDate(“Date Format”) |
baseArtwork.setExpiryDate(“Expiry Date”); |
Base Artwork Expiry Status Id |
baseArtwork.getExpiryStatusId() |
baseArtwork.setExpiryStatusId(“Expiry Status Id”); |
Base Artwork Expiry Status Name |
baseArtwork.getExpiryStatusName() |
baseArtwork.setExpiryStatusName(“Expiry Status Name”); |
Base Artwork Expiry Status Description |
baseArtwork.getExpiryStatusDescription() |
baseArtwork.setExpiryStatusDescription(“Expiry Status Description”); |
Base Artwork Previous Version |
baseArtwork.getPreviousVersion() |
n/a |
Base Artwork Group Rights |
baseArtwork.getElementRights(“Group Name”) |
var elementRightsEnabled = new com.schawkds.workflow.automation.command.ElementRights(); elementRightsEnabled.setAdminRights(true); baseArtwork.setGroupElementRights(“Group Name”, elementRightsEnabled1); |
SUB-PROCESS GENERATION ASSET
|
||
Sub-process Generation Asset ID |
subprocessGenerationAsset.getElementId() |
n/a |
Sub-process Generation Asset Name |
subprocessGenerationAsset.getName() |
baseArtwork.setName(“name”); |
Sub-process Generation Asset File Name |
subprocessGenerationAsset.getFileName() |
n/a |
Sub-process Generation Asset Number |
subprocessGenerationAsset.getNumber() |
subprocessGenerationAsset.setNumber(“number”); |
Sub-process Generation Asset Type ID |
subprocessGenerationAsset.getTypeId() |
n/a |
Sub-process Generation Asset Type Name |
subprocessGenerationAsset.getTypeName() |
n/a |
Sub-process Generation Asset Status ID |
subprocessGenerationAsset.getStatusId() |
subprocessGenerationAsset.setStatusId(StatusId); |
Sub-process Generation Asset Status Name |
subprocessGenerationAsset.getStatusName() |
subprocessGenerationAsset.setStatusName(“Status Name”); |
Sub-process Generation Asset Status Description |
subprocessGenerationAsset.getStatusDecription() |
subprocessGenerationAsset.setStatusDescription(“Status Description”); |
Sub-process Generation Asset Custom Fields |
subprocessGenerationAsset.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID. |
subprocessGenerationAsset.setCustomFieldValue(“A_001”, “BLUE Daily”); |
Sub-process Generation Asset Company Type Custom Fields |
subprocessGenerationAsset.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. |
n/a |
Sub-process Generation Asset Contact Type Custom Fields |
subprocessGenerationAsset.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. |
n/a |
Sub-process Generation Asset Note Type Custom Fields |
subprocessGenerationAsset.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. |
n/a |
Sub-process Generation Asset Expiry In Days (File Only) |
n/a |
subprocessGenerationAsset.setExpiryInDays(“Expiry Days”); |
Sub-process Generation Asset Expiry Date (File Only) |
subprocessGenerationAsset.getExpiryDate(“Date Format”) |
subprocessGenerationAsset.setExpiryDate(“Expiry Date”); |
Sub-process Generation Asset Expiry Status Id (File Only) |
subprocessGenerationAsset.getExpiryStatusId() |
subprocessGenerationAsset.setExpiryStatusId(“Expiry Status Id”); |
Sub-process Generation Asset Expiry Status Name (File Only) |
subprocessGenerationAsset.getExpiryStatusName() |
subprocessGenerationAsset.setExpiryStatusName(“Expiry Status Name”); |
Sub-process Generation Asset Expiry Status Description (File Only) |
subprocessGenerationAsset.getExpiryStatusDescription() |
subprocessGenerationAsset.setExpiryStatusDescription(“Expiry Status Description”); |
Sub-process Generation Asset Previous Version (File Only) |
subprocessGenerationAsset.getPreviousVersion() |
n/a |
Sub-process Generation Asset Group Rights |
subprocessGenerationAsset.getElementRights(“Group Name”) |
var elementRightsEnabled = new com.schawkds.workflow.automation.command.ElementRights(); elementRightsEnabled.setAdminRights(true); subprocessGenerationAsset.setGroupElementRights(“Group Name”, elementRightsEnabled1); |
Reference Files
|
||
| Reference File ID | referenceFile.getElementId() | n/a |
| Reference File Name | referenceFile.getName() | n/a |
| Reference File FileName | referenceFile.getFileName() | n/a |
| Reference File Number | referenceFile.getNumber() | n/a |
| Reference File Type ID | referenceFile.getTypeId() | n/a |
| Reference File Type Name | referenceFile.getTypeName() | n/a |
| Reference File Status ID | referenceFile.getStatusId() | n/a |
| Reference File Status Name | referenceFile.getStatusName() | n/a |
| Reference File Status Description | referenceFile.getStatusDecription() | n/a |
| Reference File Custom Fields | referenceFile.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID. |
n/a |
| Reference File Company Type Custom Fields | referenceFile.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID. | n/a |
| Reference File Contact Type Custom Fields | referenceFile.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID. | n/a |
| Reference File Note Type Custom Fields | referenceFile.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID. | n/a |
| Reference File Expiry Date | referenceFile.getExpiryDate(“Date Format”) | n/a |
| Reference File Expiry Status Id | referenceFile.getExpiryStatusId() | n/a |
| Reference File Expiry Status Name | referenceFile.getExpiryStatusName() | n/a |
| Reference File Expiry Status Description | referenceFile.getExpiryStatusDescription() | n/a |
NEW ASSET
|
||
New Asset Name |
n/a |
newAsset.setName(“Asset Name”); |
New Asset Number |
n/a |
newAsset.setNumber(“Number”); |
New Asset Type ID |
n/a |
newAsset.setTypeId(“Type Id”); |
New Asset Type Name |
n/a |
newAsset.setTypeName(“Type Name”); |
New Asset Status ID |
n/a |
newAsset.setStatusId(StatusId); |
New Asset Status Name |
n/a |
newAsset.setStatusName(“Status Name”); |
New Asset Status Description |
n/a |
newAsset.setStatusDescription(“Status Description”); |
New Asset Expiry In Days |
n/a |
newAsset.setExpiryInDays(“Expiry Days”); |
New Asset Expiry Date |
n/a |
newAsset.setExpiryDate(“Expiry Date”); |
New Asset Expiry Status Id |
n/a |
newAsset.setExpiryStatusId(“Expiry Status Id”); |
new Asset Expiry Status Name |
n/a |
newAsset.setExpiryStatusName(“Expiry Status Name”); |
New Asset Expiry Status Description |
n/a |
newAsset.setExpiryStatusDescription(“Expiry Status Description”); |
New Asset Custom Fields |
n/a |
newAsset.setCustomFieldValue(“A_001”, “BLUE Daily”); |
New Asset Group Rights |
n/a |
var elementRightsEnabled = new com.schawkds.workflow.automation.command.ElementRights(); elementRightsEnabled.setAdminRights(true); newAsset.setGroupElementRights(“Group Name”, elementRightsEnabled1); |
New Asset Parent Folder Path |
n/a |
newAsset.setParentFolderPath(“Folder Path”); |
CREATE ALIAS
|
||
Alias Child |
aliasParent.addAliasChild(transferredAsset.getElementId()); |
|
|
|
||
Subject |
n/a |
email.setSubject(“Email subject”); |
Add recipient (To) |
n/a |
email.addRecipient(“admin@bluesoftware.com”); |
Email Title |
n/a |
email.setTitle(“Email title”); |
Email body text line one |
n/a |
email.setBodyLine1(“Line 1”); |
Email body text line two |
n/a |
email.setBodyLine2(“Line 2”); |
VLINK |
||
Vlink files |
n/a |
vlink.setFiles (workflowFiles.getReferenceFiles(“Upload Reference Files”)); |
Vlink email to |
n/a |
vlink.getEmail().addRecipient(“admin@bluesoftware.com”); |
Vlink password |
n/a |
vlink.setPassword(“password”); |
Vlink expiry in days |
n/a |
vlink.setDaysUntilExpiry (7); |
Vlink email language |
n/a |
vlink.setLanguagePreferenceCode (“en”); |
Notes:
-
- Note type fields returns the Note ID.
- Company type fields returns the Company ID.
- Contact type fields returns the Contact ID.
- Date type fields returns the number of milliseconds since 1970-01-01T00:00:00Z. This is done so that the date can be converted to any date format.
- Length of the automation task name must not exceed 255 characters in the process template.
New Asset and Security Audits
When the Automation node creates a new asset which is a copy of an approved asset using the damFiles.uploadFile(sourceFile) method:
-
- After the new file is created, any rights in the “groupElementRightsMap” of the sourceFile command are set on the new asset. By default, the “groupElementRightsMap” contains all of the rights from the source file. These are written after the file is created and therefore, there are Asset Security Change audits for each of these changes.
- If you wanted to simply inherit the rights of the new parent folder and make no additional security changes to the new file, you could call newAsset.setGroupElementRightsMap(null) in the automation node. Then, there would be no Asset Security Change audits.
Access to share links to files
The automation node can generate and share a link to one or more reference files. Enter an expression that contains variables for sharing files.
Sample automation node expressions
The following are sample expressions that may be used in the Automation node:
CHANGING PROJECT FIELDS
Set Project Name (note: Project Name must be unique. Adding the Project Number would ensure uniqueness.)
project.setName(“New Project Name” + ” ” + project.getNumber());
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Project Attributes”);
Set Project Number (note: Project Number must be unique)
project.setNumber (“New Project Number”)
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Project Attributes”);
Set Project Custom Field Value
project.setCustomFieldValue(“Business Id”, task.getCustomFieldValue(“Business Id”) + “_” + task.getCustomFieldValue(“Business Id”) );
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Project Attributes”);
CHANGING PROJECT OWNER GROUP
Get Project Owner Group
response.setStatus(true);
response.setResponseMessage(“Project Owner Group is: “+project.getProjectOwnerGroupName());
Set Project Owner Group
project.setProjectOwnerGroupName(“Marketing”); <<Marketing” – is the Project Owner Group
response.setStatus(true);
response.setResponseMessage(“Changes Done”);
Get Project Owner Group ID
response.setStatus(true);
response.setResponseMessage(“Project Owner Group ID is: “+project.getProjectOwnerGroupId());
Set Project Owner Group ID
project.setProjectOwnerGroupId(1002); << “1002” – is the Project Owner Group ID.
response.setStatus(true);
response.setResponseMessage(“Changes Done”);
CHANGING SUB-PROCESS FIELDS
Set Subprocess Name
subprocess.setName(“New Name”);
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Subprocess Attributes”);
Set Subprocess Custom Field Value
subprocess.setCustomFieldValue(“Business Id”, “New Value”);
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Subprocess Attributes”);
CALL REST SERVICE
Call REST Service and Set the Sub-Process Name to the Returned Value
restClient.setUrl(“http://” + restClient.getRestServiceAppServer() + “:” + restClient.getRestServicePort() + “/test/getTestData”);restClient.setMethod(“GET”);
subprocess.setName(restClient.execute());
response.setStatus(true);
response.setResponseMessage(“Successfully Changed Subprocess Name”);
GET /SET TRANSFERRED ASSET DETAILS
var transferredAsset = workflowFiles.getTransferredAsset(“1”); <<< “1” is the approval candidate ID
transferredAsset.getName();
transferredAsset.getFileName();
transferredAsset.getNumber();
transferredAsset.getTypeId();
transferredAsset.getTypeName();
transferredAsset.getStatusName();
transferredAsset.getStatusDecription();
transferredAsset.getCustomFieldValue(“A_001”); — To get a specific custom field – “A_001” – is the custom field ID.
transferredAsset.getCompanyCustomField(“C_002”); — To get Company type custom field – “C_002” – is the custom field ID.
transferredAsset.getContactCustomField(“CT_001”); — To get Contact type custom field – “CT_001” – is the custom field ID.
transferredAsset.getNoteCustomField(“N_001”); — To get Note type custom field – “N_001” – is the custom field ID.
transferredAsset.setNumber(“001.001.11”);
transferredAsset.setStatusName(“My status”);
transferredAsset.setStatusDescription(“My Status Description”);
transferredAsset.setCustomFieldValue(“A_001”, “BLUE Daily”);
VLINK
vlink.setFiles (workflowFiles.getReferenceFiles(“Upload Reference Files”));
vlink.getEmail().addRecipient(“admin@bluesoftware.com”);
vlink.setPassword(“password”);
vlink.setDaysUntilExpiry (7);
vlink.setLanguagePreferenceCode (“en”);
email.setSubject (“subject”);
email.setBodyLine1 (“line 1”);
email.setBodyLine2 (“line 2”);
email.setTitle (“this is a title”);
email.addRecipient (“admin@bluesoftware.com”);
CREATE ALIAS
var transferredAsset = workflowFiles.getTransferredAsset(“Approval Candidate Id”);
if(transferredAsset != null)
{
var aliasParent = damFiles.createAlias(“Assets/${cfs.get(‘Region’)}”); //Velocity Expression similar to ATTD
aliasParent.addAliasChild(transferredAsset.getElementId());
}
COPYING REFERENCE FILES TO DAM
var message = “Successfully copied the reference files”;
var status = true;
var referenceFilesList = workflowFiles.getReferenceFiles(“UPLOAD_REFERENCE_TASK_NAME”);
if(referenceFilesList != null)
{
for(i in referenceFilesList)
{
var newAsset = damFiles.uploadFile(referenceFilesList[i]);
newAsset.setParentFolderPath(“Assets/${cfs.get(‘CUSTOM_FIELD_ID1’)}/${cfs.get(‘CUSTOM_FIELD_ID2’)}”);
newAsset.setTypeName(“TYPE_NAME”);
newAsset.setStatusId(STATUS_ID);
var elementRightsMap = newAsset.getGroupElementRightsMap();
elementRightsMap.clear();
//Copying the Project Custom Field to the new file.
newAsset.setCustomFieldValues(project.getCustomFieldValues());
}
}
else
{
message = “No reference files found for copying.”;
}
response.setStatus(status);
response.setResponseMessage(message);