示例#1
0
        public async Task CancelActivityAsync(string sessionId, KTA_ActivityServices.JobActivityIdentity jobActivity)
        {
            var actService = new KTA_ActivityServices.ActivityServiceClient();
            await actService.CancelActivityAsync(sessionId, jobActivity);

            await actService.CloseAsync();
        }
示例#2
0
        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);
        }
示例#3
0
        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();
        }