This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Transport of IT Shop approval workflows and policies

We have an IT Shop approval workflow that is about 26 steps long which references many custom Business Roles for approvals.   Is there a way to transport IT Shop workflows using the Data Transporter tool?  Having to re-create the workflow when moving to another environment would be tiresome.

Parents
  • Here it is.

    Replace_UID_OrgRoot.sql
    -- Replace the UID of an OrgRoot
    
    declare @UID_Old varchar(36) = '650027C4-A804-4A30-B8DE-20ECD2A9EA5B'
    declare @UID_New varchar(36) = '1ca216dc-3cf2-4926-9ff5-a545e07a326e'
    
    -- Create a new OrgRoot with the new UID
    insert into OrgRoot
    select @UID_New, --new UID
    UID_OrgAttestator, Description, IsTopDown, XDateInserted, XDateUpdated, XUserInserted, XUserUpdated,
    Ident_OrgRoot, XTouched, '<Key><T>OrgRoot</T><P>' + @UID_New + '</P></Key>',
    IsDelegable, XMarkedForDeletion, UID_OrgType
    from OrgRoot
    where UID_OrgRoot = @UID_Old
    
    
    -- Switch the child objects to the new OrgRoot
    /*
    -- will be done by the DB trigger
    update OrgRootAssign
    set UID_OrgRoot = @UID_New
    where UID_OrgRoot = @UID_Old
    */
    
    -- update OrgRootAssign based on the old settings
    update OrgRootAssign
    set IsAssignmentAllowed = o.IsAssignmentAllowed, IsDirectAssignmentAllowed = o.IsDirectAssignmentAllowed
    from OrgRootAssign
    join OrgRootAssign o
    	on	OrgRootAssign.UID_OrgRoot = @UID_New
    	and o.UID_OrgRoot = @UID_Old
    	and OrgRootAssign.UID_BaseTreeAssign = o.UID_BaseTreeAssign
    
    
    
    -- disable the trigger, it would disallow the change of the UID_OrgRoot
    exec QBM_PTriggerDisable 'BaseTree', 'QER_TUBaseTree'
    
    update BaseTree
    set UID_OrgRoot = @UID_New
    where UID_OrgRoot = @UID_Old
    
    exec QBM_PTriggerEnable 'BaseTree', 'QER_TUBaseTree'
    
    -- delete the old OrgRoot
    delete OrgRoot
    where UID_OrgRoot = @UID_Old

    The same was used by Barry.

    And he told me that it worked properly.

     

    In the top of the script you have to define 2 variables with the old and the new UID.

     

    Steffen

Reply
  • Here it is.

    Replace_UID_OrgRoot.sql
    -- Replace the UID of an OrgRoot
    
    declare @UID_Old varchar(36) = '650027C4-A804-4A30-B8DE-20ECD2A9EA5B'
    declare @UID_New varchar(36) = '1ca216dc-3cf2-4926-9ff5-a545e07a326e'
    
    -- Create a new OrgRoot with the new UID
    insert into OrgRoot
    select @UID_New, --new UID
    UID_OrgAttestator, Description, IsTopDown, XDateInserted, XDateUpdated, XUserInserted, XUserUpdated,
    Ident_OrgRoot, XTouched, '<Key><T>OrgRoot</T><P>' + @UID_New + '</P></Key>',
    IsDelegable, XMarkedForDeletion, UID_OrgType
    from OrgRoot
    where UID_OrgRoot = @UID_Old
    
    
    -- Switch the child objects to the new OrgRoot
    /*
    -- will be done by the DB trigger
    update OrgRootAssign
    set UID_OrgRoot = @UID_New
    where UID_OrgRoot = @UID_Old
    */
    
    -- update OrgRootAssign based on the old settings
    update OrgRootAssign
    set IsAssignmentAllowed = o.IsAssignmentAllowed, IsDirectAssignmentAllowed = o.IsDirectAssignmentAllowed
    from OrgRootAssign
    join OrgRootAssign o
    	on	OrgRootAssign.UID_OrgRoot = @UID_New
    	and o.UID_OrgRoot = @UID_Old
    	and OrgRootAssign.UID_BaseTreeAssign = o.UID_BaseTreeAssign
    
    
    
    -- disable the trigger, it would disallow the change of the UID_OrgRoot
    exec QBM_PTriggerDisable 'BaseTree', 'QER_TUBaseTree'
    
    update BaseTree
    set UID_OrgRoot = @UID_New
    where UID_OrgRoot = @UID_Old
    
    exec QBM_PTriggerEnable 'BaseTree', 'QER_TUBaseTree'
    
    -- delete the old OrgRoot
    delete OrgRoot
    where UID_OrgRoot = @UID_Old

    The same was used by Barry.

    And he told me that it worked properly.

     

    In the top of the script you have to define 2 variables with the old and the new UID.

     

    Steffen

Children
No Data