String.Format execution problems

3 Months Ago
Andread
Business rules

Summary

           


There is a problem when using the function String.Format with four (4) or more parameters: the function will not work when the string parameter is managed as a variable.

To ensure its correct execution, it is necessary to:
- Include the string parameter explicitly
or
- Include the Culture as a first parameter
- Include quotation marks after the variable

Applies to

Automation projects from Bizagi 11.0 or higher.

What you need to do

           


Below you will find two options when the string parameter is a variable, in this case sMsg

1. Use the String.Format method with the string parameter defined explicitly:

sMsg = System.String.Format("Bad configuration for variable", "Value1", "Value2", "Value3", "Value4");

2. Use the String.Format method including the culture and quotation marks after the string parameter:

sMsg = System.String.Format(System.Globalization.CultureInfo.CurrentCulture, sMsg + "", "Value1", "Value2", "Value3", "Value4");

 

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:3 Months Ago
Last Modified By: Andread
Type: ERROR
Level: Advanced
Rated 5 stars based on 1 vote
Article has been viewed 359 times.

Options