Work Module

Custom Activity

Custom Activity

Updated: October 17th, 2020

Published: December 17th, 2019

Downloads: 21

Language compatibility: Visual Basic

Community Support

Work Module

Custom Activity

Summary: 

The Work Module expands on the Workblock concept introduced in the Enhanced RE-Framework. It automatically logs execution attempts, catches exceptions and implements a retry mechanism

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
In Arguments:
- 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.
- Common:
  • 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.
Out Arguments:
- Output:
  • Result (ExecutionResults, required): The result of the execution. Values are: Success, BusinessRuleException or SystemError
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.

Details

Benefits

The Work Module activity executes any code within and outputs a status representing the result of the execution. It implements automatic logging and a retry mechanism in case an exception is caught.

Compatibility

UiPath.System.Activities 19.4.0 and newer
Studio 19.4 and newer

Dependencies

None.
Reflection is used to access certain activities within UiPath.System.Activities, but no explicit dependencies are defined.

Licensing

By clicking download you agree to the following license.