TaskContext

public class TaskContext

TaskContext holds task trigger event and data provider lookup objects that are used while executing filters/actions.

Constructors

TaskContext

public TaskContext(Task task, Map<String, Object> parameters, TaskActivityService activityService)

Class constructor.

Parameters:
  • task – the task, not null
  • parameters – the task parameters
  • activityService – the activity service, not null

Methods

addDataSourceObject

public void addDataSourceObject(String objectId, Object dataSourceObject, boolean failIfDataNotFound)

Adds the given data source to this task.

Parameters:
  • objectId – the ID of the object, not null
  • dataSourceObject – the result of lookup execution, not null
  • failIfDataNotFound – defines whether task should fail if the data wasn’t found

getDataSourceObjectValue

public Object getDataSourceObjectValue(String objectId, String field, String objectType)

Returns the value of data source object based on it’s field, id and type.

Parameters:
  • objectId – the id of the object, not null
  • field – the name of the field, not null
  • objectType – the type of the object
Throws:
Returns:

the value of data source object

getTask

public Task getTask()

getTriggerParameters

public Map<String, Object> getTriggerParameters()

getTriggerValue

public Object getTriggerValue(String key)

Returns the value of the trigger with the given key.

Parameters:
  • key – the key of the trigger, not null
Returns:

the value of the trigger with the given key

publishWarningActivity

public void publishWarningActivity(String message, String field)

Publishes warning activity for this task.

Parameters:
  • message – the message to be published
  • field – the name of the field