Interface ITaskFormFlowService

All Superinterfaces:
IComponent, IInitializable, ITaskComponent

public interface ITaskFormFlowService extends ITaskComponent
Service to handle form flow between tasks in the process model. The basic usage is:

1. Create wait object using waitPrepare(String) call for some unique correlation ID
2. Complete a task
3. Wait for new result from form flow using wait(TaskFlowObject, int).
4. Obtain result from TaskFlowObject

The new task being queued will need to call notify in its Queued event notify(String, String, boolean) for the same correlation ID and pass out a result. The result may be anything, for typical form flow implementation the result would be ID of a new task queued

To obtain service implementation instance use ITaskFormFlowService.Instance.get()
  • Method Details

    • waitPrepare

      TaskFlowObject waitPrepare(String correlationID)
      Prepares and returns wait object based on the unique correlation ID. This is not a blocking call e.g. it does not wait for anything This needs to be invoked before completing a task or starting a new process
      Parameters:
      correlationID - correlation ID value to wait for. Must be unique
      Returns:
      wait object
    • wait

      void wait(TaskFlowObject flow, int timeout) throws InterruptedException
      Waits for a notification for a given wait object. This is a blocking call which waits for notification for a correlation ID or for timeout. Use TaskFlowObject.isNotified() property to check if wait object was successfully notified or not. Use TaskFlowObject.getResult() to obtain result of the notify e.g. taskID or taskUrl or anything else
      Parameters:
      flow - wait object obtained by waitPrepare() call
      timeout - timeout in milliseconds to wait.
      Throws:
      InterruptedException
    • notify

      void notify(String correlationID, String result, boolean localOnly) throws PortalException
      Notifies anyone waiting on the specific correlation ID. It passed a result which will be available for the waiter in the TaskFlowObject. For cluster wide notification specify localOnly = false
      Parameters:
      correlationID - correlation ID to notify about
      result - result string to pass to waiting party
      localOnly - whether notify whole MWS cluster. Typically this should be set to false.
      Throws:
      PortalException