UiPath Documentation
studio
latest
false

Studio user guide

Invoking Coded automation in another Coded automation

This tutorial shows how to invoke one coded automation from another. The example uses a CodedResetAssetValue automation that retrieves asset values from Orchestrator, compares them to expected values, and updates them if different.

  1. Use the RunWorkflow method to invoke the CodedResetAssetValue.cs file, and provide Dictionary <string, object> pairs as arguments.

In the dictionary, specify the values for the assetName and assetValue parameters.

For example, set assetName as "MyAsset" and assetValue as "hello world".

Assign the result from the method to a variable named result.

var result = RunWorkflow("BusinessProcess\\CodedResetAssetValue.cs", new Dictionary<string, object>()
      {
        {"assetName", "MyAsset"},
        {"assetValue", "hello world"}
      });
var result = RunWorkflow("BusinessProcess\\CodedResetAssetValue.cs", new Dictionary<string, object>()
      {
        {"assetName", "MyAsset"},
        {"assetValue", "hello world"}
      });
  1. Use an if-else statement to check if assetValueWasChanged is true.
    • If assetValueWasChanged is true, log a message that indicates the asset was reset and include the previous value it had.
    • If it is false, log a message specifying that no reset was required on the asset because it had the expected value.

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated