string variable gets nulled in orchestration RRS feed

  • Question

  • I'm trying to use role links for routing my incoming messages. for that reason i made a new pipeline component where i promote  routingcode and customercode to message context. in the beginning of orchestration, after receive shape i'm "catching"  these properties from message context.

    customercode = ReceivedMessage(Common.CommonSchemas.PropertySchema.CustomerCode);
    routingcode = ReceivedMessage(Common.CommonSchemas.PropertySchema.RoutingCode);
    RoleLink1(Microsoft.XLANGs.BaseTypes.DestinationParty) = new Microsoft.XLANGs.BaseTypes.Party(routingcode, "RoutingCode");
    RoleLink2(Microsoft.XLANGs.BaseTypes.DestinationParty) = new Microsoft.XLANGs.BaseTypes.Party(routingcode, "RoutingCode");

    variable named routingcode is used for routing, customercode is for other purposes, but the problem is, building this project visual studio generated code puts null value to variable customercode immediately after it's get. Does anyone know why this is happening ?

                case 11:
                    __ctx1__.__customercode = (System.String)__ctx1__.__ReceivedMessage.GetPropertyValueThrows(typeof(Common.CommonSchemas.PropertySchema.CustomerCode));
                    if (__ctx1__ != null)
                        __ctx1__.__customercode = null;
                    if ( !PostProgressInc( __seg__, __ctx__, 12 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 12;
                case 12:
                    if ( !PreProgressInc( __seg__, __ctx__, 13 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    Tracker.FireEvent(__eventLocations[5],__eventData[3],_stateMgrs[1].TrackDataStream );
                    if (IsDebugged)
                        return Microsoft.XLANGs.Core.StopConditions.InBreakpoint;
                    goto case 13;
                case 13:
                    __ctx1__.__routingcode = (System.String)__ctx1__.__ReceivedMessage.GetPropertyValueThrows(typeof(Common.CommonSchemas.PropertySchema.RoutingCode));
                    if ( !PostProgressInc( __seg__, __ctx__, 14 ) )
                        return Microsoft.XLANGs.Core.StopConditions.Paused;
                    goto case 14;

    Friday, January 12, 2018 8:45 AM

All replies

  • Are you promoting the value in your receive pipeline ?

    If you want to use Role Links for receive you need to have a component in the receive pipeline that would lookup the parties and set the values properly. There is a PartyResolver component in the SDK which you should build and deploy. Use this library to create a custom pipeline component which will set the appropriate party variables. Refer


    Friday, January 12, 2018 10:41 AM
  • Hi, yes i am ... and i can see inside orchestration code that promoting those properties is successfull, the only issue is that right after getting promoted value to variable customercode , it gets nulled in code.

     __ctx1__.__customercode = (System.String)__ctx1__.__ReceivedMessage.GetPropertyValueThrows(typeof(Common.CommonSchemas.PropertySchema.CustomerCode));
                    if (__ctx1__ != null)
                        __ctx1__.__customercode = null;

    this is the exact code (studio generated code)  in File0.cs

    Friday, January 12, 2018 11:21 AM
  • The code is generated in response to what has been specified in the orchestration. It is possible that you've specified an orchestration variable which is "defaulted" to null because of which on instantiation (assignment of the property) gets defaulted to NULL.

    Would it be possible for you to provide a snapshot of the orchestration, the expression shape contents and/or the variable definition from the orchestration designer.


    Monday, January 15, 2018 11:21 AM