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 occurrend 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
nlrepresents the new line
productname of the product
localecurrent locale
CURRENT_DATEcurrent date
tenantIdidentifier of the current tenant
dictionarymap with all the variables(variable_name > value)
keysset of all the keys in the dictionary
parametersmap with all the routine's invocation parameters(parameter_name > value)
parametersnamesset of all the routine's invocation parameters
systemDictionaryA 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

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
taskthe current task
taskNamename of the current task
initiatorUserthe user that started the workflow
workflowname of the workflow
processIdidentifier of the current process
definitionIdidentifier of the process definition
actionslist of possible actions(transitions) declared for the current task
actionname of the current action(transition), only available inside the transition
assigneeuser assigned to the current task

AUTOMATION CONTEXT: CUSTOM ID / AUTO NAMING / AUTO FOLDING
VariableJava ClassDescription
documentDocumentthe document being currently saved

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

AUTOMATION CONTEXT: DASHLETS
VariableJava ClassDescription
userUserel usuario actualmente conectado
sessionSessionla sesiĆ³n actual
dashletDashletel objeto dashlet

AUTOMATION CONTEXT: CUSTOM ACTION
VariableJava ClassDescription
userUserthe currently logged in user
sessionSessionVariable
documentDocumentthe selected document
documentsDocumentthe selected documents
folderFolderthe selected folder

AUTOMATION CONTEXT: EMAIL IMPORT
VariableJava ClassDescription
emailEMailthe email being imported
accountEmailAccountthe account from which the email is being imported
messagethe message representation as returned by the mail server
documentDocumentthe document that will be used to save the email in the repository
documentsDocumentlist of documents that will be used to save the email and it's attachments in the repository

AUTOMATION CONTEXT: ZONAL OCR
VariableJava ClassDescription
documentDocumentthe document being processed
samplethe text extracted from the zone
valuethe value object(String, Date, Decimal ...) converted from the sample
zoneZonethe 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
ldapUserLDAPUserthe user being authenticated

AUTOMATION CONTEXT: NEW DEVICE
VariableJava ClassDescription
userUserthe currently logged in user
deviceDevicethe device used to login
clientClientthe remote client connected to the platform
eventHistorythe login event

AUTOMATION CONTEXT: FORMS
VariableJava ClassDescription
formFormthe form being processed
documentDocumentthe document that contains the metadata

AUTOMATION CONTEXT: WEB FORMS
VariableJava ClassDescription
formFormthe form being processed
templateTemplatethe 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
stampStampthe stamp being applied
userUserthe user applying the stamp
documentDocumentthe 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
brandingBrandingthe object that represents the branding
requestthe HTTP request being processed
requestPaththe path invoked by the client
userUserthe currently logged in user
sessionSessionthe current session

AUTOMATION CONTEXT: SPLITTING
VariableJava ClassDescription
brandingBrandingthe object that represents the branding
requestthe HTTP request being processed
requestPaththe path invoked by the client
userUserthe currently logged in user
sessionSessionthe current session

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: 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: SEND MAIL
VariableJava ClassDescription
senderUserthe user sending the email message
documentDocumentfirst attached document
documentsDocumentcollection of attached documents