Class ImmutableIncidentRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableIncidentRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, IncidentRecordValue, ProcessInstanceRelated, TenantOwned

public final class ImmutableIncidentRecordValue extends Object implements IncidentRecordValue
Immutable implementation of IncidentRecordValue.

Use the builder to create immutable instances: ImmutableIncidentRecordValue.builder().

  • Method Details

    • getTenantId

      public String getTenantId()
      Returns the identifier of the tenant that owns this entity.
      Specified by:
      getTenantId in interface TenantOwned
    • getErrorType

      public ErrorType getErrorType()
      Specified by:
      getErrorType in interface IncidentRecordValue
      Returns:
      the type of error this incident is caused by. Can be UNKNOWN if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getErrorMessage

      public String getErrorMessage()
      Specified by:
      getErrorMessage in interface IncidentRecordValue
      Returns:
      the description of the error this incident is caused by. Can be empty if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getBpmnProcessId

      public String getBpmnProcessId()
      Specified by:
      getBpmnProcessId in interface IncidentRecordValue
      Returns:
      the BPMN process id this incident belongs to. Can be empty if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface IncidentRecordValue
      Returns:
      the key of the process this incident belongs to. Can be -1 if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getProcessInstanceKey

      public long getProcessInstanceKey()
      Specified by:
      getProcessInstanceKey in interface IncidentRecordValue
      Specified by:
      getProcessInstanceKey in interface ProcessInstanceRelated
      Returns:
      the key of the process instance this incident belongs to. Can be -1 if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getElementId

      public String getElementId()
      Specified by:
      getElementId in interface IncidentRecordValue
      Returns:
      the id of the element this incident belongs to. Can be empty if incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getElementInstanceKey

      public long getElementInstanceKey()
      Specified by:
      getElementInstanceKey in interface IncidentRecordValue
      Returns:
      the key of the element instance this incident belongs to. Can be -1 if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getJobKey

      public long getJobKey()
      Specified by:
      getJobKey in interface IncidentRecordValue
      Returns:
      the key of the job this incident belongs to. Can be -1 if the incident belongs to no job or the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getVariableScopeKey

      public long getVariableScopeKey()
      Specified by:
      getVariableScopeKey in interface IncidentRecordValue
      Returns:
      the key of the variable scope on which the variables need to be updated. Can be -1 if the incident record is part of a
      invalid reference
      IncidentIntent#RESOLVE
      command.
    • getElementInstancePath

      public List<List<Long>> getElementInstancePath()
      Specified by:
      getElementInstancePath in interface IncidentRecordValue
      Returns:
      tree path information about all element instances in the call hierarchy leading to an incident. It contains an entry per process instance in the hierarchy of the incident, each contains all the instance keys of all the elements in the call hierarchy within this process instance
    • getProcessDefinitionPath

      public List<Long> getProcessDefinitionPath()
      Specified by:
      getProcessDefinitionPath in interface IncidentRecordValue
      Returns:
      tree path information for all process definitions in the hierarchy of the incident. Each entry is a process definition key for the corresponding process instance
    • getCallingElementPath

      public List<Integer> getCallingElementPath()
      Specified by:
      getCallingElementPath in interface IncidentRecordValue
      Returns:
      tree path information about call activities in the hierarchy of the incident. Each entry is a reference to the call activity in BPMN model containing an incident.
    • withTenantId

      public final ImmutableIncidentRecordValue withTenantId(String value)
      Copy the current immutable object by setting a value for the tenantId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for tenantId (can be null)
      Returns:
      A modified copy of the this object
    • withErrorType

      public final ImmutableIncidentRecordValue withErrorType(ErrorType value)
      Copy the current immutable object by setting a value for the errorType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for errorType (can be null)
      Returns:
      A modified copy of the this object
    • withErrorMessage

      public final ImmutableIncidentRecordValue withErrorMessage(String value)
      Copy the current immutable object by setting a value for the errorMessage attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for errorMessage (can be null)
      Returns:
      A modified copy of the this object
    • withBpmnProcessId

      public final ImmutableIncidentRecordValue withBpmnProcessId(String value)
      Copy the current immutable object by setting a value for the bpmnProcessId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for bpmnProcessId (can be null)
      Returns:
      A modified copy of the this object
    • withProcessDefinitionKey

      public final ImmutableIncidentRecordValue withProcessDefinitionKey(long value)
      Copy the current immutable object by setting a value for the processDefinitionKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for processDefinitionKey
      Returns:
      A modified copy of the this object
    • withProcessInstanceKey

      public final ImmutableIncidentRecordValue withProcessInstanceKey(long value)
      Copy the current immutable object by setting a value for the processInstanceKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for processInstanceKey
      Returns:
      A modified copy of the this object
    • withElementId

      public final ImmutableIncidentRecordValue withElementId(String value)
      Copy the current immutable object by setting a value for the elementId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for elementId (can be null)
      Returns:
      A modified copy of the this object
    • withElementInstanceKey

      public final ImmutableIncidentRecordValue withElementInstanceKey(long value)
      Copy the current immutable object by setting a value for the elementInstanceKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for elementInstanceKey
      Returns:
      A modified copy of the this object
    • withJobKey

      public final ImmutableIncidentRecordValue withJobKey(long value)
      Copy the current immutable object by setting a value for the jobKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for jobKey
      Returns:
      A modified copy of the this object
    • withVariableScopeKey

      public final ImmutableIncidentRecordValue withVariableScopeKey(long value)
      Copy the current immutable object by setting a value for the variableScopeKey attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for variableScopeKey
      Returns:
      A modified copy of the this object
    • withElementInstancePath

      @SafeVarargs public final ImmutableIncidentRecordValue withElementInstancePath(List<Long>... elements)
      Copy the current immutable object with elements that replace the content of elementInstancePath.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withElementInstancePath

      public final ImmutableIncidentRecordValue withElementInstancePath(Iterable<? extends List<Long>> elements)
      Copy the current immutable object with elements that replace the content of elementInstancePath. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of elementInstancePath elements to set
      Returns:
      A modified copy of this object
    • withProcessDefinitionPath

      public final ImmutableIncidentRecordValue withProcessDefinitionPath(Long... elements)
      Copy the current immutable object with elements that replace the content of processDefinitionPath.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withProcessDefinitionPath

      public final ImmutableIncidentRecordValue withProcessDefinitionPath(Iterable<? extends Long> elements)
      Copy the current immutable object with elements that replace the content of processDefinitionPath. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of processDefinitionPath elements to set
      Returns:
      A modified copy of this object
    • withCallingElementPath

      public final ImmutableIncidentRecordValue withCallingElementPath(Integer... elements)
      Copy the current immutable object with elements that replace the content of callingElementPath.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCallingElementPath

      public final ImmutableIncidentRecordValue withCallingElementPath(Iterable<? extends Integer> elements)
      Copy the current immutable object with elements that replace the content of callingElementPath. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of callingElementPath elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableIncidentRecordValue that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Returns a lazily computed hash code from attributes: tenantId, errorType, errorMessage, bpmnProcessId, processDefinitionKey, processInstanceKey, elementId, elementInstanceKey, jobKey, variableScopeKey, elementInstancePath, processDefinitionPath, callingElementPath.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value IncidentRecordValue with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableIncidentRecordValue copyOf(IncidentRecordValue instance)
      Creates an immutable copy of a IncidentRecordValue value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable IncidentRecordValue instance
    • builder

      public static ImmutableIncidentRecordValue.Builder builder()
      Creates a builder for ImmutableIncidentRecordValue.
       ImmutableIncidentRecordValue.builder()
          .withTenantId(String | null) // nullable tenantId
          .withErrorType(io.camunda.zeebe.protocol.record.value.ErrorType | null) // nullable errorType
          .withErrorMessage(String | null) // nullable errorMessage
          .withBpmnProcessId(String | null) // nullable bpmnProcessId
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withElementId(String | null) // nullable elementId
          .withElementInstanceKey(long) // optional elementInstanceKey
          .withJobKey(long) // optional jobKey
          .withVariableScopeKey(long) // optional variableScopeKey
          .addElementInstancePath|addAllElementInstancePath(List&lt;Long&gt;) // elementInstancePath elements
          .addProcessDefinitionPath|addAllProcessDefinitionPath(Long) // processDefinitionPath elements
          .addCallingElementPath|addAllCallingElementPath(Integer) // callingElementPath elements
          .build();
       
      Returns:
      A new ImmutableIncidentRecordValue builder