Example #1
0
        private async Task UpdateImportJobDetailsFieldAsync(string details)
        {
            RaiseMessage($"Updating import job details. {_errorContext}");

            await ArtifactQueries.UpdateRdoJobTextFieldAsync(
                AgentHelper.GetServicesManager(),
                WorkspaceArtifactId,
                _executionIdentity,
                Constant.Guids.ObjectType.MarkupUtilityImportJob,
                _importJobArtifactId,
                Constant.Guids.Field.MarkupUtilityImportJob.Details,
                details);
        }
        private async Task UpdateImportJobStatusFieldAsync(string status)
        {
            RaiseMessage($"Updating import job status to {status}. {_errorContext}]");

            await ArtifactQueries.UpdateRdoJobTextFieldAsync(
                AgentHelper.GetServicesManager(),
                WorkspaceArtifactId,
                ExecutionIdentity.CurrentUser,
                Constant.Guids.ObjectType.MarkupUtilityImportJob,
                _importJobArtifactId,
                Constant.Guids.Field.MarkupUtilityImportJob.Status,
                status);
        }
Example #3
0
        public async Task ExecuteAsync()
        {
            try
            {
                bool recordExists;

                switch (ButtonName)
                {
                case Constant.Buttons.VALIDATE:
                    Logger.LogDebug($"{Constant.Names.ApplicationName} - {Constant.Buttons.VALIDATE} button clicked.");
                    recordExists = await DoesRecordExistAsync();

                    if (recordExists == false)
                    {
                        await DeleteJobErrors(SvcManager, IdentityCurrentUser, WorkspaceArtifactId, CurrentArtifactId);

                        //Add the record to the Import Manager queue table
                        var resourceGroupId = await ArtifactQueries.GetResourcePoolArtifactIdAsync(SvcManager, IdentitySystem, WorkspaceArtifactId);

                        await SqlQueryHelper.InsertRowIntoImportManagerQueueAsync(DbContextEdds, WorkspaceArtifactId, 1, CurrentUserArtifactId, CurrentArtifactId, resourceGroupId, SelectedObjectType, Constant.ImportUtilityJob.JobType.VALIDATE);

                        //Set the Import Job RDO status to Validating
                        await UpdateJobStatusAsync(SvcManager, WorkspaceArtifactId, IdentityCurrentUser, Constant.Guids.ObjectType.ImportUtilityJob, CurrentArtifactId, Constant.Guids.Field.ImportUtilityJob.Status, Constant.Status.Job.SUBMITTED);
                    }
                    break;

                case Constant.Buttons.SUBMIT:
                    Logger.LogDebug($"{Constant.Names.ApplicationName} - {Constant.Buttons.SUBMIT} button clicked.");
                    recordExists = await DoesRecordExistAsync();

                    if (recordExists == false)
                    {
                        await DeleteJobErrors(SvcManager, IdentityCurrentUser, WorkspaceArtifactId, CurrentArtifactId);

                        //Add the record to the Import Manager queue table
                        Int32 resourceGroupId = await ArtifactQueries.GetResourcePoolArtifactIdAsync(SvcManager, IdentitySystem, WorkspaceArtifactId);

                        await SqlQueryHelper.InsertRowIntoImportManagerQueueAsync(DbContextEdds, WorkspaceArtifactId, 1, CurrentUserArtifactId, CurrentArtifactId, resourceGroupId, SelectedObjectType, Constant.ImportUtilityJob.JobType.VALIDATE_SUBMIT);

                        //Set the Import Job RDO status to Validating
                        await UpdateJobStatusAsync(SvcManager, WorkspaceArtifactId, IdentityCurrentUser, Constant.Guids.ObjectType.ImportUtilityJob, CurrentArtifactId, Constant.Guids.Field.ImportUtilityJob.Status, Constant.Status.Job.SUBMITTED);

                        //Mark job as being submitted for migration
                        await ArtifactQueries.MarkImportJobAsSubmittedForMigration(SvcManager, IdentityCurrentUser, WorkspaceArtifactId, CurrentArtifactId);
                    }
                    break;

                case Constant.Buttons.CANCEL:
                    Logger.LogDebug($"{Constant.Names.ApplicationName} - {Constant.Buttons.CANCEL} button clicked.");
                    var id = await RetrieveIdByArtifactIdAsync();

                    if (id > 0)
                    {
                        //Set the Import Job RDO status to Cancel Requested
                        await ArtifactQueries.UpdateRdoJobTextFieldAsync(SvcManager, WorkspaceArtifactId, IdentityCurrentUser, Constant.Guids.ObjectType.ImportUtilityJob, CurrentArtifactId, Constant.Guids.Field.ImportUtilityJob.Status, Constant.Status.Job.CANCELREQUESTED);

                        //Set the Import Job record in the Manager Queue to Cancel Requested
                        await UpdateJobStatusInManagerQueueAsync(DbContextEdds, WorkspaceArtifactId, CurrentArtifactId, Constant.Status.Queue.CANCELLATION_REQUESTED);
                    }
                    break;
                }
            }
            catch (AdminMigrationUtilityException ex)
            {
                throw new AdminMigrationUtilityException(ex.Message);
            }
        }
Example #4
0
 private async Task UpdateJobStatusAsync(IServicesMgr svcManager, Int32 workspaceArtifactId, ExecutionIdentity identity, Guid objectTypeGuid, Int32 artifactId, Guid fieldGuid, String status)
 {
     await ArtifactQueries.UpdateRdoJobTextFieldAsync(svcManager, workspaceArtifactId, identity, objectTypeGuid, artifactId, fieldGuid, status);
 }