The Work Module executes the code contained within its scope (it's recommended to use an Invoke WorkflowFile activity). Log messages are generated for each execution attempt, exceptions are automatically caught and, in case of exceptions other than BusinessRuleException, the code can be automatically re-executed up to a configurable number of times.
The package defines a custom enum type called ExecutionResults used to output the outcome of executing the module's code. Possible output Result:
ExecutionResults.Success - if the code executes successfully.
ExecutionResults.BusinessRuleException - in case a BusinessRuleException is caught. If ContinueOnError = False, the exception is re-thrown
ExecutionResults.SystemError - in case a non-BusinessRuleException is caught and the number of retries is exceeded. If ContinueOnError = False, the last caught exception is re-thrown
- Automatic Logging Options:
LogExecutionStart (LogExecution, required): Specifies whether to automatically log the start of each execution attempt. Options are Always (default) and Never
LogLevel (ModuleLogLevel, required): The severity for the module's automatic log messages. Only appears for UiPath.System.Activities 19.8.0 or older. For newer versions, it follows the global project settings for log levels.
LogResult (LogResult, required): Specifies whether to automatically log the result of each execution attempt. Options are Always (default), OnException, Never
- Automatic Retry Options:
NumberOfRetries (int, required): The number of times the module tries to re-execute the code in case a non-BusinessRuleException is caught. In case of a BRE, execution is terminated without re-executing.
RetryInterval (TimeSpan, required): The amount of time between retries.
ContinueOnError (bool, optional): Specifies whether to continue execution or to re-throw the last caught Exception (is case of execution failure).
DisplayName (string, required): The display name of the activity. Cannot be empty or default, as it is used in the automatic logging.
Known limitation: If the Work Module catches an Exception that does NOT originate in a different Workflow File, the exception source will be output as System.Activities.