Class AbstractCaseInstanceIdentityLinkCmd

java.lang.Object
org.flowable.cmmn.engine.impl.cmd.AbstractCaseInstanceIdentityLinkCmd
Direct Known Subclasses:
RemoveCaseInstanceAssigneeCmd, RemoveCaseInstanceOwnerCmd, SetCaseInstanceAssigneeCmd, SetCaseInstanceOwnerCmd

public abstract class AbstractCaseInstanceIdentityLinkCmd extends Object
An abstract command supporting functionality around identity link management for case instances.
Author:
Micha Kiener
  • Constructor Details

    • AbstractCaseInstanceIdentityLinkCmd

      public AbstractCaseInstanceIdentityLinkCmd()
  • Method Details

    • getCaseInstanceEntity

      protected CaseInstanceEntity getCaseInstanceEntity(CommandContext commandContext, String caseInstanceId)
      Returns the case instance entity for the given id, if it exists, otherwise an exception will be thrown.
      Parameters:
      commandContext - the command context within which the case instance is loaded
      caseInstanceId - the id of the case instance to be loaded
      Returns:
      the case instance entity, if found, never null
      Throws:
      FlowableIllegalArgumentException - if the provided case instance id is not valid (could not be found)
    • removeIdentityLinkType

      protected void removeIdentityLinkType(CommandContext commandContext, String caseInstanceId, String identityType)
      This will remove ALL identity links with the given type, no mather whether they are user or group based.
      Parameters:
      commandContext - the command context within which to remove the identity links
      caseInstanceId - the id of the case instance to remove the identity links for
      identityType - the identity link type (e.g. assignee or owner, etc) to be removed
    • createIdentityLinkType

      protected void createIdentityLinkType(CommandContext commandContext, String caseInstanceId, String userId, String groupId, String identityType)
      Creates a new identity link entry for the given case instance, which can either be a user or group based one, but not both the same time. If both the user and group ids are null, no new identity link is created.
      Parameters:
      commandContext - the command context within which to perform the identity link creation
      caseInstanceId - the id of the case instance to create an identity link for
      userId - the user id if this is a user based identity link, otherwise null
      groupId - the group id if this is a group based identity link, otherwise null
      identityType - the type of identity link (e.g. owner or assignee, etc)