How to enable more than one working copy in Identity Audit - Rules (ComplianceRule table)

I am doing compliance rule creation in bulk using the Data Import tool for One Identity Manager version 8.1.5.

However, facing challenges in enabling working copies of these compliance rules.

There is a method called "Enable working copy," which can enable only one working copy at a time. It is not allowing you to select multiple working copies at a time to enable them.

Please suggest some workarounds to enable more than one working copy (which belongs to the ComplianceRule table) at a time.

  • You can create a custom DialogMethod and assign the MethodBehavior to Execute on multiple objects.

    The code would look like the following if you want to enable the production rule (the second method call parameter is set to True). This is a stripped-down version of the original method.

    Try
    	If Not Base.IsLoaded Then
    		MsgBox (#LD("Not possible in insert mode.")#, MsgBoxStyle.OKOnly Or MsgBoxStyle.Information, "Information")
      	Else
    		Base.Custom.CallMethod("ActivateWorkingCopy", True)
    	End If
    Catch ex As Exception
    	Throw New ViException(#LD("Error occured enabling working copy")#, ex)
    End Try

  • You can insert a one-time job into jobQueue that enables all the relevant CompliancePolicy working methods using SQL (needs to be done after every new import/change).

    Adjust the whereClause/Code as necesary: 

    declare @XObjectKeys QBM_YParameterList
    declare @ProcID varchar(38) = Convert(varchar (38),newID())
    declare @aokeff QBM_YParameterList
     
    Insert Into @XObjectKeys(Parameter1)
    select XObjectKey
    from ComplianceRule
    where
    IsWorkingCopy=1
    and
    UID_ComplianceRule in 
    	(select w.UID_ComplianceRule
    	from ComplianceRule w left join ComplianceRule o on w.UID_ComplianceRule=o.UID_ComplianceRuleWork and w.IsWorkingCopy=1
    	where (w.IsSimpleMode=0
    			and isnull(w.WhereClause, '')<>isnull(o.WhereClause, '')
    			)
    			or
    			(w.IsSimpleMode=1
    			and (isnull(w.WhereClausePerson, '')<>isnull(o.WhereClausePerson, '')
    				or
    				exists (select top 1 1 
    						from ComplianceSubRule so full outer join ComplianceSubRule sw 
    							on so.WhereClauseAddOn=sw.WhereClauseAddOn
    							and so.UID_ComplianceRule=o.UID_ComplianceRule
    								and sw.UID_ComplianceRule=w.UID_ComplianceRule
    						where (so.UID_ComplianceRule=o.UID_ComplianceRule and sw.UID_ComplianceSubRule is null 
    								or sw.UID_ComplianceRule=w.UID_ComplianceRule and so.UID_ComplianceSubRule is null
    								)
    						)
    				)
    			)
    	)
     
    exec QBM_PJobCreate_HOCallMethod_L 'ComplianceRule', @XObjectKeys, 1, @MethodName='ActivateWorkingCopy', @GenprocID=@ProcID, @AdditionalObjectKeysAffected=@aokeff, @param1= 'True'