-
Notifications
You must be signed in to change notification settings - Fork 117
ProSnippets WorkflowManagerClassic
UmaHarano edited this page Nov 6, 2024
·
4 revisions
Language: C#
Subject: WorkflowManagerClassic
Contributor: ArcGIS Pro SDK Team <[email protected]>
Organization: esri, http://www.esri.com
Date: 10/22/2024
ArcGIS Pro: 3.4
Visual Studio: 2022
.NET Target Framework: .Net 8
// WorkflowModule.GetManager returns a manager of the type specified
// keyword is currently just an empty string
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var configManager = wfCon.GetManager<ConfigurationManager>();
// GetAllGroups returns a list of Workflow Manager groups
var wfCon = await WorkflowModule.ConnectAsync();
var configManager = wfCon.GetManager<ConfigurationManager>();
var allGroups = configManager.GetAllGroups();
// GetAllUsers returns a list of Workflow Manager users
var wfCon = await WorkflowModule.ConnectAsync();
var configManager = wfCon.GetManager<ConfigurationManager>();
var allUsers = configManager.GetAllUsers();
// GetVisibleJobTypes returns a list of job types
var wfCon = await WorkflowModule.ConnectAsync();
var configManager = wfCon.GetManager<ConfigurationManager>();
var jobTypes = configManager.GetVisibleJobTypes();
// CreateJob returns an ID of a new job
// it is a passed a valid job type ID as an integer
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var jobID = jobManager.CreateNewJob(jobTypeID);
// GetJob returns an existing job
// it is passed a valid job ID as an integer
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var job = jobManager.GetJob(jobID);
// Get a job associated with the map
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var job = jobManager.GetJob(map);
if (job != null)
{
// Job found, do something with the job
var jobId = job.ID;
}
// CloseJobs returns a list of closed job IDs
// it is passed a list of job IDs to close
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var jobIDs = jobManager.CloseJobs(jobIdsToClose);
// You can change many of the exposed properties of a job and then save them
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var job = jobManager.GetJob(jobID);
job.Description = "This is a test";
job.Save();
// Gets the current step
// checks to see if it can execute it
// proceeds to do so if it can
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var job = jobManager.GetJob(jobID);
string stepID = job.GetCurrentSteps().First();
if (job.CanExecuteStep(stepID).Item1)
job.ExecuteStep(stepID);
// ExecuteQuery returns a query result
// Its passed either an ID or a name
var wfCon = await WorkflowModule.ConnectAsync();
var jobManager = wfCon.GetManager<JobsManager>();
var queryResultReturn = jobManager.ExecuteQuery("All Jobs");
Home | API Reference | Requirements | Download | Samples