Class UserTaskInstanceResponder

java.lang.Object
io.taktx.client.UserTaskInstanceResponder

public class UserTaskInstanceResponder extends Object
A responder for user task instances that allows sending success, escalation, or error responses back to the process instance via Kafka.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UserTaskInstanceResponder(org.apache.kafka.clients.producer.KafkaProducer<UUID,io.taktx.dto.ContinueFlowElementTriggerDTO> responseEmitter, String topicName, UUID processInstanceId, List<Long> elementInstanceIdPath)
    Constructs a UserTaskInstanceResponder.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    respondError(String code, String message)
    Sends an error response with the provided code and message, and no variables.
    void
    respondError(String code, String message, io.taktx.dto.VariablesDTO variables)
    Sends an error response with the provided code and message, and optional variables.
    void
    Sends an escalation response with the provided code and message, and no variables.
    void
    respondEscalation(String code, String message, io.taktx.dto.VariablesDTO variables)
    Sends an escalation response with the provided code, message, and variables.
    void
    Sends a success response with no variables.
    void
    Sends a success response with the provided variables.
    void
    respondSuccess(Map<String,com.fasterxml.jackson.databind.JsonNode> variablesMap)
    Sends a success response with the provided variables map.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • UserTaskInstanceResponder

      public UserTaskInstanceResponder(org.apache.kafka.clients.producer.KafkaProducer<UUID,io.taktx.dto.ContinueFlowElementTriggerDTO> responseEmitter, String topicName, UUID processInstanceId, List<Long> elementInstanceIdPath)
      Constructs a UserTaskInstanceResponder.
      Parameters:
      responseEmitter - the Kafka producer used to send responses
      topicName - the name of the Kafka topic to send responses to
      processInstanceId - the ID of the process instance associated with the user task
      elementInstanceIdPath - the path of element instance IDs leading to the user task
  • Method Details

    • respondSuccess

      public void respondSuccess()
      Sends a success response with no variables.
    • respondSuccess

      public void respondSuccess(Object variable)
      Sends a success response with the provided variables.
      Parameters:
      variable - the variables to include in the response, can be null
    • respondSuccess

      public void respondSuccess(Map<String,com.fasterxml.jackson.databind.JsonNode> variablesMap)
      Sends a success response with the provided variables map.
      Parameters:
      variablesMap - the map of variable names to JsonNode values
    • respondEscalation

      public void respondEscalation(String code, String message)
      Sends an escalation response with the provided code and message, and no variables.
      Parameters:
      code - the escalation code
      message - the escalation message
    • respondEscalation

      public void respondEscalation(String code, String message, io.taktx.dto.VariablesDTO variables)
      Sends an escalation response with the provided code, message, and variables.
      Parameters:
      code - the escalation code
      message - the escalation message
      variables - the variables to include in the response
    • respondError

      public void respondError(String code, String message, io.taktx.dto.VariablesDTO variables)
      Sends an error response with the provided code and message, and optional variables.
      Parameters:
      code - the error code
      message - the error message
      variables - the variables to include in the response
    • respondError

      public void respondError(String code, String message)
      Sends an error response with the provided code and message, and no variables.
      Parameters:
      code - the error code
      message - the error message