public async Task CancelActivityAsync(string sessionId, KTA_ActivityServices.JobActivityIdentity jobActivity) { var actService = new KTA_ActivityServices.ActivityServiceClient(); await actService.CancelActivityAsync(sessionId, jobActivity); await actService.CloseAsync(); }
public async Task CompleteActivityAsync(string sessionId, string currentUserId, string decisionId, string decisionComments, KTA_ActivityServices.JobActivityIdentity jobActivity) { var actService = new KTA_ActivityServices.ActivityServiceClient(); var jobActOutput = new JobActivityOutput(); KTA_ActivityServices.OutputVariableCollection outputVariables = new KTA_ActivityServices.OutputVariableCollection(); KTA_ActivityServices.OutputVariable temp = new KTA_ActivityServices.OutputVariable(); temp.Id = "ZZZ__LATESTAPPROVAL_APPROVER_N"; temp.Value = currentUserId; outputVariables.Add(temp); temp = new KTA_ActivityServices.OutputVariable(); temp.Id = "ZZZ__LATESTAPPROVAL_APPROVER_C"; temp.Value = decisionComments; outputVariables.Add(temp); temp = new KTA_ActivityServices.OutputVariable(); temp.Id = "ZZZ__LATESTAPPROVAL_DECISION_D"; temp.Value = DateTime.Now; outputVariables.Add(temp); temp = new KTA_ActivityServices.OutputVariable(); temp.Id = "ZZZ__LATESTDECISION"; temp.Value = decisionId; outputVariables.Add(temp); jobActOutput.OutputVariables = outputVariables; await _coreApprovalService.addCoreApprovals( currentUserId, jobActivity.JobId, jobActivity.NodeId, jobActivity.ActivityName, decisionId, decisionComments); await actService.CompleteActivityAsync(sessionId, jobActivity, jobActOutput); await actService.CloseAsync(); }
public async Task <List <WorkQueueItem> > LoadWorkQueueAsync(string sessionId) { // Fetch the workqueue // Create an activity service and filter var actService = new KTA_ActivityServices.ActivityServiceClient(); var actFilter = new JobActivityFilter3(); actFilter.MaxActivitiesCount = 1000; actFilter.UseCombinedWorkQueue = true; //i.e. return individual and group assigned activities WorkQueue2 activities = await actService.GetWorkQueue2Async(sessionId, actFilter); // Get the activity summary collection i.e. we are just getting activity information for display in the workqueue var jobActSumCol = activities.JobActivitySummary2Collection; // test if no items in workqueue??? var wqItems = new List <WorkQueueItem>(); foreach (var item in jobActSumCol) { var wqItem = new WorkQueueItem(); wqItem.JobSLA = item.JobSlaStatus.ImagePath; wqItem.ProcessName = item.Process.Name; wqItem.ActivitySLA = item.ActivitySlaStatus.ImagePath; wqItem.ActivityName = item.ActivityIdentity.ActivityName; wqItem.DueDate = item.DueDateTime; wqItem.AssignedTo = item.Resource.Name; wqItem.EmployeeName = (string)item.Fields[1].Value; wqItem.REF_ID = (string)item.Fields[0].Value; wqItem.JobId = item.ActivityIdentity.JobId; wqItem.NodeId = item.ActivityIdentity.NodeId; wqItem.EPC = item.ActivityIdentity.EmbeddedProcessCount; wqItem.AssociatedFile = item.AssociatedFile; wqItems.Add(wqItem); } wqItems.Reverse(); await actService.CloseAsync(); return(wqItems); }
public async Task <JobActivity> TakeActivityAsync(string sessionId, string jobId, short nodeId, short epc) { var _actService = new KTA_ActivityServices.ActivityServiceClient(); // Create an activity service i.e. can call all methods in the activity service e.g. TakeActivity, Complete, Cancel etc // As we are going to take an activity we need to build up the identity of the activity i.e. jobid, node id, embedded process count var actIdentity = new KTA_ActivityServices.JobActivityIdentity(); actIdentity.JobId = jobId; actIdentity.NodeId = nodeId; actIdentity.EmbeddedProcessCount = epc; var jobAct = new JobActivity(); var result = await _actService.TakeActivityAsync(sessionId, actIdentity); await _actService.CloseAsync(); return(result); }