Short Description |
Ports |
Metadata |
Fail Attributes |
Details |
See also |
The component is located in
→ .The Fail component aborts the parent job (jobflow or graph) with user-specified error message.
Component | Same input metadata | Sorted inputs | Inputs | Outputs | Each to all outputs | Java | CTL | Auto-propagated metadata |
---|---|---|---|---|---|---|---|---|
Fail | 0-1 | 0 |
Port type | Number | Required | Description | Metadata |
---|---|---|---|---|
Input | 0 | Any input token from this port interrupts the jobflow (or graph). | Any |
Input field named 'errorMessage' is automatically used for user-specific error message, which interrupts the job, if it is not specified in mapping other way.
Attribute | Req | Description | Possible values |
---|---|---|---|
Basic | |||
Error message | no | In case the job is interrupted, the exception is thrown with this error message. The error message can be dynamically changed in mapping. | "user abort" (default) | text |
Mapping | no | Mapping is used for dynamical assembling of error message, which is thrown in case the job is going to be interrupted. Moreover, dictionary content of interrupted job can be changed as well. See Details. |
Fail interrupts parent job (jobflow or graph). First incoming token to the component throws exception (org.jetel.exception.UserAbortException) with user defined error message. The job finishes immediately with final status ERROR. Moreover, the dictionary content can be changed before the job is interrupted. In general, the component allows to interrupt the job and at the same time return some results through dictionary.
The component Fail works even without input port attached. In this case, the job is interrupted immediately when the phase with the Fail component is started up.
Mapping in Fail component is generally used for two purposes:
Assembling of error message from incoming record.
Populating dictionary content from incoming record.
Note | |
---|---|
Only output dictionary entries can be changed. |
Figure 57.2. Example of mapping for Fail component
Error message compiled by the mapping has the highest priority. If the mapping does not set 'errorMessage', the error message from component attribute is used instead. If even this attribute is not set, predefined text "user abort" is used instead.