Class AutomationTool
java.lang.Object
com.logicaldoc.enterprise.automation.AutomationTool
Utility methods to launch automation routines from inside an automation
script
- Since:
- 8.1.1
- Author:
- Marco Meschieri - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionExecutes a routine in the same execution thread.execute
(String routine, long tenantId, Map<String, Object> dictionary, Map<String, Object> parameters) Executes a routine in the same execution thread.void
Executes a routine in a new execution threadvoid
Executes a routine in a new execution threadnewTrigger
(long tenantId, String events, Date date, String cron) Creates a new automation triggervoid
removeTrigger
(long triggerId) Deletes an automation triggervoid
saveTrigger
(AutomationTrigger trigger) Stores into the database the given automation trigger
-
Constructor Details
-
AutomationTool
public AutomationTool()
-
-
Method Details
-
execute
public String execute(String routine, long tenantId, Map<String, Object> dictionary, Map<String, Object> parameters) Executes a routine in the same execution thread. Returns the routine result- Parameters:
routine
- name of the routine to executetenantId
- identifier of the tenantdictionary
- the dictionary to pass to the routineparameters
- the parameters to pass to the routine- Returns:
- the result of the routine's execution
-
execute
Executes a routine in the same execution thread. Returns the routine result- Parameters:
routine
- name of the routine to executetenantId
- identifier of the tenantdictionary
- the dictionary to pass to the routine- Returns:
- the result of the routine's execution
-
fork
public void fork(String routine, long tenantId, Map<String, Object> dictionary, Map<String, Object> parameters) Executes a routine in a new execution thread- Parameters:
routine
- name of the routine to executetenantId
- identifier of the tenantdictionary
- the dictionary to pass to the routineparameters
- the parameters to pass to the routine
-
fork
Executes a routine in a new execution thread- Parameters:
routine
- name of the routine to executetenantId
- identifier of the tenantdictionary
- the dictionary to pass to the routine
-
saveTrigger
Stores into the database the given automation trigger- Parameters:
trigger
- the trigger to save / update- Throws:
com.logicaldoc.core.PersistenceException
- error at data layer
-
removeTrigger
public void removeTrigger(long triggerId) throws com.logicaldoc.core.PersistenceException Deletes an automation trigger- Parameters:
triggerId
- identifier of the trigger to delete- Throws:
com.logicaldoc.core.PersistenceException
- error at data layer
-
newTrigger
public AutomationTrigger newTrigger(long tenantId, String events, Date date, String cron) throws com.logicaldoc.core.PersistenceException Creates a new automation trigger- Parameters:
tenantId
- the current tenantevents
- comma separated list of events, if this is an event-driven triggerdate
- the exact time to fire this trigger, if this is a time-driven triggercron
- the cron expression to fire this trigger, if this is a time-driven trigger- Returns:
- the created trigger
- Throws:
com.logicaldoc.core.PersistenceException
- error at data layer
-