Let’s say I have such a workflow as:
workflowProps = props
val extension = try {
validationStage(order, participant.omsId, omsOrderId)
} catch (e: ApplicationFailure) {
null
}
if (extension != null) {
emitCodes(order, participant, deviceId, omsOrderId)
if (order is MilkOrder && order.paymentType == "1") Workflow.await { orderToClose }
else Workflow.await(Duration.ofDays(getDayCount(extension))) { orderToClose }
val remUrl = registrarActivity.getRemUrl()
remActivity.sendAnnulmentReport(participant, remUrl, deviceId, extension, omsOrderId)
orderActivity.closeOrderWithBuffers(omsOrderId, orderToClose)
}
Workflow.sleep(workflowProps.closeToDeleteDelay)
orderActivity.deleteOrderWithBuffers(omsOrderId)
Whenever it fails with non-retryable error, I want to restart it but from a specific point (last 2 lines of code)
Workflow.sleep(workflowProps.closeToDeleteDelay)
orderActivity.deleteOrderWithBuffers(omsOrderId)
Is there a way to accomplish this? Thanks in advance!