public override async Task RunCommand(object sender)
        {
            var engine = (IAutomationEngineInstance)sender;

            var vHumanTaskId = (Guid)await v_TaskId.EvaluateCode(engine);

            var vDocId = (Guid)await v_DocumentId.EvaluateCode(engine);

            string vUsername;
            string vPassword;

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password);

            if (environmentSettings.ServerType == "Local")
            {
                throw new Exception("Documents commands cannot be used with local Server");
            }
            else
            {
                vUsername = environmentSettings.Username;
                vPassword = environmentSettings.Password;
            }

            var userInfo = authMethods.GetDocumentsAuthToken(vUsername, vPassword);

            DocumentMethods.MarkDocumentAsVerified(userInfo, vHumanTaskId, vDocId);
        }
        public override async Task RunCommand(object sender)
        {
            var engine = (IAutomationEngineInstance)sender;

            string vUsername;
            string vPassword;

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password);

            if (environmentSettings.ServerType == "Local")
            {
                throw new Exception("Documents commands cannot be used with local Server");
            }
            else
            {
                vUsername = environmentSettings.Username;
                vPassword = environmentSettings.Password;
            }

            Guid vHumanTaskId = (Guid)await v_TaskId.EvaluateCode(engine);

            bool vSavePageText = (bool)await v_SavePageText.EvaluateCode(engine);

            bool vSavePageImages = (bool)await v_SavePageImages.EvaluateCode(engine);

            string vOutputFolder = (string)await v_OutputFolder.EvaluateCode(engine);

            bool vAwaitCompletion = (bool)await v_AwaitCompletion.EvaluateCode(engine);

            int vTimeout = (int)await v_Timeout.EvaluateCode(engine);

            var vData = await v_OutputUserVariableName5.EvaluateCode(engine);

            DataTable dataDt = vData == null ? null : (DataTable)vData;

            var            userInfo = authMethods.GetDocumentsAuthToken(vUsername, vPassword);
            DocumentResult docInfo  = DocumentMethods.SaveDocumentResults(userInfo, vHumanTaskId, vAwaitCompletion, vSavePageImages, vSavePageText, vTimeout,
                                                                          vOutputFolder, dataDt);
            string    docInfoAsJSON      = docInfo.OutputAsJSON;
            DataTable docInfoAsDataTable = docInfo.DataAsTable;

            dataDt = docInfo.OutputAsTable;

            docInfo.Status.SetVariableValue(engine, v_OutputUserVariableName);
            docInfo.IsCompleted.SetVariableValue(engine, v_OutputUserVariableName1);
            docInfo.HasFailedOrError.SetVariableValue(engine, v_OutputUserVariableName2);
            docInfoAsJSON.SetVariableValue(engine, v_OutputUserVariableName3);
            docInfoAsDataTable.SetVariableValue(engine, v_OutputUserVariableName4);
            dataDt.SetVariableValue(engine, v_OutputUserVariableName5);
        }
Ejemplo n.º 3
0
        public override async Task RunCommand(object sender)
        {
            var engine = (IAutomationEngineInstance)sender;

            string vUsername;
            string vPassword;

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password);

            if (environmentSettings.ServerType == "Local")
            {
                throw new Exception("Documents commands cannot be used with local Server");
            }
            else
            {
                vUsername = environmentSettings.Username;
                vPassword = environmentSettings.Password;
            }

            string vFileToProcess = (string)await v_FilePath.EvaluateCode(engine);

            string vTaskQueueName = (string)await v_QueueName.EvaluateCode(engine);

            string vName = (string)await v_Name.EvaluateCode(engine);

            string vDescription = (string)await v_Description.EvaluateCode(engine);

            string vCaseNumber = (string)await v_CaseNumber.EvaluateCode(engine);

            string vCaseType = (string)await v_CaseType.EvaluateCode(engine);

            string vAssignedTo = (string)await v_AssignedTo.EvaluateCode(engine);

            dynamic vDueOn = v_DueDate.EvaluateCode(engine);

            if (!string.IsNullOrEmpty(v_DueDate))
            {
                vDueOn = (DateTime)await v_DueDate.EvaluateCode(engine);
            }

            UserInfo userInfo = authMethods.GetDocumentsAuthToken(vUsername, vPassword);
            var      docInfo  = DocumentMethods.SubmitDocument(userInfo, vFileToProcess, vTaskQueueName, vName, vDescription, vCaseType, vCaseNumber,
                                                               vAssignedTo, vDueOn);

            Guid   taskId = Guid.Parse(docInfo["TaskID"]);
            string status = docInfo["Status"];

            taskId.SetVariableValue(engine, v_OutputUserVariableName);
            status.SetVariableValue(engine, v_OutputUserVariableName2);
        }
Ejemplo n.º 4
0
        public override async Task RunCommand(object sender)
        {
            var engine  = (IAutomationEngineInstance)sender;
            var vTaskId = (Guid)await v_TaskId.EvaluateCode(engine);

            var vAwaitCompletion = (bool)await v_AwaitCompletion.EvaluateCode(engine);

            string vUsername;
            string vPassword;

            var environmentSettings = new EnvironmentSettings();

            environmentSettings.Load();
            AuthMethods authMethods = new AuthMethods();

            authMethods.Initialize(environmentSettings.ServerType, environmentSettings.OrganizationName, environmentSettings.ServerUrl, environmentSettings.Username, environmentSettings.Password);

            if (environmentSettings.ServerType == "Local")
            {
                throw new Exception("Documents commands cannot be used with local Server");
            }
            else
            {
                vUsername = environmentSettings.Username;
                vPassword = environmentSettings.Password;
            }

            var            userInfo  = authMethods.GetDocumentsAuthToken(vUsername, vPassword);
            DocumentStatus docStatus = DocumentMethods.GetDocumentStatus(userInfo, vTaskId);

            if (vAwaitCompletion)
            {
                int vTimeout = (int)await v_Timeout.EvaluateCode(engine);

                docStatus = DocumentMethods.AwaitProcessing(userInfo, vTaskId, vTimeout);
            }

            docStatus.Status.SetVariableValue(engine, v_OutputUserVariableName);
            docStatus.IsDocumentCompleted.SetVariableValue(engine, v_OutputUserVariableName1);
            docStatus.HasError.SetVariableValue(engine, v_OutputUserVariableName2);
            docStatus.IsCurrentlyProcessing.SetVariableValue(engine, v_OutputUserVariableName3);
            docStatus.IsSuccessful.SetVariableValue(engine, v_OutputUserVariableName4);
        }