The Project contains rules with methods that are deprecated

Last Month
Andread
BIZAGI STUDIO

Summary

The migration to a Bizagi version higher than 11.0 supposes the elimination of integer IDs in metadata. Therefore, in the migration some methods are automatically replaced by the respective one based on the object's name rather than by its ID. The methods that are automatically replaced are those that use explicitly the ID's. If those expressions are not changed, they will most likely cause compilation errors and will not work at runtime. We strongly suggest changing those expressions as soon as you upgrade. 

The log file will list all of the rules that are using the deprecated methods. This file can be found in the following path: C:\Bizagi\Trace\Bizagi_Upgrader_(date).log

Applies to

Projects upgrading from Bizagi 10.x to Bizagi 11.2.3 or higher.

What you need to do

1. After upgrading your project from Bizagi 10.x to Bizagi 11.2.3 or higher, locate the folder C:\Bizagi\Trace and look for the Bizagi_Upgrader_(date).log.

2. Open the file to identify the expressions containing deprecated methods that must be changed in Bizagi Studio.

3. In Bizagi Studio using the Search for expressions, locate each expression and change it, to remove the use of the deprecated method:

  • String.Format: This method was updated by Microsoft .NET Framework; errors may occur when the method has five parameters, for example:

    sMsg = System.String.Format(sMsg, kServiceCatalogType, kChannelType, kCustomerType, olTTA.Length);

    We recommend adding one more parameter, as shown below:

    sMsg = System.String.Format(System.Globalization.CultureInfo.CurrentCulture, sMsg, kServiceCatalogType, kChannelType, kCustomerType, olTTA.Length);

    For more information, review the following URL to identify the method that best suits your needs: https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx .

  • Methods using IDs: the automatic replacement is only done if the method is not used with variables or conditions. When no automatic replacement is done, the changes must be done manually. The following table lists all the deprecated methods:

    DEPRECATED METHODS METHODS TO BE USED 
    Me.Case.getWorkItem(idTask); Me.Case.getWorkItem(taskName);
    Me.Case.assignWorkItem(idTask, idUser, false); Me.Case.assignWorkItem(taskName, idUser, false);
    CHelper.NewCase(Me, IdWFClass) CHelper.NewCase(Me, WFClassName)
    CHelper.NewCaseByUser(idUser, IdWFClass) CHelper.NewCaseByUser(idUser, WFClassName)
    Me.case.getSiblingProcessesId(Me, IdWFClass) CHelper.getSiblingProcessesId(Me, WFClassName)
    CHelper.getAttrib(idEntity, oEntityKey, sAttribName) CHelper.getAttrib(sEntityName, oEntityKey, sAttribName)
    CHelper.setAttrib(idEntity, oEntityKey, sAttribName, oAttribValue) CHelper.setAttrib(sEntityName, oEntityKey, sAttribName, oAttribValue)
    CHelper.getEntityAttrib(idEntity, idAttrib,"filter","") CHelper.getEntityAttrib(sEntityName, sAttribName,"filter")
    CHelper.GetNextSeqValueInt(idSeq); CHelper.GetNextSeqValueStr(seqName)
    Me.Task.Id Me.Task.Name
    Me.Case.ProcessDefinition.Id Me.Case.ProcessDefinition.Name

    Keep in mind that objects that have already been deployed into the production environment will keep their IDs. Therefore, these methods will still work on those objects. There is no warranty that new deployed objects will have the same ID in all your environments. We recommend that you update your rules after migrating to keep good Bizagi practices.

 

The log of the expressions that must be changed is found in the project's Trace Folder

C:\Bizagi\Projects\[Projectname]\Trace 

The log of the expressions that must be changed is found in the project's Trace Folder

C:\Bizagi\Projects\[Projectname]\Trace 

Rate this Article:

Details

Last Modified:Last Month
Last Modified By: CarolinaM
Type: HOWTO
Level: Advanced
Rated 4 stars based on 2 votes.
Article has been viewed 1.9K times.

Options