Pega Robotics: Unable to assign string value to global variable

Environment - Using Pega Robotics 19.1.81 plugin with VS2015

I am unable to assign value to a Global variable.

Following are the steps I did:

  1. Created a globalDictionary object in _GC_Activities in Adapter Project

  2. Added a global variable in the interaction.xml

  3. In the adapter project setting the value of GlobalDictionary Log object. Out from the stringUtils.Concat is assigned to Log. I even tried setting value from a string variable

  4. Created a globalDictionary object in _GC_Controller Project. This points to the same interaction.xml as the adapter Project

  5. Added an automation in Controller Project under Events folder. GlobalDictionary -OnLogChanged.and doing some code

Things not happening:

  1. In the adapter project the value output from StringUtils is not getting set to globalDictionary Log variable (global variable)

@KulbirS8 In looking at your Interaction.xml you do not have a Default attribute on your variable. If you add this, your issue should be resolved.

GlobalDictionaryDemo.zip (6.23 MB)

@jeffbadger I did tried by setting the default value. Still when I pass value from stringUtils; it doesn’t get assigned to global variable.

I just realized the problem was Target Framework not set to .NET Framework 4.6.1. By default it was 4.5.x when i created project.

That resolved the issue.

Thanks for the sample project.