// WorkflowModule.GetManager returns a manager of the type specified// keyword is currently just an empty stringvarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varconfigManager= wfCon.GetManager<ConfigurationManager>();
How to get groups
// GetAllGroups returns a list of Workflow Manager groupsvarwfCon=await WorkflowModule.ConnectAsync();varconfigManager= wfCon.GetManager<ConfigurationManager>();varallGroups= configManager.GetAllGroups();
How to get users
// GetAllUsers returns a list of Workflow Manager usersvarwfCon=await WorkflowModule.ConnectAsync();varconfigManager= wfCon.GetManager<ConfigurationManager>();varallUsers= configManager.GetAllUsers();
How to get job types
// GetVisibleJobTypes returns a list of job typesvarwfCon=await WorkflowModule.ConnectAsync();varconfigManager= wfCon.GetManager<ConfigurationManager>();varjobTypes= configManager.GetVisibleJobTypes();
How to create a job
// CreateJob returns an ID of a new job// it is a passed a valid job type ID as an integervarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjobID= jobManager.CreateNewJob(jobTypeID);
How to get a job
// GetJob returns an existing job// it is passed a valid job ID as an integervarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjob= jobManager.GetJob(jobID);
How to get a job associated with a map
// Get a job associated with the mapvarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjob= jobManager.GetJob(map);if(job!=null){// Job found, do something with the jobvarjobId= job.ID;}
How to close a job
// CloseJobs returns a list of closed job IDs// it is passed a list of job IDs to closevarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjobIDs= jobManager.CloseJobs(jobIdsToClose);
How to access job info and change it
// You can change many of the exposed properties of a job and then save themvarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjob= jobManager.GetJob(jobID);
job.Description ="This is a test";
job.Save();
How to Execute a step on a job
// Gets the current step// checks to see if it can execute it// proceeds to do so if it canvarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varjob= jobManager.GetJob(jobID);stringstepID= job.GetCurrentSteps().First();if(job.CanExecuteStep(stepID).Item1)
job.ExecuteStep(stepID);
How to execute a Query
// ExecuteQuery returns a query result// Its passed either an ID or a namevarwfCon=await WorkflowModule.ConnectAsync();varjobManager= wfCon.GetManager<JobsManager>();varqueryResultReturn= jobManager.ExecuteQuery("All Jobs");