Skip to main content

Automation

The Automation is a pervasive aspect of the LogicalDOC platform and represents the way you have to program things using a simple scripting language. Sometimes you wish LogicalDOC to execute your own logic when something special happens during a workflow or in reaction to specific events occurred inside the repository: with the Automation, you can inject your own algorithm to take the proper actions automatically. Many objects support Automation and allow you to define custom Automation's scripts(folders, workflows, emails, etc.)

Please look at the Automation Syntax Guide to familiarize with the syntax. You may also look at the Automation Snippets.

In your automation scripts, you can reference the following variables(some of them are only available in certain contexts):

AUTOMATION CONTEXT: GENERAL
VariableJava ClassDescription
nlStringrepresents the new line
productStringname of the product
localeLocalecurrent locale
CURRENT_DATEDatecurrent date
tenantIdlongidentifier of the current tenant
dictionaryMapmap with all the variables(variable_name > value)
keysSetset of all the keys in the dictionary
parametersMapmap with all the routine's invocation parameters(parameter_name > value)
parametersnamesSetset of all the routine's invocation parameters
systemDictionaryMapA transient and system-wide map useful to store data among automation executions
logLogToolgives access to the system's log
I18NI18NToolhandles the translations
DateToolAutomationDateToolmanipulation and formatting of dates
NumberToolAutomationNumberToolformats a number using the given format
CollectionToolCollectionToolutility methods to work with collections
RegexToolRegexToolfunctions to manipulate regular expressions
DocToolDocToolhandles documents and related resources
FolderToolFolderToolhandles folders and related resources
ClassToolClassToolcreates new instances of the given class
SystemToolSystemToolfunctions for interacting with the Operative System
MailToolMailToolfunctions to send e-mails
BarcodeToolBarcodeToolclass to extract barcode contents from documents
StampToolStampToolapplies stamps into documents
SignToolSignTooldigitally signs a document with the user's digital certificate
AutomationToolAutomationToolexecutes an automation routine in the same execution thread or a new one
ContextToolContextToolmethods to access the Application context
SplitToolSplitToolallows the splitting of a PDF in segments using different policies
SecurityToolSecurityToolhandles some security related operations
WorkflowToolWorkflowToolmethods to handle workflows and interact with them
WebsocketToolWebsocketToolutility functions to interact with the user interface
UserToolUserToolutility methods to handle some user related operations
SearchToolSearchToolutility methods to do searches
FormToolFormToolutility methods to handle forms
ReportToolReportToolutility methods to run custom reports
CalendarToolCalendarTooltool to deal with the calendar
StringToolStringTooltool to deal with strings

AUTOMATION CONTEXT: EVENTS
VariableJava ClassDescription
eventHistorythe current event
documentDocumentthe document associated to the current event(if any)
folderFolderthe folder associated to the current event(if any)

AUTOMATION CONTEXT: WORKFLOW
VariableJava ClassDescription
candidatesUserlist of the current task's candidate users
documentsDocumentlist of the attached documents
documentDocumentfirst element of the documents list
taskTaskthe current task
taskNameStringname of the current task
initiatorUserthe user that started the workflow
workflowStringname of the workflow
processIdStringidentifier of the current process
definitionIdStringidentifier of the process definition
actionsListlist of possible actions(transitions) declared for the current task
actionStringname of the current action(transition), only available inside the transition
assigneeUseruser assigned to the current task

AUTOMATION CONTEXT: CUSTOM ID / AUTO NAMING / AUTO FOLDING
VariableJava ClassDescription
document

Document

the document being currently saved
value

Value

set here the value to replace in the scheme's token

AUTOMATION CONTEXT: WELCOME MESSAGE
VariableJava ClassDescription
userUserthe currently logged in user
session

Session

the current session

AUTOMATION CONTEXT: DASHLETS
VariableJava ClassDescription
userUserel usuario actualmente conectado
session

Session

la sesiĆ³n actual
dashlet

Dashlet

el objeto dashlet

