Skip to Content

How to get exception object using Class Based exceptions in Workflow

Hi All,

I'm taking my first stab at creating a workflow using an ABAP-OO Business Object. I'm using both temporary and permanent class-based exceptions in a number of tasks with the intent to create a decision step for the user to "skip" or "retry" should an exception occur. I know I can model the exception outcomes so that they can flow into user decision steps, but what I can't figure out is how to include the text for the exception in that decision! I'd like to give the users more information to go off of than "an error occurred".

I would expect there would be some way to capture the raised exception object in the workflow container so that in subsequent steps I can call the get_text method, but I don't see a way of doing that. Am I missing something?

Thanks in advance,

Alex

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 10, 2017 at 10:00 PM

    Class exceptions are no different to BOR exceptions: Not possible. The good news is there is a simpler and better alternative.

    The philosophy is that an exception is something unexpected or something that interrupts the process, so no binding takes place because the activity has not completed in an orderly fashion.

    If your exception is a valid business scenario (which in your case it obviously is), then it should be modelled as a standard path. This means catching the exception in your code and returning the result and message back to workflow. A subsequent step checks the outcome and then you can do what you like.

    By the way, this is not restricted to SAP Workflow, in the BPMN modelling notation/language it is also generally recommended to have a separate 'evaluate outcome' step rather than having several outcomes on one activity step.

    Exceptions should be for process interruptions. Deadline timeout, unhandled error, external influences (document deleted).
    Things like Can't post -> Correct document -> retry should really be considered a normal business process.

    Add comment
    10|10000 characters needed characters exceeded