Record Class WorkflowStep
java.lang.Object
java.lang.Record
io.axoniq.framework.workflow.dsl.api.WorkflowStep
- Record Components:
stepName- name of the step.status- step status.result- result of execution, may be null.error- error of the execution, may be null.timestamp- timestamp of step start.context- processing context.
public record WorkflowStep(String stepName, StepStatus status, Object result, Throwable error, Instant timestamp, Context context)
extends Record
Basic step of workflow execution.
- Since:
- 5.4.0
- Author:
- Allard Buijze, Stefan Dragisic, Simon Zambrovski
-
Constructor Summary
ConstructorsConstructorDescriptionWorkflowStep(String stepName, StepStatus status, Object result, Throwable error, Instant timestamp, Context context) Creates an instance of aWorkflowSteprecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic WorkflowStepstatic WorkflowStepcontext()Returns the value of thecontextrecord component.final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.static WorkflowStepfinal inthashCode()Returns a hash code value for this object.result()Returns the value of theresultrecord component.static WorkflowStepretrying(String name, StepRetryInfo retryInfo, Instant timestamp, Context context) static WorkflowStepretryStarted(String name, StepRetryInfo retryInfo, Instant timestamp, Context context) A retry attempt that the store accepted and that is now running.static WorkflowStepstatus()Returns the value of thestatusrecord component.stepName()Returns the value of thestepNamerecord component.static WorkflowStepReturns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
WorkflowStep
public WorkflowStep(String stepName, StepStatus status, Object result, Throwable error, Instant timestamp, Context context) Creates an instance of aWorkflowSteprecord class.- Parameters:
stepName- the value for thestepNamerecord componentstatus- the value for thestatusrecord componentresult- the value for theresultrecord componenterror- the value for theerrorrecord componenttimestamp- the value for thetimestamprecord componentcontext- the value for thecontextrecord component
-
-
Method Details
-
started
public static WorkflowStep started(String name, Object parameters, Instant timestamp, Context context) -
completed
public static WorkflowStep completed(String name, Object result, Instant timestamp, Context context) -
failed
-
timedOut
public static WorkflowStep timedOut(String name, Object payload, Instant timestamp, Context context) -
cancelled
-
retrying
public static WorkflowStep retrying(String name, StepRetryInfo retryInfo, Instant timestamp, Context context) -
retryStarted
public static WorkflowStep retryStarted(String name, StepRetryInfo retryInfo, Instant timestamp, Context context) A retry attempt that the store accepted and that is now running.retryInfo.attempt()is the attempt being started; the error is the one that triggered this retry.- Parameters:
name- name of the stepretryInfo- retry state of the attempt being startedtimestamp- timestamp of the attempt startcontext- processing context- Returns:
- the step in
StepStatus.RETRY_STARTEDstatus
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
stepName
Returns the value of thestepNamerecord component.- Returns:
- the value of the
stepNamerecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
result
Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-
context
Returns the value of thecontextrecord component.- Returns:
- the value of the
contextrecord component
-