Interface Workflow


public interface Workflow
The Workflow interface provides workflow related services to an interactive form, integration service or another workflow job. A number of specific methods to open a job or task are provided. In addition, access is provided to the workflow API, which contains all the functionality offered by the Ebase workflow system.
Since:
V4.4
  • Method Summary

    Modifier and Type Method Description
    void completeTask()
    This is equivalent to calling completeTask(null, null).
    void completeTask​(java.lang.String completionState, java.lang.String reason)
    Signals completion of the current workflowed form and updates the workflow system with any workflow out parameters for the form.
    WorkflowManagement getApi()
    Returns a WorkflowManagment object representing the API for the workflow server.
    java.lang.String openJob​(java.lang.String processName, java.util.Map<java.lang.String,​java.lang.Object> parameters)
    This is equivalent to calling openJob(processName, parameters, null, null).
    java.lang.String openJob​(java.lang.String processName, java.util.Map<java.lang.String,​java.lang.Object> parameters, java.lang.String owner, java.lang.String reason)
    Opens a new workflow job for the process with name processName and passes any parameters to the new job as process attribute values.
    java.lang.String openJobAndCompleteFirstTask​(java.lang.String processName, java.lang.String firstTaskId)
    This is equivalent to calling openJobAndCompleteFirstTask(processName, firstTaskId, null, null, null).
    java.lang.String openJobAndCompleteFirstTask​(java.lang.String processName, java.lang.String firstTaskId, java.lang.String completionState, java.lang.String owner, java.lang.String reason)
    Opens a new workflow job for the process with name processName and completes the first task designated by firstTaskId with completion state completionState.
    void openTaskAndGotoForm​(java.lang.String taskId)
    This is equivalent to calling openTaskAndGotoForm(taskId, null).
    void openTaskAndGotoForm​(java.lang.String taskId, java.lang.String reason)
    Terminates execution of the current form, opens an interactive task and starts the Ebase form associated with the task.
    void reOpenTaskAndGotoForm​(java.lang.String taskId)
    Terminates execution of the current form, re-opens an interactive task and starts the Ebase form associated with the task.
  • Method Details

    • openTaskAndGotoForm

      void openTaskAndGotoForm​(java.lang.String taskId) throws com.ebasetech.ufs.kernel.FormException, com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      This is equivalent to calling openTaskAndGotoForm(taskId, null).
      Parameters:
      taskId - workflow interactive task id
      Throws:
      com.ebasetech.ufs.kernel.FormException
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException
      com.ebasetech.ufs.utility.ConcurrentUpdateException
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      Since:
      V4.4
      See Also:
      openTaskAndGotoForm(String, String)
    • openTaskAndGotoForm

      void openTaskAndGotoForm​(java.lang.String taskId, java.lang.String reason) throws com.ebasetech.ufs.kernel.FormException, com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      Terminates execution of the current form, opens an interactive task and starts the Ebase form associated with the task. Any declared workflow in parameters for the new form are passed into the new form from the workflow job. This method can only be used with interactive tasks associated with Ebase forms (Activity type: Ebase Form Activity). Typically, this method is used by a task list application to start an interactive task when selected by the user.

      The interactive task identified by taskId must be in state Waiting, and will be transitioned by this method call to state Active. The task must already be assigned to the user. If the task has previously been opened and therefore has a state of Active, method reOpenTaskAndGotoForm(String) should be used instead. If the task has state Unassigned, it must first be assigned to the user using method WorkflowManagement.assign(String, String, boolean, String, String).

      The taskId is passed into the form associated with the task and can be obtained using system variable $WF_TASK_ID.

      Parameters:
      taskId - workflow interactive task id
      reason - optional reason text, this is added to the audit trail of the workflow job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object, or if there is a problem starting the form associated with the task
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not allowed to access the workflow api openTask() method
      Since:
      V4.4
      See Also:
      reOpenTaskAndGotoForm(String)
    • reOpenTaskAndGotoForm

      void reOpenTaskAndGotoForm​(java.lang.String taskId) throws com.ebasetech.ufs.kernel.FormException, com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      Terminates execution of the current form, re-opens an interactive task and starts the Ebase form associated with the task. Any declared workflow in parameters for the new form are passed into the new form from the workflow job. This method can only be used with interactive tasks associated with Ebase forms (Activity type: Ebase Form Activity). This method is similar to method openTaskAndGotoForm(String), the difference being that this method operates on interactive tasks with status Active whereas method openTaskAndGotoForm() operates on tasks with status Waiting.

      The taskId is passed into the form associated with the task and can be obtained using system variable $WF_TASK_ID.

      Parameters:
      taskId - workflow interactive task id
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object, or if there is a problem starting the form associated with the task
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not allowed to access the workflow api openTask() method
      Since:
      V4.4
      See Also:
      openTaskAndGotoForm(String, String)
    • openJob

      java.lang.String openJob​(java.lang.String processName, java.util.Map<java.lang.String,​java.lang.Object> parameters) throws com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException, com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException, com.ebasetech.ufs.kernel.FormException
      This is equivalent to calling openJob(processName, parameters, null, null).
      Parameters:
      processName - the name of the workflow process
      parameters - a Map of key/value pairs where key is a process attribute name and value is the process attribute value. Null can be specified to indicate that there are no parameters. All passed process attributes must be declared as in parameters for the workflow process.
      Returns:
      the workflow job id of the new job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException
      Since:
      V4.4
      See Also:
      openJob(String, Map, String, String), openJobAndCompleteFirstTask(String, String, String, String, String)
    • openJob

      java.lang.String openJob​(java.lang.String processName, java.util.Map<java.lang.String,​java.lang.Object> parameters, java.lang.String owner, java.lang.String reason) throws com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException, com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException, com.ebasetech.ufs.kernel.FormException
      Opens a new workflow job for the process with name processName and passes any parameters to the new job as process attribute values. All passed process attributes must be declared as in parameters for the workflow process.

      See also method openJobAndCompleteFirstTask(String, String, String, String, String) for an alternative way of opening a new workflow job, and including the opening task as part of the process. Null can be specified to indicate that there are no parameters. All passed process attributes must be declared as in parameters for the workflow process.

      Javascript example:

       var parms = {};
       parms.LOAN_ID = fields.LOAN_ID.value;
       parms.LOAN_TYPE = fields.LOAN_TYPE.value;
       var jobid = system.workflow.openJob("LOAN_APPLICATION", parms, null, "Application from public");
       
      Parameters:
      processName - the name of the workflow process
      parameters - a Map of key/value pairs where key is a process attribute name and value is the process attribute value.
      owner - the job owner or null
      reason - optional reason text, this is added to the audit trail of the workflow job
      Returns:
      the workflow job id of the new job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException
      Since:
      V4.4
      See Also:
      openJobAndCompleteFirstTask(String, String, String, String, String)
    • openJobAndCompleteFirstTask

      java.lang.String openJobAndCompleteFirstTask​(java.lang.String processName, java.lang.String firstTaskId) throws com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException, com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException, com.ebasetech.ufs.kernel.FormException
      This is equivalent to calling openJobAndCompleteFirstTask(processName, firstTaskId, null, null, null).
      Parameters:
      processName - the name of the workflow process
      firstTaskId - the name of the first task node
      Returns:
      the workflow job id of the new job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException
      Since:
      V4.4
      See Also:
      openJob(String, Map, String, String), openJobAndCompleteFirstTask(String, String, String, String, String)
    • openJobAndCompleteFirstTask

      java.lang.String openJobAndCompleteFirstTask​(java.lang.String processName, java.lang.String firstTaskId, java.lang.String completionState, java.lang.String owner, java.lang.String reason) throws com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException, com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException, com.ebasetech.ufs.kernel.FormException
      Opens a new workflow job for the process with name processName and completes the first task designated by firstTaskId with completion state completionState. Any parameters declared as workflow out parameters for the current form are passed into the workflow job.

      This method differs from method openJob(String, Map, String, String) in that this method allows the form that opens the job to be included as part of the workflow process. This is useful when there is a need to assign a subsequent task to the person who submitted the initial request, or there is a need to branch back to the initial task within the process logic. When this method is used, the first task must have an assignment of either Public or Job Opener.

      Note that parameters are passed into this method by declaring them as workflow out parameters on the invoking form i.e. these are task level parameters. This is in contrast to method openJob(String, Map, String, String) where parameters are passed by declaring them as in parameters for the workflow process i.e. these are process level parameters.

      Parameters:
      processName - the name of the workflow process
      firstTaskId - the name of the first task node
      completionState - the completion state for the first task. If null, the default completion state of COMPLETED is used.
      owner - the job owner or null
      reason - optional reason text, this is added to the audit trail of the workflow job
      Returns:
      the workflow job id of the new job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      com.ebasetech.ufs.workflow.server.api.WorkflowServerUnavailableException
      Since:
      V4.4
      See Also:
      openJob(String, Map, String, String)
    • completeTask

      void completeTask() throws com.ebasetech.ufs.kernel.FormException, com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      This is equivalent to calling completeTask(null, null).
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      Since:
      V4.4
      See Also:
      completeTask(String, String)
    • completeTask

      void completeTask​(java.lang.String completionState, java.lang.String reason) throws com.ebasetech.ufs.kernel.FormException, com.ebasetech.ufs.workflow.server.external.WorkflowManagementException, com.ebasetech.ufs.utility.ConcurrentUpdateException, com.ebasetech.ufs.workflow.security.WorkflowSecurityException
      Signals completion of the current workflowed form and updates the workflow system with any workflow out parameters for the form. The corresponding workflow interactive task will be transitioned by this method call to state Completed. This method can only be called from the form which is being completed.
      Parameters:
      completionState - the completion state. If null, the default completion state of COMPLETED is used.
      reason - optional reason text, this is added to the audit trail of the workflow job
      Throws:
      com.ebasetech.ufs.workflow.server.external.WorkflowManagementException - if there is some problem with invoking the operation on the underlying workflow objects. This could be, for example, a request to transition the state in a disallowed manner.
      com.ebasetech.ufs.kernel.FormException - if there is a database problem with the underlying persistence framework such as not being able to find a requested object
      com.ebasetech.ufs.utility.ConcurrentUpdateException - if accessing the underlying database tables causes a conflict with some other processor in the cluster
      com.ebasetech.ufs.workflow.security.WorkflowSecurityException - if the caller is not authorised
      Since:
      V4.4
    • getApi

      Returns a WorkflowManagment object representing the API for the workflow server.
      Returns:
      WorkflowManagement
      Since:
      V4.4