locked
WaitForJob method exception when updating project mutiple custom fields for the project in Project server 2013 using CSOM RRS feed

  • Question

  • Hi,

    I am getting following error when updating multiple custom fields for the project using CSOM. (Project Server 2013)

    Note: The error is occurring only when I update the project for first time. Second time onwards, I don't find error.

    Environment - Multi server farm (1 app, 1 web & 1 DB server)

    It is annoying for entire bulk update process.

    WaitForJob method exception - PJClientCallableException: GeneralQueueCorrelationBlocked GeneralQueueCorrelationBlocked

    CorrelationUID = f2f0f32e-444d-4e1f-9607-2158d394cafd

    JobUID = b3ec66fe-036a-e611-a2ea-005056920dba

    JobType = ProjectUpdate.

    Here is my code

    // Load all projects from project context
                    projContext.Load(projContext.Projects);
                    projContext.ExecuteQuery();

                    // Find and return required project
                    PublishedProject pubProject = projContext.Projects.Where(proj => proj.Name.Equals(projName, StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
                    projContext.ExecuteQuery();
                                   
                    // Load project custom fields
                    projContext.Load(pubProject.CustomFields);
                    projContext.ExecuteQuery();

                    // Include all custom fields from project
                    projContext.Load(pubProject.IncludeCustomFields);
                    projContext.ExecuteQuery();

      QueueJob qJob = projContext.Projects.Update();
     
          if (pubProject.IsCheckedOut == false)
                        {
                            // Create draft project and check out before updating project
                            DraftProject projectDraft = pubProject.CheckOut();

                            // Update project decription
                            if (!string.IsNullOrEmpty(projDesc))
                            {projectDraft.Description = projDesc.Trim();
       qJob = projectDraft.Update();
                            }

                            // Update project sponsor                       
                            if (!string.IsNullOrEmpty(projSponsor))
                            { projectDraft.SetCustomFieldValue(fldSponsorInt, projSponsor.Trim());
         qJob = projectDraft.Update();
                            }

                            // Update project PMO Oversight                       
                            if (!string.IsNullOrEmpty(projPMO))
                            { projectDraft.SetCustomFieldValue(fldPMOOversightInt, projPMO.Trim());
         qJob = projectDraft.Update();
                            }
       
       if (WaitForJob(projContext, qJob))
       {
        qJob = projectDraft.Publish(true);
       }
           }

    queue job method

     private static bool WaitForJob(ProjectContext projContext, QueueJob job)
            {
                bool result = false;

                try
                {
                   
                    JobState jobState = projContext.WaitForQueue(job, int.MaxValue);
                    if(jobState == JobState.Success)
                    {
                        result = true;
                    }

                    else
                    {
                        LoggingService.LogMessageToLocalFile("WaitForJob method job state - " + jobState.ToString());
                    }
                }
                catch (ServerException ex)
                {
                  
                    result = false;
                }
                return result;
            }

    Thanks

    Mohan


    vamsi


    • Edited by m_vamsmohan Friday, September 2, 2016 5:29 PM
    Friday, September 2, 2016 5:29 PM

All replies

  • Hi There...

    Were you able to find out the cause and the resolution for this GeneralQueueCorrelationBlocked  error?

    Wednesday, October 12, 2016 3:25 PM