-
Notifications
You must be signed in to change notification settings - Fork 0
Catch
Figure 1 Both Workflow Steps and the Workflow itself each provide a modeled Catch area to handle exceptions thrown inside the corresponding context.
The Catch area can be opened via the symbol . It can contain separate lanes for each Exception Type thrown.
Additional to the exceptions thrown explicitly by the Service, the Catch area always includes the two Exception Types Exception and Server Exception by default. They designate occurring Java Runtime Exceptions (Exception) and/or exceptions originating from the Xyna Factory infrastructure (Server Exception).
To add a lane for one of the thrown Exception Types, enable it by double clicking the Exception Type. Inside the emerging lane all Modeling Blocks can be used as usual.
Unchecked Exception Types are regularly processed (i.e. the exception will be re-thrown and not caught).
To remove the handling for one of the thrown exceptions, select the exception lane and press delete Exception Type.
If an exception is handled without rethrowing a new one, the Workflow will proceed to execute with the following steps. Therefore the Output Parameters hidden by the thrown exception must be set differently. By clicking on the caught Exception Type it changes the focus (visually marked blue) to the corresponding lane and enables setting it constantly or resolving ambiguities.
The caught Exception Type can be used like an Input Parameter of the Catch lane. That means it can be used as a normal Workflow Parameter in subsequent steps.
Service Steps provide a Catch area to handle the exceptions that are thrown by the Service.
The overall Workflow provides a Catch area to handle all exceptions, that are thrown by its Service Steps or by Throw Steps.
Please note: In order to retain focus on subject-matter knowledge, only technical errors should be handled in Catch areas. Service-internally occurring errors like Runtime Exceptions and Server Exceptions should be avoided or retained within the Service implementation and converted into technical errors, if necessary (functional Exceptions Types can also be used by Services as Input and Output Parameters).
The Retry Step can be put inside of Catch lanes to re-execute the Service Step or in case of a global Catch the whole Workflow.