Interface WorkObjectService

All Known Implementing Classes:
WorkObjectServiceImpl

public interface WorkObjectService
Author:
Tijs Rademakers
  • Method Details

    • updateVariable

      void updateVariable​(java.lang.String workObjectId, java.lang.String name, java.lang.Object value)
      Updates/creates a variable for a given workObject
      Parameters:
      workObjectId - workObject identifier
      name - variable name
      value - new variable value
    • removeVariable

      void removeVariable​(java.lang.String workObjectId, java.lang.String name)
      Removes variable from a given workObject
      Parameters:
      workObjectId - workObject identifier
      name - of the variable to remove
    • createWorkObjectQuery

      WorkObjectQuery createWorkObjectQuery()
      Creates a new WorkObjectQuery instance, that can be used to query the runtime work objects.
    • createWorkObject

      WorkObject createWorkObject​(java.lang.String definitionKey, java.lang.String parentId, java.lang.String parentType, java.lang.String tenantId)
      Creates new WorkObject according to provided definitionKey. DefinitionKey identifies the latest version of the WorkObjectDefinition
      Parameters:
      definitionKey - definition according which new workObject will be created
      parentId - workObject is created as a child of the parent
      parentType - parent reference type identifier
      tenantId - tenantId which is used to determine definition
      Returns:
      workObject created according to definition
    • updateWorkObject

      WorkObject updateWorkObject​(WorkObject workObject)
      Based on the WorkObject.getId() update workObject attributes. To update workObject variable use updateVariable(String, String, Object)
      Parameters:
      workObject - work object to update
      Returns:
      updated work object
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - in the case when work Object was not found
    • createWorkObjectUpdater

      WorkObjectUpdater createWorkObjectUpdater​(WorkObject workObject)
    • deleteWorkObject

      void deleteWorkObject​(java.lang.String workObjectId)
      Deletes work object
      Parameters:
      workObjectId - work object identifier
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - n the case when work object does not exist
    • getFirstWorkObjectId

      java.lang.String getFirstWorkObjectId​(java.lang.String underlyingObjectId, java.lang.String underlyingObjectType)
      Fetch the first WorkObject id from the underlying object type.
      Parameters:
      underlyingObjectId - underlying object identifier
      underlyingObjectType - underlying object relation ship descriptor
      Returns:
      the first WorkObject id which is the parent of the specified underlying object
    • addUserIdentityLink

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

      void addGroupIdentityLink​(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)
      Involves a group with a work object. The type of identityLink is defined by the given identityLink.
      Parameters:
      workObjectId - id of the work object, cannot be null.
      groupId - id of the group to involve, cannot be null.
      identityLinkType - type of identity, cannot be null (@see IdentityLinkType).
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the work object or group doesn't exist.
    • addParticipantUser

      void addParticipantUser​(java.lang.String workObjectId, java.lang.String userId)
      Convenience shorthand for addUserIdentityLink(String, String, String); with type IdentityLinkType.CANDIDATE
      Parameters:
      workObjectId - id of the work object, cannot be null.
      userId - id of the user to use as candidate, cannot be null.
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or user doesn't exist.
    • addParticipantGroup

      void addParticipantGroup​(java.lang.String workObjectId, java.lang.String groupId)
      Convenience shorthand for addGroupIdentityLink(String, String, String); with type IdentityLinkType.PARTICIPANT
      Parameters:
      workObjectId - id of the work object, cannot be null.
      groupId - id of the group to use as candidate, cannot be null.
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or group doesn't exist.
    • deleteParticipantUser

      void deleteParticipantUser​(java.lang.String workObjectId, java.lang.String userId)
      Convenience shorthand for deleteUserIdentityLink(String, String, String); with type IdentityLinkType.PARTICIPANT
      Parameters:
      workObjectId - id of the work object, cannot be null.
      userId - id of the user to use as candidate, cannot be null.
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or user doesn't exist.
    • deleteParticipantGroup

      void deleteParticipantGroup​(java.lang.String workObjectId, java.lang.String groupId)
      Convenience shorthand for deleteGroupIdentityLink(String, String, String); with type IdentityLinkType.PARTICIPANT
      Parameters:
      workObjectId - id of the work object, cannot be null.
      groupId - id of the group to use as candidate, cannot be null.
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or group doesn't exist.
    • deleteUserIdentityLink

      void deleteUserIdentityLink​(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)
      Removes the association between a user and a work object for the given identityLinkType.
      Parameters:
      workObjectId - id of the work object, cannot be null.
      userId - id of the user involve, cannot be null.
      identityLinkType - type of identityLink, cannot be null (@see IdentityLinkType).
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or user doesn't exist.
    • deleteGroupIdentityLink

      void deleteGroupIdentityLink​(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)
      Removes the association between a group and a work object for the given identityLinkType.
      Parameters:
      workObjectId - id of the work object, cannot be null.
      groupId - id of the group to involve, cannot be null.
      identityLinkType - type of identity, cannot be null (@see IdentityLinkType).
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the task or group doesn't exist.
    • getIdentityLinksForWorkObject

      java.util.List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForWorkObject​(java.lang.String instanceId)
      Retrieves the IdentityLinks associated with the given work object. Such an IdentityLink informs how a certain user is involved with a work object.
    • getParentId

      java.lang.String getParentId​(java.lang.String workObjectId)
      Gets parent identifier for the given workObjectId
      Parameters:
      workObjectId - child object identifier
      Returns:
      parent workObject identifier or null in the case when workObject is root already
      Throws:
      org.flowable.common.engine.api.FlowableObjectNotFoundException - when the child workObject does not exist.