// Get the job Id associated with the active map view var jobManager = WorkflowClientModule.JobsManager; var jobId = jobManager.GetJobId();
// Get the job Id associated with a map mapUri = "myMapUri"; // Get a reference to a map using the ArcGIS.Desktop.Mapping API (active view, project item, etc.) var jobManager = WorkflowClientModule.JobsManager; var jobId = jobManager.GetJobId(mapUri);
// GetJob returns an existing job try { var jobManager = WorkflowClientModule.JobsManager; var job = jobManager.GetJob(jobId); // Do something with the job } catch (NotConnectedException) { // Not connected to Workflow Manager server, do some error handling }
var search = new SearchQuery() { // Search for all open high priority jobs assigned to users Q = "closed=0 AND assignedType='User' AND priority='High'", Fields = new List<string> { "jobId", "jobName", "assignedTo", "dueDate" }, // Sort by job assignment in ascending order and due date in descending order SortFields = new List<SortField> { new SortField() { FieldName = "assignedTo", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Asc }, new SortField() { FieldName = "dueDate", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Desc } } }; var jobManager = WorkflowClientModule.JobsManager; var searchResults = jobManager.SearchJobs(search); var fields = searchResults.Fields; var results = searchResults.Results;
var search = new SearchQuery() { // Search for jobs assigned to the current user using the arcade expression '$currentUser' Q = "\"assignedType='User' AND closed=0 AND assignedTo='\" + $currentUser + \"' \"", Fields = new List<string> { "jobId", "jobName", "assignedTo", "dueDate"}, // Sort by job name in ascending order SortFields = new List<SortField> { new SortField() { FieldName = "jobName", SortOrder = ArcGIS.Desktop.Workflow.Client.Models.SortOrder.Asc }} }; var jobManager = WorkflowClientModule.JobsManager; var searchResults = jobManager.SearchJobs(search); var fields = searchResults.Fields; var results = searchResults.Results;
var search = new SearchQuery() { Search = "My Search String" }; var jobManager = WorkflowClientModule.JobsManager; var searchResults = jobManager.SearchJobs(search); var fields = searchResults.Fields; var results = searchResults.Results;
var query = new JobStatisticsQuery() { // Search for open jobs assigned to users Q = "\"assignedType='User' AND closed=0 \"" }; var jobManager = WorkflowClientModule.JobsManager; var results = jobManager.CalculateJobStatistics(query); var totalJobs = results.Total;
var jobManager = WorkflowClientModule.JobsManager;
jobManager.RunSteps(jobId);
var jobManager = WorkflowClientModule.JobsManager; // Specify specific current steps in a job to run stepIds = new List<string> { "step12345", "step67890" }; jobManager.RunSteps(jobId, stepIds);
var jobManager = WorkflowClientModule.JobsManager; // Get the job Id associated with the active map view var jobId = jobManager.GetJobId(); // Stop the current steps in the job with the given id. jobManager.StopSteps(jobId);
var jobManager = WorkflowClientModule.JobsManager; // Get the job Id associated with the active map view var jobId = jobManager.GetJobId(); // Specify specific running steps in a job to stop stepIds = new List<string> { "step12345", "step67890" }; jobManager.StopSteps(jobId, stepIds);
var jobManager = WorkflowClientModule.JobsManager; // Finish the current steps in the job with the given id. jobManager.FinishSteps(jobId);
var jobManager = WorkflowClientModule.JobsManager; stepIds = new List<string> { "step12345", "step67890" }; jobManager.FinishSteps(jobId, stepIds);
Target Platforms: Windows 11, Windows 10