AUTOMATION CONTEXT: CUSTOM ACTION
VariableJava ClassDescription
userUserthe currently logged in user
session

Session

Variable
document

Document

the selected document
documents

Document

the selected documents
folder

Folder

the selected folder
folders

Folder

the selected folders

AUTOMATION CONTEXT: EMAIL IMPORT
VariableJava ClassDescription
email

EMail

the email being imported
account

EmailAccount

the account from which the email is being imported
messagethe message representation as returned by the mail server
document

Document

the document that will be used to save the email in the repository
documents

Document

list of documents that will be used to save the email and it's attachments in the repository

AUTOMATION CONTEXT: ZONAL OCR
VariableJava ClassDescription
document

Document

the document being processed
samplethe text extracted from the zone
valuethe value object(String, Date, Decimal ...) converted from the sample
zone

Zone

the zone being processed, use zone.value if you want to change the value that will be saved in the document

AUTOMATION CONTEXT: EXTERNAL AUTHENTICATION
VariableJava ClassDescription
ldapUser

LDAPUser

the user being authenticated

AUTOMATION CONTEXT: NEW DEVICE
VariableJava ClassDescription
userUserthe currently logged in user
device

Device

the device used to login
client

Client

the remote client connected to the platform
event

History

the login event

AUTOMATION CONTEXT: FORMS
VariableJava ClassDescription
form

Form

the form being processed
document

Document

the document that contains the metadata

AUTOMATION CONTEXT: WEB FORMS
VariableJava ClassDescription
form

Form

the form being processed
template

Template

the template associated to the form
senderUserthe sender user
responderemail address of the responder
titlethe title of the web form
descriptiondescription of the web form
footerthe footer of the web form
messagebody of the email message
prefilledMapa map containing pre-filled responses(used when inviting people)

AUTOMATION CONTEXT: STAMPS
VariableJava ClassDescription
stamp

Stamp

the stamp being applied
user

User

the user applying the stamp
document

Document

the document being stamped
parametersmap with all the parameters inputed by the user(parameter_name > value)
pageIntegerthe current page number
parametersnamesset of all the names of the inputed parameters
DATEcurrent date formatted using the user's locale
TIMESTAMPcurrent timestamp formatted using the user's locale

AUTOMATION CONTEXT: BRANDING
VariableJava ClassDescription
branding

Branding

the object that represents the branding
requestthe HTTP request being processed
requestPaththe path invoked by the client
user

User

the currently logged in user
session

Session

the current session

AUTOMATION CONTEXT: SPLITTING
VariableJava ClassDescription
segmentinteger representing the current segment
documentDocumentthe currently divided document
eventHistorythe splitting event
policythe chosen splitting policy
expressionthe expression used to split

AUTOMATION CONTEXT: DIGITAL SIGNATURE
VariableJava ClassDescription
documentDocumentthe document to sign
reasonthe reason specified for the signature
userUserthe user that signs

AUTOMATION CONTEXT: CALENDAR
VariableJava ClassDescription
eventEventthe event in the calendar
reminderReminderthe current reminder

AUTOMATION CONTEXT: SEND MAIL
VariableJava ClassDescription
senderUserthe user sending the email message
documentDocumentfirst attached document
documentsDocumentcollection of attached documents

AUTOMATION CONTEXT: VALIDATION
VariableJava ClassDescription
objectExtensibleObjectthe object under validation, for instance a Document or a Folder
eventHistorythe current event
errorsmap of strings. Key is the attribute name, Value is the error description
attributeNamename of the current attribute being validated (only available in attribute validator)
attributeAttributethe current attribute being validated (only available in attribute validator)
valuevalue of the current attribute being validated (only available in attribute validator)
errorValidationErrorkeeps the error description of the current attribute being validated (only available in attribute validator)

AUTOMATION CONTEXT: INITIALIZATION
VariableJava ClassDescription
objectExtensibleObjectthe object under initialization, for instance a Document or a Folder
eventHistorythe current event
attributeNamename of the current attribute being initialized
attributeAttributethe current attribute being initialized