エラーカウントが増え無くなったらエラーでフローを終了する方法

エラーが起きるたびにカウントを+1し、繰り返す処理をフローに組み込んでいるんですが、+1,+2と最後まで繰り返して行った際もエラーだった場合フローを終了するようにするにはどのようにアクティビティ等設置すればよいでしょうか?

Hi @once10201029

Try the below steps

retryCount (Int32) = 0
maxRetryLimit (Int32) = 3


    While retryCount < maxRetryLimit
        Try
            [Your main process activities here]
            Assign retryCount = 0  ' Reset the counter if successful
        Catch ex As Exception
            Assign retryCount = retryCount + 1
            If retryCount >= maxRetryLimit
                Throw New BusinessRuleException("Maximum retry limit reached. Terminating the process.")

Regards,

Hi @once10201029 ,

Variables:
errorCount (Int32) = 0
errorThreshold (Int32) = 3

While errorCount < errorThreshold
Try
// Your process logic here
Catch ex As Exception
Assign: errorCount = errorCount + 1
Log Message: "Error occurred. Current error count: " & errorCount.ToString
End Try

If errorCount >= errorThreshold
    Then: Throw New BusinessRuleException("Error threshold reached. Terminating the workflow.")
    Else: // Continue the process logic if needed
End If

End While

If u use the Max Consecutive error concept u can also achieve the same

Regards
Sandy