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 | ||
---|---|---|
Variable | Java Class | Description |
nl | String | represents the new line |
product | String | name of the product |
locale | Locale | current locale |
CURRENT_DATE | Date | current date |
tenantId | long | identifier of the current tenant |
dictionary | Map | map with all the variables(variable_name > value) |
keys | Set | set of all the keys in the dictionary |
parameters | Map | map with all the routine's invocation parameters(parameter_name > value) |
parametersnames | Set | set of all the routine's invocation parameters |
systemDictionary | Map | A transient and system-wide map useful to store data among automation executions |
log | LogTool | gives access to the system's log |
I18N | I18NTool | handles the translations |
DateTool | AutomationDateTool | manipulation and formatting of dates |
NumberTool | AutomationNumberTool | formats a number using the given format |
CollectionTool | CollectionTool | utility methods to work with collections |
RegexTool | RegexTool | functions to manipulate regular expressions |
DocTool | DocTool | handles documents and related resources |
FolderTool | FolderTool | handles folders and related resources |
ClassTool | ClassTool | creates new instances of the given class |
SystemTool | SystemTool | functions for interacting with the Operative System |
MailTool | MailTool | functions to send e-mails |
BarcodeTool | BarcodeTool | class to extract barcode contents from documents |
StampTool | StampTool | applies stamps into documents |
SignTool | SignTool | digitally signs a document with the user's digital certificate |
AutomationTool | AutomationTool | executes an automation routine in the same execution thread or a new one |
ContextTool | ContextTool | methods to access the Application context |
SplitTool | SplitTool | allows the splitting of a PDF in segments using different policies |
SecurityTool | SecurityTool | handles some security related operations |
WorkflowTool | WorkflowTool | methods to handle workflows and interact with them |
WebsocketTool | WebsocketTool | utility functions to interact with the user interface |
UserTool | UserTool | utility methods to handle some user related operations |
SearchTool | SearchTool | utility methods to do searches |
FormTool | FormTool | utility methods to handle forms |
ReportTool | ReportTool | utility methods to run custom reports |
CalendarTool | CalendarTool | tool to deal with the calendar |
StringTool | StringTool | tool to deal with strings |
AUTOMATION CONTEXT: WORKFLOW | ||
---|---|---|
Variable | Java Class | Description |
candidates | User | list of the current task's candidate users |
documents | Document | list of the attached documents |
document | Document | first element of the documents list |
task | Task | the current task |
taskName | String | name of the current task |
initiator | User | the user that started the workflow |
workflow | String | name of the workflow |
processId | String | identifier of the current process |
definitionId | String | identifier of the process definition |
actions | List | list of possible actions(transitions) declared for the current task |
action | String | name of the current action(transition), only available inside the transition |
assignee | User | user assigned to the current task |
AUTOMATION CONTEXT: EMAIL IMPORT | ||
---|---|---|
Variable | Java Class | Description |
the email being imported | ||
account | the account from which the email is being imported | |
message | the message representation as returned by the mail server | |
document | the document that will be used to save the email in the repository | |
documents | list of documents that will be used to save the email and it's attachments in the repository |
AUTOMATION CONTEXT: ZONAL OCR | ||
---|---|---|
Variable | Java Class | Description |
document | the document being processed | |
sample | the text extracted from the zone | |
value | the value object(String, Date, Decimal ...) converted from the sample | |
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 | ||
---|---|---|
Variable | Java Class | Description |
ldapUser | the user being authenticated |
AUTOMATION CONTEXT: WEB FORMS | ||
---|---|---|
Variable | Java Class | Description |
form | the form being processed | |
template | the template associated to the form | |
sender | User | the sender user |
responder | email address of the responder | |
title | the title of the web form | |
description | description of the web form | |
footer | the footer of the web form | |
message | body of the email message | |
prefilled | Map | a map containing pre-filled responses(used when inviting people) |
AUTOMATION CONTEXT: STAMPS | ||
---|---|---|
Variable | Java Class | Description |
stamp | the stamp being applied | |
user | the user applying the stamp | |
document | the document being stamped | |
parameters | map with all the parameters inputed by the user(parameter_name > value) | |
page | Integer | the current page number |
parametersnames | set of all the names of the inputed parameters | |
DATE | current date formatted using the user's locale | |
TIMESTAMP | current timestamp formatted using the user's locale |
AUTOMATION CONTEXT: VALIDATION | ||
---|---|---|
Variable | Java Class | Description |
object | ExtensibleObject | the object under validation, for instance a Document or a Folder |
event | History | the current event |
errors | map of strings. Key is the attribute name, Value is the error description | |
attributeName | name of the current attribute being validated (only available in attribute validator) | |
attribute | Attribute | the current attribute being validated (only available in attribute validator) |
value | value of the current attribute being validated (only available in attribute validator) | |
error | ValidationError | keeps the error description of the current attribute being validated (only available in attribute validator) |
AUTOMATION CONTEXT: INITIALIZATION | ||
---|---|---|
Variable | Java Class | Description |
object | ExtensibleObject | the object under initialization, for instance a Document or a Folder |
event | History | the current event |
attributeName | name of the current attribute being initialized | |
attribute | Attribute | the current attribute being initialized |