use of org.wso2.carbon.humantask.core.api.event.TaskEventInfo in project carbon-business-process by wso2.
the class CommonTaskUtil method createNewTaskEvent.
/**
* Creates a new TaskEventInfo object for the task creation event.
*
* @param task : The newly created task object.
*
* @return : The respective TaskEventInfo object for the task creation event.
*/
public static TaskEventInfo createNewTaskEvent(TaskDAO task) {
TaskEventInfo createTaskEvent = new TaskEventInfo();
createTaskEvent.setEventType(TaskEventType.CREATE);
createTaskEvent.setTimestamp(task.getCreatedOn());
// TODO - how to handle the event initiator for create task event ?
// createTaskEvent.setEventInitiator(null);
createTaskEvent.setTaskInfo(populateTaskInfo(task));
return createTaskEvent;
}
use of org.wso2.carbon.humantask.core.api.event.TaskEventInfo in project carbon-business-process by wso2.
the class CommonTaskUtil method populateTaskEventInfo.
/**
* Create the TaskEventInfo object from the EventDAO and the TaskDAO.
* @param eventDAO : The event
* @param taskDAO : The related task dao.
*
* @return : The new TaskEventInfo object.
*/
public static TaskEventInfo populateTaskEventInfo(EventDAO eventDAO, TaskDAO taskDAO) {
TaskEventInfo eventInfo = new TaskEventInfo();
eventInfo.setTimestamp(eventDAO.getTimeStamp());
eventInfo.setEventInitiator(eventDAO.getUser());
eventInfo.setEventType(eventDAO.getType());
eventInfo.setNewState(eventDAO.getNewState());
eventInfo.setOldState(eventDAO.getOldState());
eventInfo.setTaskInfo(populateTaskInfo(taskDAO));
return eventInfo;
}
use of org.wso2.carbon.humantask.core.api.event.TaskEventInfo in project carbon-business-process by wso2.
the class AbstractHumanTaskCommand method processTaskEvent.
/**
*/
protected void processTaskEvent() {
EventDAO eventDAO = createTaskEvent();
getTask().persistEvent(eventDAO);
TaskEventInfo taskEventInfo = CommonTaskUtil.populateTaskEventInfo(eventDAO, task);
getEngine().getEventProcessor().processEvent(taskEventInfo);
}
Aggregations