Esempio n. 1
0
        public async Task <IReadOnlyList <GroupInfo> > GetGroupsAsync()
        {
            var wfCon = await WorkflowModule.ConnectAsync();

            ConfigurationManager CM = wfCon.GetManager <ConfigurationManager>();
            var ret = CM.GetAllGroups();

            return(ret);
        }
Esempio n. 2
0
        //get job data
        public async Task <Job> OpenJobAsync(string JobId)
        {
            var wfCon = await WorkflowModule.ConnectAsync();

            JobsManager JM  = wfCon.GetManager <JobsManager>();
            var         ret = JM.GetJob(JobId);

            return(ret);
        }
Esempio n. 3
0
        //get pre-defined query
        public async Task <QueryResult> GetJobsAsync()
        {
            var wfCon = await WorkflowModule.ConnectAsync();

            JobsManager JM  = wfCon.GetManager <JobsManager>();
            var         ret = JM.ExecuteQuery(QueryName);

            return(ret);
        }
Esempio n. 4
0
        public static async Task GetJobTypesAsync()
        {
            #region How to get job types

            // GetVisibleJobTypes returns a list of job types
            var wfCon = await WorkflowModule.ConnectAsync();

            var configManager = wfCon.GetManager <ConfigurationManager>();
            var jobTypes      = configManager.GetVisibleJobTypes();
            #endregion
        }
Esempio n. 5
0
        public static async Task GetUsersAsync()
        {
            #region How to get users

            // GetAllUsers returns a list of Workflow Manager users
            var wfCon = await WorkflowModule.ConnectAsync();

            var configManager = wfCon.GetManager <ConfigurationManager>();
            var allUsers      = configManager.GetAllUsers();
            #endregion
        }
Esempio n. 6
0
        public static async Task GetJobAsync(string jobID)
        {
            #region How to get a job

            // 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);
            #endregion
        }
Esempio n. 7
0
        public static async Task CreateJobAsync(string jobTypeID)
        {
            #region How to create a job

            // 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);
            #endregion
        }
Esempio n. 8
0
        public static async Task GetManagerObjectsAsync()
        {
            #region How to get managers objects

            // 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>();
            #endregion
        }
Esempio n. 9
0
        public static async Task ExecuteQueryAsync()
        {
            #region How to execute a Query

            // 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");
            #endregion
        }
Esempio n. 10
0
        public static async Task CloseJobAsync(IReadOnlyList <string> jobIdsToClose)
        {
            #region How to close a job

            // 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);
            #endregion
        }
Esempio n. 11
0
        public static async Task AccessJobChangeItAsync(string jobID)
        {
            #region How to access job info and change it

            // 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();
            #endregion
        }
Esempio n. 12
0
        //create a job based off a pre-defined job type
        //then assigned it to the specified owner
        public async Task <string> CreateJobAsync(OwnerComboBoxItem owner)
        {
            var wfCon = await WorkflowModule.ConnectAsync();

            JobsManager JM  = wfCon.GetManager <JobsManager>();
            var         ret = JM.CreateNewJob(JobTypeID.ToString());
            var         job = JM.GetJob(ret);

            if (owner != null && job.CurrentStepInfo?.Count > 0)
            {
                job.CurrentStepInfo[0].AssignedTo   = owner.AssignedTo;
                job.CurrentStepInfo[0].AssignedType = owner.AssignmentType;
            }
            job.Save();
            return(ret);
        }
Esempio n. 13
0
        public static async Task GetJobAsync(Map map)
        {
            #region How to get a job associated with a map

            // 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;
            }
            #endregion
        }
Esempio n. 14
0
        public static async void ExecuteStepOnJobAsync(string jobID)
        {
            #region 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 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);
            }
            #endregion
        }