Mass ExecuteTemplates after 9.2.1 upgrade ?


Hello,

After migration to 9.2.1 in our PRE PROD environments, the JobQue in plenty if such jobs :

Created by QBMDBQueueProcess: execute template for object type AADUser
Created by QBMDBQueueProcess: execute template for object type ADSAccount
Created by QBMDBQueueProcess: execute template for object type ADSContact
Created by QBMDBQueueProcess: execute template for object type EX0MailBox
Created by QBMDBQueueProcess: execute template for object type EX0MailBox
Created by QBMDBQueueProcess: execute template for object type EX0MailContact
Created by QBMDBQueueProcess: execute template for object type EX0MailUser
Created by QBMDBQueueProcess: execute template for object type EXHRemoteMailbox
Created by QBMDBQueueProcess: execute template for object type LDAPAccount
Created by QBMDBQueueProcess: execute template for object type O3EMailContact
Created by QBMDBQueueProcess: execute template for object type O3EMailUser
Created by QBMDBQueueProcess: execute template for object type SAPUser
Created by QBMDBQueueProcess: execute template for object type SAPUserInSAPRole

Apparently, the 9.2.1 upgrade force an "ExecuteTemplates" on many objects, but the logic behind is unknown and we don't master objects on which the ExecuteTemplates is applied.

Is there a way to disable this post-upgrade mass operation ? Because we have many objects for which ExecuteTemplates is not suitable in a specific context.

Many thanks for your help.

Michel

Parents
  • Any news after my precision on the version ? 
    Maybe I should contact the support ? 

  • There is no way to disable the post-upgrade mass operation aka ExecuteTemplates. If you take the responsibility to work with inconsistent data - you can stop the JobService from running these jobs and get rid of them. But you may end up with inconsistent data. I do not think that support will tell you something different but as always you are free to ask.

  • OK but how to know in advance the list of tables on which the ExecuteTemplates is applied ? 
    For each table, is it applied on all objects of the table or only some of them on the basis of a given rule ? 
    I'd like being able to do a "pre-upgrade review" to be prepared for the inevitable modifications. 
    Many thanks again Markus.

  • I created this script to look for objects with properties that have, let's call it: outstanding template calculations.
    And use it as a maintenance/pre-upgrade check. Use at your own risk (i'm not a Quest employee), so understand and test first.

    Get-Content .\OutstandingTemplatesPerson.xml | Select-String 'Columnname=".+?(?=\")' -AllMatches | ForEach-Object{$_.Matches.Value} | Group-Object

    #If Not SCRIPTDEBUGGER Then
        Imports System.Collections.Generic
    #End If
    
    Public Function CCC_FindObjectsWithOutstandingTemplates(
        Optional ByVal dialogTableWhereClause As String = "TableName = 'Person'",
        Optional ByVal outputPath As String = "OutstandingTemplatesOverview.xml") As Boolean
    
        If String.IsNullOrEmpty(dialogTableWhereClause) Then
            dialogTableWhereClause = "1=1"
        End If     
            
        If outputPath.StartsWith(".") Or Not System.IO.Path.HasExtension(outputPath) Then
            Throw New Exception("Invalid outputPath")
        End If
        
        Dim f = Session.SqlFormatter()
        Dim hasOutstandingTemplates As Boolean = False
        
        Dim whereClause = f.AndRelation(
                            $"UID_DialogTable IN (SELECT UID_DialogTable FROM DialogColumn WHERE Template IS NOT NULL)", _
                            dialogTableWhereClause)
    
        Dim tableNames = Session.Source().GetCollection(Query _
                    .From("DialogTable") _
                    .Where(whereClause) _
                    .Select("TableName"), EntityCollectionLoadType.Slim) _
                    .Select(Function(e) e.GetValue(Of String)("TableName")) _
                    .ToList()
    
        Dim outstandingTemplatesOverview As New StringBuilder()
        
        For Each tableName In tableNames
              Dim entityCol = Session.Source().GetCollection(Query.From(tableName).Where("1=1").SelectAll(),
                                                                EntityCollectionLoadType.Slim)
        
            For Each colElement As IEntity In entityCol
                Dim myObject = colElement.Create(Session, EntityLoadType.Interactive)        
                
                myObject.ExecuteTemplates(Session)
                If myObject.IsChanged Then
                    Dim thePatch = EntityPatch.Create(myObject, Session.MetaData(), DiffMode.Changed)
                    outstandingTemplatesOverview.AppendLine(thePatch.ToXml().ToString)
                End If
            Next
        Next
    
        If outstandingTemplatesOverview.Length > 0 Then
            Using writer As System.IO.StreamWriter =
                New System.IO.StreamWriter(outputPath)
                writer.Write(outstandingTemplatesOverview.ToString)
            End Using
            hasOutstandingTemplates = True
        End If
        
        Return hasOutstandingTemplates
    End Function


Reply
  • I created this script to look for objects with properties that have, let's call it: outstanding template calculations.
    And use it as a maintenance/pre-upgrade check. Use at your own risk (i'm not a Quest employee), so understand and test first.

    Get-Content .\OutstandingTemplatesPerson.xml | Select-String 'Columnname=".+?(?=\")' -AllMatches | ForEach-Object{$_.Matches.Value} | Group-Object

    #If Not SCRIPTDEBUGGER Then
        Imports System.Collections.Generic
    #End If
    
    Public Function CCC_FindObjectsWithOutstandingTemplates(
        Optional ByVal dialogTableWhereClause As String = "TableName = 'Person'",
        Optional ByVal outputPath As String = "OutstandingTemplatesOverview.xml") As Boolean
    
        If String.IsNullOrEmpty(dialogTableWhereClause) Then
            dialogTableWhereClause = "1=1"
        End If     
            
        If outputPath.StartsWith(".") Or Not System.IO.Path.HasExtension(outputPath) Then
            Throw New Exception("Invalid outputPath")
        End If
        
        Dim f = Session.SqlFormatter()
        Dim hasOutstandingTemplates As Boolean = False
        
        Dim whereClause = f.AndRelation(
                            $"UID_DialogTable IN (SELECT UID_DialogTable FROM DialogColumn WHERE Template IS NOT NULL)", _
                            dialogTableWhereClause)
    
        Dim tableNames = Session.Source().GetCollection(Query _
                    .From("DialogTable") _
                    .Where(whereClause) _
                    .Select("TableName"), EntityCollectionLoadType.Slim) _
                    .Select(Function(e) e.GetValue(Of String)("TableName")) _
                    .ToList()
    
        Dim outstandingTemplatesOverview As New StringBuilder()
        
        For Each tableName In tableNames
              Dim entityCol = Session.Source().GetCollection(Query.From(tableName).Where("1=1").SelectAll(),
                                                                EntityCollectionLoadType.Slim)
        
            For Each colElement As IEntity In entityCol
                Dim myObject = colElement.Create(Session, EntityLoadType.Interactive)        
                
                myObject.ExecuteTemplates(Session)
                If myObject.IsChanged Then
                    Dim thePatch = EntityPatch.Create(myObject, Session.MetaData(), DiffMode.Changed)
                    outstandingTemplatesOverview.AppendLine(thePatch.ToXml().ToString)
                End If
            Next
        Next
    
        If outstandingTemplatesOverview.Length > 0 Then
            Using writer As System.IO.StreamWriter =
                New System.IO.StreamWriter(outputPath)
                writer.Write(outstandingTemplatesOverview.ToString)
            End Using
            hasOutstandingTemplates = True
        End If
        
        Return hasOutstandingTemplates
    End Function


Children