Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

Pass Token Information for Triggering Workflows in the AIM Repository via a Custom App

Pass Token Information for Triggering Workflows in the AIM Repository via a Custom App

  • Last UpdatedJul 04, 2025
  • 1 minute read

Pass Token Information for Triggering Workflows in the AIM Repository via a Custom App

To execute a workflow on a repository configured with the "Active Directory with Token Service" i.e AIM provider, authorization is required. Ensure that you pass the access token when triggering the workflow.

Sample code 1:

string repository = "ADRepoWithAim";

string workflowName="First Workflow";

string accessToken = ""; // set the access token received from the above API.

UserContext userContext = new UserContext("username", new Skelta.Core.ApplicationObject(repository), "activedirectory");

HttpContext.Current.Request.Headers.Add("AccessToken", accessToken);

Workflow.NET.Engine.Client client = new Workflow.NET.Engine.Client(repository, workflowName);

client.Execute(userContext.LoggedInUserId, "<test></test>");

client.Close();

If you are using a console application or any non-web application, refer to the sample below:

Sample code 2:

Skelta.ASTS.Core.ClientTokenData clientTokenData = new Skelta.ASTS.Core.ClientTokenData();

clientTokenData.AccessToken = accessToken;

Workflow.NET.Engine.Client client1 = new Workflow.NET.Engine.Client(repository, workflowName, clientTokenData);

client1.Execute(userContext.LoggedInUserId, "<test></test>");

client1.Close();

Related Links
TitleResults for “How to create a CRG?”Also Available in