Interface ModifyProcessInstanceCommandStep1

All Superinterfaces:
CommandWithCommunicationApiStep<ModifyProcessInstanceCommandStep1>
All Known Implementing Classes:
ModifyProcessInstanceCommandImpl

public interface ModifyProcessInstanceCommandStep1 extends CommandWithCommunicationApiStep<ModifyProcessInstanceCommandStep1>
  • Method Details

    • activateElement

      Create an activate instruction for the given element id.

      The element will be created within an existing element instance of the flow scope. When activating an element inside a multi-instance element the element instance key of the ancestor must be defined. For this use activateElement(String, long).

      Parameters:
      elementId - the id of the element to activate
      Returns:
      the builder for this command
    • activateElement

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 activateElement(String elementId, long ancestorElementInstanceKey)
      Create an activate instruction for the given element id.

      The element will be created within the scope that is passed. This scope must be an ancestor of the element that's getting activated.

      Parameters:
      elementId - the id of the element to activate
      ancestorElementInstanceKey - the element instance key in which the element will be created
      Returns:
      the builder for this command
    • terminateElement

      Create a terminate instruction for the given element instance key.
      Parameters:
      elementInstanceKey - the element instance key of the element to terminate
      Returns:
      the builder for this command
    • terminateElements

      Create a terminate instruction for the given element id. The element instances will be determined at runtime.
      Parameters:
      elementId - the id of the elements to terminate
      Returns:
      the builder for this command
    • moveElements

      Create a move instruction for the given element ids. The element instances will be determined at runtime. All source element instances will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      The elements will be created within an existing element instance of the flow scope. When activating elements inside a multi-instance element, the element instance key of the ancestor must be defined. For this, use moveElements(String, String, long) or moveElementsWithInferredAncestor(String, String).

      Parameters:
      sourceElementId - the id of the elements to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command
    • moveElements

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElements(String sourceElementId, String targetElementId, long ancestorElementInstanceKey)
      Create a move instruction for the given element ids. The element instances will be determined at runtime. All source element instances will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      The elements will be created within the scope that is passed. This scope must be an ancestor of the elements that are getting activated.

      Parameters:
      sourceElementId - the id of the elements to move
      targetElementId - the id of target element to move to
      ancestorElementInstanceKey - the element instance key in which the elements will be created
      Returns:
      the builder for this command
    • moveElementsWithInferredAncestor

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElementsWithInferredAncestor(String sourceElementId, String targetElementId)
      Create a move instruction for the given element ids. The element instances will be determined at runtime. All source element instances will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      This instructs the engine to derive the ancestor scope keys from the source element's hierarchy. The engine traverses the source element's ancestry to find an instance that matches one of the target element's flow scopes, ensuring the target is activated in the correct scope.

      Parameters:
      sourceElementId - the id of the elements to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command
    • moveElementsWithSourceParentAsAncestor

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElementsWithSourceParentAsAncestor(String sourceElementId, String targetElementId)
      Create a move instruction for the given element ids. The element instances will be determined at runtime. All source element instances will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      This instructs the engine to use the source's direct parent key as the ancestor scope key for the target element. This is a simpler alternative to moveElementsWithInferredAncestor(String, String) that skips hierarchy traversal and directly uses the source's parent key. This is useful when source and target elements are siblings within the same flow scope.

      Parameters:
      sourceElementId - the id of the elements to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command
    • moveElement

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElement(long sourceElementInstanceKey, String targetElementId)
      Create a move instruction for the given element instance. This source element instance will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      The target element will be created within an existing element instance of the flow scope. When activating elements inside a multi-instance element, the element instance key of the ancestor must be defined. For this, use moveElement(long, String, long) or moveElementWithInferredAncestor(long, String).

      Parameters:
      sourceElementInstanceKey - the key of the element to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command
    • moveElement

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElement(long sourceElementInstanceKey, String targetElementId, long ancestorElementInstanceKey)
      Create a move instruction for the given element instance. the source element instance with given key will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      The target element will be created within the scope that is passed. This scope must be an ancestor of the elements that are getting activated.

      Parameters:
      sourceElementInstanceKey - the key of the element to move
      targetElementId - the id of target element to move to
      ancestorElementInstanceKey - the element instance key in which the elements will be created
      Returns:
      the builder for this command
    • moveElementWithInferredAncestor

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElementWithInferredAncestor(long sourceElementInstanceKey, String targetElementId)
      Create a move instruction for the given element instance. The source element instance with * given key will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      This instructs the engine to derive the ancestor scope key from the source element's hierarchy. The engine traverses the source element's ancestry to find an instance that matches one of the target element's flow scopes, ensuring the target is activated in the correct scope.

      Parameters:
      sourceElementInstanceKey - the key of the element to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command
    • moveElementWithSourceParentAsAncestor

      ModifyProcessInstanceCommandStep1.ModifyProcessInstanceCommandStep3 moveElementWithSourceParentAsAncestor(long sourceElementInstanceKey, String targetElementId)
      Create a move instruction for the given element instance. The source element instance with given key will be terminated and will activate a new one at the target element id. For multi-instance elements, only the body element will activate a new element instance.

      This instructs the engine to use the source's direct parent key as the ancestor scope key for the target element. This is a simpler alternative to moveElementWithInferredAncestor(long, String) that skips hierarchy traversal and directly uses the source's parent key. This is useful when source and target elements are siblings within the same flow scope.

      Parameters:
      sourceElementInstanceKey - the key of the element to move
      targetElementId - the id of target element to move to
      Returns:
      the builder for this command