Class ImmutableDecisionEvaluationRecordValue

java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableDecisionEvaluationRecordValue
All Implemented Interfaces:
JsonSerializable, RecordValue, RecordValueWithVariables, DecisionEvaluationRecordValue

@ParametersAreNonnullByDefault @Immutable public final class ImmutableDecisionEvaluationRecordValue extends Object implements DecisionEvaluationRecordValue
Immutable implementation of DecisionEvaluationRecordValue.

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

  • Method Details

    • getVariables

      public Map<String,Object> getVariables()
      Specified by:
      getVariables in interface RecordValueWithVariables
      Returns:
      the variables of this record. Can be empty.
    • getDecisionKey

      public long getDecisionKey()
      Specified by:
      getDecisionKey in interface DecisionEvaluationRecordValue
      Returns:
      the key of the evaluated decision
    • getDecisionId

      public String getDecisionId()
      Specified by:
      getDecisionId in interface DecisionEvaluationRecordValue
      Returns:
      the id of the evaluated decision in the DMN
    • getDecisionName

      public String getDecisionName()
      Specified by:
      getDecisionName in interface DecisionEvaluationRecordValue
      Returns:
      the name of the evaluated decision in the DMN
    • getDecisionVersion

      public int getDecisionVersion()
      Specified by:
      getDecisionVersion in interface DecisionEvaluationRecordValue
      Returns:
      the version of the evaluated decision
    • getDecisionRequirementsId

      public String getDecisionRequirementsId()
      Specified by:
      getDecisionRequirementsId in interface DecisionEvaluationRecordValue
      Returns:
      the id of the DRG in the DMN the evaluated decision belongs to
    • getDecisionRequirementsKey

      public long getDecisionRequirementsKey()
      Specified by:
      getDecisionRequirementsKey in interface DecisionEvaluationRecordValue
      Returns:
      the key of the deployed DRG the evaluated decision belongs to
    • getDecisionOutput

      public String getDecisionOutput()
      Specified by:
      getDecisionOutput in interface DecisionEvaluationRecordValue
      Returns:
      the output of the evaluated decision as JSON string
    • getBpmnProcessId

      public String getBpmnProcessId()
      Specified by:
      getBpmnProcessId in interface DecisionEvaluationRecordValue
      Returns:
      the BPMN process id in which context the decision was evaluated
    • getProcessDefinitionKey

      public long getProcessDefinitionKey()
      Specified by:
      getProcessDefinitionKey in interface DecisionEvaluationRecordValue
      Returns:
      the key of the process in which context the decision was evaluated
    • getProcessInstanceKey

      public long getProcessInstanceKey()
      Specified by:
      getProcessInstanceKey in interface DecisionEvaluationRecordValue
      Returns:
      the key of the process instance in which context the decision was evaluated
    • getElementId

      public String getElementId()
      Specified by:
      getElementId in interface DecisionEvaluationRecordValue
      Returns:
      the id of the element in the BPMN in which context the decision was evaluated
    • getElementInstanceKey

      public long getElementInstanceKey()
      Specified by:
      getElementInstanceKey in interface DecisionEvaluationRecordValue
      Returns:
      the key of the element instance in which context the decision was evaluated
    • getEvaluatedDecisions

      public List<EvaluatedDecisionValue> getEvaluatedDecisions()
      Returns the details of the evaluated decision and its required decisions. The order depends on the evaluation order, starting from the required decisions.
      Specified by:
      getEvaluatedDecisions in interface DecisionEvaluationRecordValue
      Returns:
      details of the evaluated decisions
    • getEvaluationFailureMessage

      public String getEvaluationFailureMessage()
      If the evaluation of the decision failed then it returns the reason why the evaluation of the failed decision was not successful. The failure message is not available if the decision was evaluated successfully.
      Specified by:
      getEvaluationFailureMessage in interface DecisionEvaluationRecordValue
      Returns:
      the failure message why the evaluation failed, or an empty string if the evaluation was successful
    • getFailedDecisionId

      public String getFailedDecisionId()
      If the evaluation of the decision failed then it returns the id of the decision where the evaluation failed. It can be the called/root decision or any of its required decisions. The reason of the failure can be retrieved as evaluation failure message. The decision id is not available if the decision was evaluated successfully.
      Specified by:
      getFailedDecisionId in interface DecisionEvaluationRecordValue
      Returns:
      the id of the decision in the DMN where the evaluation failed, or an empty string if the evaluation was successful
    • withVariables

      public final ImmutableDecisionEvaluationRecordValue withVariables(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the variables map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the variables map
      Returns:
      A modified copy of this object
    • withDecisionKey

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

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

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

      public final ImmutableDecisionEvaluationRecordValue withDecisionVersion(int value)
      Copy the current immutable object by setting a value for the decisionVersion attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for decisionVersion
      Returns:
      A modified copy of the this object
    • withDecisionRequirementsId

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

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

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

      public final ImmutableDecisionEvaluationRecordValue 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 ImmutableDecisionEvaluationRecordValue 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 ImmutableDecisionEvaluationRecordValue 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 ImmutableDecisionEvaluationRecordValue 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 ImmutableDecisionEvaluationRecordValue 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
    • withEvaluatedDecisions

      public final ImmutableDecisionEvaluationRecordValue withEvaluatedDecisions(EvaluatedDecisionValue... elements)
      Copy the current immutable object with elements that replace the content of evaluatedDecisions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEvaluatedDecisions

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDecisionEvaluationRecordValue 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: variables, decisionKey, decisionId, decisionName, decisionVersion, decisionRequirementsId, decisionRequirementsKey, decisionOutput, bpmnProcessId, processDefinitionKey, processInstanceKey, elementId, elementInstanceKey, evaluatedDecisions, evaluationFailureMessage, failedDecisionId.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      Creates an immutable copy of a DecisionEvaluationRecordValue 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 DecisionEvaluationRecordValue instance
    • builder

      Creates a builder for ImmutableDecisionEvaluationRecordValue.
       ImmutableDecisionEvaluationRecordValue.builder()
          .putVariable|putAllVariables(String => Object) // variables mappings
          .withDecisionKey(long) // optional decisionKey
          .withDecisionId(String | null) // nullable decisionId
          .withDecisionName(String | null) // nullable decisionName
          .withDecisionVersion(int) // optional decisionVersion
          .withDecisionRequirementsId(String | null) // nullable decisionRequirementsId
          .withDecisionRequirementsKey(long) // optional decisionRequirementsKey
          .withDecisionOutput(String | null) // nullable decisionOutput
          .withBpmnProcessId(String | null) // nullable bpmnProcessId
          .withProcessDefinitionKey(long) // optional processDefinitionKey
          .withProcessInstanceKey(long) // optional processInstanceKey
          .withElementId(String | null) // nullable elementId
          .withElementInstanceKey(long) // optional elementInstanceKey
          .addEvaluatedDecision|addAllEvaluatedDecisions(io.camunda.zeebe.protocol.record.value.EvaluatedDecisionValue) // evaluatedDecisions elements
          .withEvaluationFailureMessage(String | null) // nullable evaluationFailureMessage
          .withFailedDecisionId(String | null) // nullable failedDecisionId
          .build();
       
      Returns:
      A new ImmutableDecisionEvaluationRecordValue builder