apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
491 stars 192 forks source link

Make the workflow fail based on a metadata key #3475

Closed rgolangh closed 2 months ago

rgolangh commented 2 months ago

Description

There is no way to set a workflow status on end to a status different than completed. While the workflow completed its steps we don't have a way to say that the step results are unexpected and the workflow actually failed. From an API point of view there's no way to tell if a workflow REALLY did the work it supposed to do.

Implementation ideas

after a discussion with @fjtirado we have formed this suggestion:

states:
  name: endWithError
  metadata:
     errorMessage: '.somekey'
  end: true

The runtime will seek a metadata key errorMessage and if it is not empty then it will set the status of the instance to failed The advantage is that we don't add new keywords or change the spec, or add custom actions or other workarounds, so this syntax is available ootb for every workflow developer out there.