Interface CmmnRuntimeService


  • public interface CmmnRuntimeService
    Author:
    Joram Barrez
    • Method Detail

      • triggerPlanItemInstance

        void triggerPlanItemInstance​(String planItemInstanceId)
      • enablePlanItemInstance

        void enablePlanItemInstance​(String planItemInstanceId)
      • startPlanItemInstance

        void startPlanItemInstance​(String planItemInstanceId)
      • disablePlanItemInstance

        void disablePlanItemInstance​(String planItemInstanceId)
      • completeStagePlanItemInstance

        void completeStagePlanItemInstance​(String planItemInstanceId)
      • completeStagePlanItemInstance

        void completeStagePlanItemInstance​(String planItemInstanceId,
                                           boolean force)
      • completeCaseInstance

        void completeCaseInstance​(String caseInstanceId)
      • terminateCaseInstance

        void terminateCaseInstance​(String caseInstanceId)
      • bulkTerminateCaseInstances

        void bulkTerminateCaseInstances​(Collection<String> caseInstanceId)
      • terminatePlanItemInstance

        void terminatePlanItemInstance​(String planItemInstanceId)
      • deleteCaseInstance

        void deleteCaseInstance​(String caseInstanceId)
      • bulkDeleteCaseInstances

        void bulkDeleteCaseInstances​(Collection<String> caseInstanceId)
      • evaluateCriteria

        void evaluateCriteria​(String caseInstanceId)
      • completeGenericEventListenerInstance

        void completeGenericEventListenerInstance​(String genericEventListenerInstanceId)
      • completeUserEventListenerInstance

        void completeUserEventListenerInstance​(String userEventListenerInstanceId)
      • getVariables

        Map<String,​Object> getVariables​(String caseInstanceId)
        All variables visible from the given case instance scope.
        Parameters:
        caseInstanceId - id of case instance, cannot be null.
        Returns:
        the variables or an empty map if no such variables are found.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no case instance is found for the given caseInstanceId.
      • getVariableInstances

        Map<String,​org.flowable.variable.api.persistence.entity.VariableInstance> getVariableInstances​(String caseInstanceId)
        All variables visible from the given case instance scope.
        Parameters:
        caseInstanceId - id of case instance, cannot be null.
        Returns:
        the variable instances or an empty map if no such variables are found.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no case instance is found for the given caseInstanceId.
      • getLocalVariables

        Map<String,​Object> getLocalVariables​(String planItemInstanceId)
        All variable values that are defined in the plan item instance scope, without taking outer scopes into account.
        Parameters:
        planItemInstanceId - id of plan item instance, cannot be null.
        Returns:
        the variables or an empty map if no such variables are found.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no plan item instance is found for the given planItemInstanceId.
      • getLocalVariableInstances

        Map<String,​org.flowable.variable.api.persistence.entity.VariableInstance> getLocalVariableInstances​(String planItemInstanceId)
        All variable values that are defined in the plan item instance scope, without taking outer scopes into account.
        Parameters:
        planItemInstanceId - id of plan item instance, cannot be null.
        Returns:
        the variables or an empty map if no such variables are found.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no plan item instance is found for the given planItemInstanceId.
      • getVariable

        Object getVariable​(String caseInstanceId,
                           String variableName)
        The variable value. Returns null when no variable value is found with the given name or when the value is set to null.
        Parameters:
        caseInstanceId - id of case instance, cannot be null.
        variableName - name of variable, cannot be null.
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no case instance is found for the given caseInstanceId.
      • getVariableInstance

        org.flowable.variable.api.persistence.entity.VariableInstance getVariableInstance​(String caseInstanceId,
                                                                                          String variableName)
        The variable. Returns null when no variable value is found with the given name or when the value is set to null.
        Parameters:
        caseInstanceId - id of case instance, cannot be null.
        variableName - name of variable, cannot be null.
        Returns:
        the variable or null if the variable is undefined.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no case instance is found for the given caseInstanceId.
      • getLocalVariable

        Object getLocalVariable​(String planItemInstanceId,
                                String variableName)
        The local variable value. Returns null when no variable value is found with the given name or when the value is set to null.
        Parameters:
        planItemInstanceId - id of plan item instance, cannot be null.
        variableName - name of variable, cannot be null.
        Returns:
        the variable value or null if the variable is undefined or the value of the variable is null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no plan item instance is found for the given planItemInstanceId.
      • getLocalVariableInstance

        org.flowable.variable.api.persistence.entity.VariableInstance getLocalVariableInstance​(String planItemInstanceId,
                                                                                               String variableName)
        The local variable. Returns null when no variable value is found with the given name or when the value is set to null.
        Parameters:
        planItemInstanceId - id of plan item instance, cannot be null.
        variableName - name of variable, cannot be null.
        Returns:
        the variable or null if the variable is undefined.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when no plan item instance is found for the given planItemInstanceId.
      • hasVariable

        boolean hasVariable​(String caseInstanceId,
                            String variableName)
        Check whether or not this case instance has variable set with the given name, Searching for the variable is done in all scopes that are visible to the given case instance.
      • hasLocalVariable

        boolean hasLocalVariable​(String planItemInstanceId,
                                 String variableName)
        Check whether or not this plan item instance has local variable set with the given name.
      • setVariable

        void setVariable​(String caseInstanceId,
                         String variableName,
                         Object variableValue)
      • setLocalVariables

        void setLocalVariables​(String planItemInstanceId,
                               Map<String,​Object> variables)
      • setLocalVariable

        void setLocalVariable​(String planItemInstanceId,
                              String variableName,
                              Object variableValue)
      • removeVariable

        void removeVariable​(String caseInstanceId,
                            String variableName)
      • removeLocalVariable

        void removeLocalVariable​(String planItemInstanceId,
                                 String variableName)
      • removeLocalVariables

        void removeLocalVariables​(String planItemInstanceId,
                                  Collection<String> variableNames)
      • setCaseInstanceName

        void setCaseInstanceName​(String caseInstanceId,
                                 String caseName)
        Set or change the name of the case instance.
        Parameters:
        caseInstanceId - the id of the case to set the name
        caseName - the name to be set on the case
      • createEventSubscriptionQuery

        org.flowable.eventsubscription.api.EventSubscriptionQuery createEventSubscriptionQuery()
        Creates a new EventSubscriptionQuery instance, that can be used to query the event subscriptions.
      • getStageOverview

        List<StageResponse> getStageOverview​(String caseInstanceId)
        Gives back a stage overview of the case instance which includes the stage information of the case model.
        Parameters:
        caseInstanceId - id of the case instance, cannot be null.
        Returns:
        list of stage info objects
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when the case instance doesn't exist.
      • setOwner

        void setOwner​(String caseInstanceId,
                      String userId)
        Set the new owner of a case instance.
        Parameters:
        caseInstanceId - the id of the case to set its new owner
        userId - the id of the user to set as the new owner
      • removeOwner

        void removeOwner​(String caseInstanceId)
        Removes the owner of a case instance.
        Parameters:
        caseInstanceId - the id of the case to remove the owner from
      • setAssignee

        void setAssignee​(String caseInstanceId,
                         String userId)
        Set the new assignee of a case instance.
        Parameters:
        caseInstanceId - the id of the case to set its new assignee
        userId - the id of the user to set as the new assignee
      • removeAssignee

        void removeAssignee​(String caseInstanceId)
        Removes the assignee of a case instance.
        Parameters:
        caseInstanceId - the id of the case to remove the assignee from
      • addUserIdentityLink

        void addUserIdentityLink​(String caseInstanceId,
                                 String userId,
                                 String identityLinkType)
        Involves a user with a case instance. The type of identity link is defined by the given identityLinkType.
        Parameters:
        caseInstanceId - id of the case instance, cannot be null.
        userId - id of the user involve, cannot be null.
        identityLinkType - type of identityLink, cannot be null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when the case instance doesn't exist.
      • addGroupIdentityLink

        void addGroupIdentityLink​(String caseInstanceId,
                                  String groupId,
                                  String identityLinkType)
        Involves a group with a case instance. The type of identityLink is defined by the given identityLink.
        Parameters:
        caseInstanceId - id of the case instance, cannot be null.
        groupId - id of the group to involve, cannot be null.
        identityLinkType - type of identity, cannot be null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when the process instance or group doesn't exist.
      • deleteUserIdentityLink

        void deleteUserIdentityLink​(String caseInstanceId,
                                    String userId,
                                    String identityLinkType)
        Removes the association between a user and a process instance for the given identityLinkType.
        Parameters:
        caseInstanceId - id of the case instance, cannot be null.
        userId - id of the user involve, cannot be null.
        identityLinkType - type of identityLink, cannot be null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or user doesn't exist.
      • deleteGroupIdentityLink

        void deleteGroupIdentityLink​(String caseInstanceId,
                                     String groupId,
                                     String identityLinkType)
        Removes the association between a group and a process instance for the given identityLinkType.
        Parameters:
        caseInstanceId - id of the case instance, cannot be null.
        groupId - id of the group to involve, cannot be null.
        identityLinkType - type of identity, cannot be null.
        Throws:
        org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or group doesn't exist.
      • getIdentityLinksForCaseInstance

        List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForCaseInstance​(String instanceId)
        Retrieves the IdentityLinks associated with the given case instance. Such an identity link informs how a certain user is involved with a case instance.
      • getIdentityLinksForPlanItemInstance

        List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForPlanItemInstance​(String instanceId)
        Retrieves the IdentityLinks associated with the given plan item instance. Such an identity link informs how a certain user is involved with a plan item instance.
      • getEntityLinkChildrenForCaseInstance

        List<org.flowable.entitylink.api.EntityLink> getEntityLinkChildrenForCaseInstance​(String instanceId)
        Retrieves the EntityLinks associated with the given case instance.
      • getEntityLinkChildrenWithSameRootAsCaseInstance

        List<org.flowable.entitylink.api.EntityLink> getEntityLinkChildrenWithSameRootAsCaseInstance​(String instanceId)
        Retrieves all the EntityLinks associated with the same root as the given case instance.
      • getEntityLinkParentsForCaseInstance

        List<org.flowable.entitylink.api.EntityLink> getEntityLinkParentsForCaseInstance​(String instanceId)
        Retrieves the EntityLinks where the given case instance is referenced.
      • getStartFormModel

        org.flowable.form.api.FormInfo getStartFormModel​(String caseDefinitionId,
                                                         String caseInstanceId)
        Gets a Form model instance of the start form of a specific case definition or case instance
        Parameters:
        caseDefinitionId - id of case definition for which the start form should be retrieved.
        caseInstanceId - id of case instance for which the start form should be retrieved.
      • updateBusinessKey

        void updateBusinessKey​(String caseInstanceId,
                               String businessKey)
        Updates the business key for the provided case instance
        Parameters:
        caseInstanceId - id of the case instance to set the business key, cannot be null
        businessKey - new businessKey value
      • updateBusinessStatus

        void updateBusinessStatus​(String caseInstanceId,
                                  String businessStatus)
        Updates the business status for the provided case instance
        Parameters:
        caseInstanceId - id of the case instance to set the business status, cannot be null
        businessStatus - new business status value
      • addEventListener

        void addEventListener​(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd)
        Adds an event-listener which will be notified of ALL events by the dispatcher.
        Parameters:
        listenerToAdd - the listener to add
      • addEventListener

        void addEventListener​(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToAdd,
                              org.flowable.common.engine.api.delegate.event.FlowableEngineEventType... types)
        Adds an event-listener which will only be notified when an event occurs, which type is in the given types.
        Parameters:
        listenerToAdd - the listener to add
        types - types of events the listener should be notified for
      • removeEventListener

        void removeEventListener​(org.flowable.common.engine.api.delegate.event.FlowableEventListener listenerToRemove)
        Removes the given listener from this dispatcher. The listener will no longer be notified, regardless of the type(s) it was registered for in the first place.
        Parameters:
        listenerToRemove - listener to remove
      • dispatchEvent

        void dispatchEvent​(org.flowable.common.engine.api.delegate.event.FlowableEvent event)
        Dispatches the given event to any listeners that are registered.
        Parameters:
        event - event to dispatch.
        Throws:
        org.flowable.common.engine.api.FlowableException - if an exception occurs when dispatching the event or when the FlowableEventDispatcher is disabled.
        org.flowable.common.engine.api.FlowableIllegalArgumentException - when the given event is not suitable for dispatching.