Hi,
I hope you can help me, I'm having some issues with label data type mismatches on an OnMessage-triggered source activity.
In my model I have a trigger which sends a message to a specific object (with important message parameters), and that recipient object is running an object code instance which has an OnMessage-triggered source activity. From there, a token is created when the message is received, and I want the message parameters to be assigned as labels on that token. Where I am running into issues is with the Label Matching/Assignment table. It seems that the message parameters have hard-coded variable types associated with them and will not pass a pointer parameter through to the token label.
It's hard to explain, so I'll walk you through what's happening with screenshots:
Here is the pop-up window for the item-triggered Send Message operation. As you can see, I have 2 message parameters that are in use. The first parameter is an int type and the second parameter is an object pointer (in this case the pointer is stored on a label).
Popup window for the item-triggered Send Message operation
The first issue I encountered was that I noticed my second parameter not being passed through correctly to the outbound message. The value I was seeing in my 'Local Variables' debug tab was 0.00000 instead of the object pointer. When I clicked 'Directly edit code for this trigger' the issue became clear:
Code editor for the item-triggered Send Message operation with default code
In the code editor, the message parameters were being declared as doubles by default (instead of the default code using var or Variant or something more flexible). I corrected this manually as shown:
Code editor for the item-triggered Send Message operation with updated code
Then, at this point I verified in the 'Local Variables' debug tab that my outgoing message parameters were all showing up correctly (they were).
The OnMessage-triggered source activity then created the token upon message receipt, and assigned the token labels as defined in the Label Matching/Assignment table:
OnMessage-triggered source activity token label definition
That token then moved on to a custom code activity where I noticed in the 'Local Variables' debug tab that casting the 'MsgParam2' label as an Object resulted in a null value:
Custom code activity and 'Local Variables' debug tab showing null value for the requestedDestination variable
I printed the actual 'MsgParam2' token label to the output console just to see what it contained, and it returned a value of 2381206995120. I have no idea what this numeric value signifies or how it got there, but my guess is that the Label Matching/Assignment table is casting the token labels as numeric values by default, just like the popup window for the item-triggered Send Message operation had done before I changed it manually.
The problem this time is that I have no idea where to find the source code editor to modify the token label assignment operation so that my object pointer parameter is actually passed through. I looked through the model tree but I have no idea where that source code "lives".
Did I identify the issue correctly, and if so, can you please recommend a way to get around it? Thanks in advance!