ShouldMarkJobAsFaulted

Someone Please tell what is the use of ‘ShouldMarkJobAsFaulted’ in UiPath?

Why it was used in finally block in End Process state in Re-Framework?

@Salman_Faries

By using the ‘ShouldMarkJobAsFaulted’ parameter, the REFramework can appropriately handle exceptions and ensure that the job status is updated based on the outcome of the transaction processing. If the parameter is set to ‘True,’ the job will be marked as faulted, indicating that there was an issue during processing. Otherwise, if the parameter is ‘False,’ the job will be marked as completed, indicating that the transaction was processed successfully.

1 Like

@Salman_Faries

In UiPath’s ReFramework, the ShouldMarkJobAsFaulted flag is a boolean variable that is used to determine whether the current job should be marked as faulted or not. It is typically used to handle exceptions and errors that occur during the execution of the workflow.

In the ReFramework, the ShouldMarkJobAsFaulted flag is set to True in the following scenarios:

  1. When a Business Exception occurs: If a Business Exception is caught during the processing of a transaction item, the ShouldMarkJobAsFaulted flag is set to True. A Business Exception is a known issue that can be handled and does not indicate a technical failure of the process.
  2. When a System Exception occurs: If a System Exception is caught during the processing of a transaction item, the ShouldMarkJobAsFaulted flag is set to True. A System Exception is an unexpected issue or error that may require manual intervention or investigation.

The ShouldMarkJobAsFaulted flag is used in the Finally block of the End Process state to handle the final state of the transaction. In the End Process state, the ReFramework checks the value of the ShouldMarkJobAsFaulted flag. If it is True, it means that an exception or error occurred during the process, and the job needs to be marked as faulted.

Marking the job as faulted in the Finally block ensures that the Orchestrator or other monitoring systems can identify that the job had issues and requires attention. This information can be used for reporting, logging, and process management purposes.

By using this flag in the Finally block, the ReFramework ensures that the job’s status is appropriately updated based on whether an exception occurred or not, providing better visibility and accountability for the automation process.

1 Like

Hi @Salman_Faries

  1. In the Catch Block:
    → When an exception occurs during the processing of a transaction, the ReFramework enters the “Catch” block, and the ‘ShouldMarkJobAsFaulted’ parameter is set to True. This indicates that the current job has encountered an error (faulted).
  2. In the Finally Block:
    → The “Finally” block executes after the “Try” or “Catch” block, regardless of whether an exception occurred or not.
    → In the “Finally” block of the “End Process” state, the ‘ShouldMarkJobAsFaulted’ parameter is checked.
    → If ‘ShouldMarkJobAsFaulted’ is True (indicating that an exception occurred during the transaction), the ReFramework marks the current job as faulted using the Set Transaction Status activity. This ensures that the Orchestrator will recognize the job as failed, and any subsequent processing can be handled accordingly (e.g., retries, notifications, or logging).

Hope it helps!!

1 Like

Hi @Salman_Faries

  1. When an Exception Occurs: If an exception occurs during the processing of transactions (e.g., business exception, system exception), the ‘ShouldMarkJobAsFaulted’ flag is set to “True” within the Catch block. This indicates that the job encountered an issue and needs to be marked as “Faulted” in the Orchestrator.
  2. If No Exception Occurs: If no exception occurs during the processing of transactions, the ‘ShouldMarkJobAsFaulted’ flag remains “False” (since there was no fault), and the robot proceeds to the ‘Finally’ block.
  3. ‘Finally’ Block: In the ‘Finally’ block, the ‘ShouldMarkJobAsFaulted’ flag is checked. If it is “True” (i.e., an exception occurred during processing), the robot will mark the job as “Faulted” by using the ‘Set Transaction Status’ activity with a status of “Failed” in Orchestrator.

The ‘ShouldMarkJobAsFaulted’ flag in the ‘Finally’ block allows the robot to handle the final status of the job based on whether an exception occurred during the processing of transactions. If an exception occurred, the job is marked as “Faulted” in Orchestrator. If no exception occurred, the job is marked as “Successful” in Orchestrator. This helps provide accurate reporting and tracking of job status in Orchestrator and aids in debugging and monitoring automation processes.

Regards,

1 Like

Thank you all for explaining this much detailed!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.