com.ibm.openpages.api.service

Interface IWorkflowService



  • public interface IWorkflowService
    Provides service for OpenPages native workflow features. The native workflow feature provides the automation of a business process while information is passed from one participant to another based on procedural set of rules. Refer this document for basic concepts and terminology: http://www.aiai.ed.ac.uk/project/wfmc/ARCHIVE/DOCS/glossary/glossary.html The service provides API to: - create/fetch/update/delete process definitions - start process on a resource - process workflow transitions - fetch process/activity instances - run administrative operations on process/activity instances
    Since:
    8.0.0.2
    • Method Detail

      • getProcessDefinitions

        java.util.List<IWFProcessDefinition> getProcessDefinitions(Id processDefinitionId)
        Returns the published and draft versions of the process definition if they exist.
        Parameters:
        processDefinitionId -
        Returns:
      • getProcessDefinitionByVersionId

        IWFProcessDefinition getProcessDefinitionByVersionId(Id versionId)
        Returns a process definition by the version ID
        Parameters:
        versionId -
        Returns:
      • getProcessDefinition

        IWFProcessDefinition getProcessDefinition(java.lang.String name,
                                                  Id typeDefinitionId,
                                                  boolean draft)
        Returns a process definition by name, type definition ID
        Parameters:
        name -
        typeDefinitionId -
        draft -
        Returns:
      • getProcessDefinition

        IWFProcessDefinition getProcessDefinition(Id processDefinitionId,
                                                  boolean draft)
        Returns a process definition by ID
        Parameters:
        processDefinitionId -
        draft -
        Returns:
      • createProcessDefinition

        IWFProcessDefinition createProcessDefinition(IWFProcessDefinition processDefinition)
        Creates a process definition. The created process definition is in draft state initially.
        Parameters:
        processDefinition -
        Returns:
      • updateProcessDefinition

        IWFProcessDefinition updateProcessDefinition(IWFProcessDefinition processDefinition)
        Updates a process definition. Note that the updated process is not used by the workflow on a resuorce until it is published. It creates or updates a draft of the process definition behind the scene.
        Parameters:
        processDefinition -
        Returns:
      • deleteProcessDefinitions

        void deleteProcessDefinitions(java.util.Set<Id> processDefinitionIds)
        Deletes process definitions by IDs. If there are active workflow on the system, they are terminated by the operation.
        Parameters:
        processDefinitionIds -
      • hardDeleteProcessDefinitions

        void hardDeleteProcessDefinitions(java.util.Set<Id> processDefinitionIds)
        Hard-deletes process definitions by IDs. Unlike deleteProcessDefinitions(Set), this API will completely remove the process definition and its associated process/activity instances from the database, so there is not way to recover it.
        Parameters:
        processDefinitionIds -
      • publishProcessDefinition

        IWFProcessDefinition publishProcessDefinition(Id processDefinitionId)
        Publish the draft content of the process definition, so it can be started on a resource during the resource creation or the user's submission.
        Parameters:
        processDefinitionId -
        Returns:
      • discardDraftDefinition

        IWFProcessDefinition discardDraftDefinition(Id processDefinitionId)
        Discard the draft content of the process definition. No change to the last published version of the process definition, and it would be used to start the workflow on a resource.
        Parameters:
        processDefinitionId -
        Returns:
      • enableProcessDefinitions

        void enableProcessDefinitions(java.util.Set<Id> processDefinitionIds,
                                      boolean enabled)
        enable or disable process definitions by IDs
        Parameters:
        processDefinitionIds -
        enabled -
      • getProcessDefinitionsToStartOn

        java.util.List<IWFProcessDefinition> getProcessDefinitionsToStartOn(IGRCObject grcObject)
        Returns the list of process definitions that a user can start on the given resource. This API evaluates the condition of process definitions and filters out the ones that do not meet the criteria.
        Parameters:
        grcObject -
        Returns:
      • getActiveProcesses

        java.util.List<IWFProcess> getActiveProcesses(Id resourceId)
        Returns list of active processes (open/executing) for the given resource id.
        Parameters:
        resourceId -
        Returns:
      • getStartedProcesses

        java.util.List<IWFProcess> getStartedProcesses(Id resourceId)
        Returns list of started processes (open/executing/initialization error) for the given resource id.
        Parameters:
        resourceId -
        Returns:
      • getProcess

        IWFProcess getProcess(Id processId)
        Retrieves a process object for the given id.
        Parameters:
        processId -
        Returns:
      • getProcessEventLog

        java.util.List<IWFProcessEvent> getProcessEventLog(Id processId)
        Retrieves the list of process events for the given process id.
        Parameters:
        processId -
        Returns:
      • getProcessEventLog

        java.util.List<IWFProcessEvent> getProcessEventLog(Id processId,
                                                           Id activityInstanceId,
                                                           java.util.List<WFProcessEventType> types)
        Retrieves process events for the given parameters. Process Id is required. Activity Instance Id and type filters are optional.
        Parameters:
        processId -
        activityInstanceId -
        types -
        Returns:
      • getActivityInstances

        java.util.List<IWFActivityInstance> getActivityInstances(Id processId)
        Retrieves the list of activity instances for the given process id.
        Parameters:
        processId -
        Returns:
      • startProcess

        IWFProcess startProcess(Id processDefinitionId,
                                Id resourceId)
        Instantiates a workflow process for the given resource id.
        Parameters:
        processDefinitionId -
        resourceId -
        Returns:
      • startProcess

        IWFProcess startProcess(Id processDefinitionId,
                                Id resourceId,
                                java.util.Map<java.lang.String,java.lang.Object> processVariables)
        Instantiates a workflow process for the given resource id with given process variables. The workflow definition can refer these variables via expression, and it is substituted at run-time.
        Parameters:
        processDefinitionId -
        resourceId -
        processVariables -
        Returns:
        Since:
        8.1
      • getTransitions

        java.util.List<IWFTransition> getTransitions(Id processId)
        Returns currently valid transitions for the given process id. The returned list may not be the same list as it is defined on the activity definition. The workflow system evaluates IWFTransition.getCondition() from the transitions defined on an activity, and list the ones that meets the criteria. It also evaluates IWFActivity.getAccessType() and returns only available transtitions for the current user.
        Parameters:
        processId -
        Returns:
      • getTransitions

        java.util.List<IWFTransition> getTransitions(IWFProcess procInst)
        Returns currently valid transitions for the given process instance. The returned list may not be the same list as it is defined on the activity definition. The workflow system evaluates IWFTransition.getCondition() from the transitions defined on an activity, and list the ones that meets the criteria. It also evaluates IWFActivity.getAccessType() and returns only available transtitions for the current user.
        Parameters:
        procInst -
        Returns:
        Since:
        8.1
      • validateTransition

        WFConditionReport validateTransition(Id processId,
                                             java.lang.String transitionName)
        Validates all the validations defined for the transition for the given process id. The validation result is reported in WFConditionReport object. The WFConditionReport object contains all the validations along with the evaluation result including both passed and failed validations.
        Parameters:
        processId -
        transitionName -
      • processTransition

        void processTransition(Id processId,
                               java.lang.String transitionName,
                               IWFTransitionOptions options)
        Processes the transition for the given process id. If the transition is defined to run in the background the method will return immediately and the process will be in an executing state. Otherwise the method will return once the transition completes. The workflow system executes a series of actions in the following order: - post-actions of current activity - actions of selected transitions - pre-actions of target activity specified on the transition When any of the action has error, the system rolls back to the original state and throws appropriate WFException.
        Parameters:
        processId -
        transitionName -
      • processTransition

        @Deprecated
        void processTransition(Id processId,
                                           java.lang.String transitionName)
        Deprecated. 
      • syncProcess

        void syncProcess(Id processId)
        The process/activity fields are typically set based on related objects. This API allows you to re-evaluate and reset the process/activity fields, such as assignees, subscribers, process owners, due dates, and criticality.
        Parameters:
        processId -
      • setAssignees

        void setAssignees(Id activityInstanceId,
                          java.util.List<java.lang.String> newAssignees,
                          boolean append)
        Sets the list of assignees on the given activity instance.
        Parameters:
        activityInstanceId -
        newAssignees -
        append -
      • terminateProcesses

        void terminateProcesses(java.util.Set<Id> processIds)
        Terminates the given processes and any active activities.
        Parameters:
        processIds -
      • getWorkflowFactory

        IWorkflowFactory getWorkflowFactory()
        Returns a new workflow factory object.
        Returns:
      • validateCustomActionClass

        void validateCustomActionClass(java.lang.String className)
        Validates that the action class can be instantiated and properly extends AbstractCustomAction
        Parameters:
        className -
      • evaluateCondition

        boolean evaluateCondition(IWFConditionEval conditionEval,
                                  Id resourceId)
        Evaluates condition in the context of specified resource that does not necessarily have active workflow. TODO - migrate this API to new service
        Parameters:
        conditionEval -
        resourceId -
        Returns:
        true if the condition is met
        Since:
        8.1
      • startProcessesInBulk

        Id startProcessesInBulk(StartProcessesOptions wfOptions)
        Starts workflow process on any objects that meet the following criteria, through a long running process - on the object type referred by the process definition - there is no active workflow on the object - object is unlocked - the object meets the applicability criteria of the process definition
        Parameters:
        wfOptions -
        Since:
        8.1
      • estimateStartingProcessesInBulk

        int estimateStartingProcessesInBulk(Id processDefinitionId)
        Returns estimated count that would meet the criteria to start the workflow processes in bulk
        Parameters:
        processDefinitionId -
        Since:
        8.1

Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.