Class AutomationTool
- java.lang.Object
-
- com.logicaldoc.enterprise.automation.AutomationTool
-
public class AutomationTool extends Object
Utility methods to launch automation routines from inside an automation script- Since:
- 8.1.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description AutomationTool()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
execute(String routine, long tenantId, Map<String,Object> dictionary)
Executes a routine in the same execution thread.String
execute(String routine, long tenantId, Map<String,Object> dictionary, Map<String,Object> parameters)
Executes a routine in the same execution thread.void
fork(String routine, long tenantId, Map<String,Object> dictionary)
Executes a routine in a new execution threadvoid
fork(String routine, long tenantId, Map<String,Object> dictionary, Map<String,Object> parameters)
Executes a routine in a new execution threadAutomationTrigger
newTrigger(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
-
-
-
Method Detail
-
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
public String execute(String routine, long tenantId, Map<String,Object> dictionary)
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
public void fork(String routine, long tenantId, Map<String,Object> dictionary)
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
public void saveTrigger(AutomationTrigger trigger) throws com.logicaldoc.core.PersistenceException
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
-
-