com.adobe.solutions.prm.handler
Interface WorkItemFlowHandler


public interface WorkItemFlowHandler

Abstract handling of workflow associated with WorkItem. WorkItem contains information about associated workflow like asset, reference documents, template etc. WorkItemHandler bean will take care of managing the associated workflow, thus decoupling Project Management from it. This bean should not directly update the state of workitem or project, rather it delegates that to the callback registered with it. As per target use cases, most of the work item flow will be based around Asset that is associated with workitem. But, the interface definition does not dictate that and is flexible in that respect.


Method Summary
 void afterGetProject(Project project)
          Updates necessary changes to project before returning the project object to user.
 void afterGetWorkItem(WorkItem workItem)
          Updates necessary changes to workitem before returning the workitem object to user.
 WorkItemCallback getCallback()
          Retrieves registered work item callback
 String getStatus(WorkItem workItem)
          Returns the current status of the
 void restart(WorkItem workItem)
          Restarts the work item flow, some implementations might now support the restart and can throw appropriate exception.
 void setCallback(WorkItemCallback callback)
          Registers callback with work item handler.
 String start(WorkItem workItem)
          Initiates the work item flow
 String terminate(WorkItem workItem)
          Explicitly terminate or complete the work item flow.
 void updateSchedule(WorkItem workItem)
          Updates the schedule for associated work item flow, if applicable.
 

Method Detail

start

String start(WorkItem workItem)
             throws WorkItemHandlerException
Initiates the work item flow

Parameters:
workItem - work item definition
Returns:
instance id to uniquely identify the work item flow
Throws:
WorkItemHandlerException

terminate

String terminate(WorkItem workItem)
                 throws WorkItemHandlerException
Explicitly terminate or complete the work item flow.

Parameters:
instanceId - instance id to uniquely identify the work item flow
Returns:
Status of the work item flow. This can be any custom defined status, as defined by work item flow implementation
Throws:
WorkItemHandlerException

getStatus

String getStatus(WorkItem workItem)
                 throws WorkItemHandlerException
Returns the current status of the

Parameters:
instanceId -
Returns:
Throws:
WorkItemHandlerException

restart

void restart(WorkItem workItem)
             throws WorkItemHandlerException
Restarts the work item flow, some implementations might now support the restart and can throw appropriate exception.

Parameters:
workItem - work item definition
Throws:
WorkItemHandlerException

setCallback

void setCallback(WorkItemCallback callback)
                 throws WorkItemHandlerException
Registers callback with work item handler. Callback is responsible for updating work item and project state, based on the events generated in work item flow

Parameters:
callback - callback implementation
Throws:
WorkItemHandlerException

getCallback

WorkItemCallback getCallback()
                             throws WorkItemHandlerException
Retrieves registered work item callback

Parameters:
callback - callback implementation
Throws:
WorkItemHandlerException

updateSchedule

void updateSchedule(WorkItem workItem)
                    throws WorkItemHandlerException
Updates the schedule for associated work item flow, if applicable.

Parameters:
endDate - provides a new end date.
instanceId - unique idenfication of the work item flow
Throws:
WorkItemHandlerException

afterGetWorkItem

void afterGetWorkItem(WorkItem workItem)
                      throws WorkItemHandlerException
Updates necessary changes to workitem before returning the workitem object to user. This could be used by workitem handler implementation to populate or default some of the fields in workitem, before the workitem is returned to user. e.g. in case of RCA integration, this method could be used to populate transient field reviewContextTO in workitem

Throws:
WorkItemHandlerException

afterGetProject

void afterGetProject(Project project)
                     throws WorkItemHandlerException
Updates necessary changes to project before returning the project object to user. This could be used by workitem handler implementation to populate or default some of the fields in project, before the project is returned to user. e.g. in case of RCA integration, this method could be used to populate transient field currentReviewTemplate in project

Throws:
WorkItemHandlerException


[an error occurred while processing this directive] [an error occurred while processing this directive]