none
Shape identification in Expresion RRS feed

Answers

  • Just realised this error. For this you have to initialise the variable. But Microsoft.XLANGs.RuntimeTypes.Location’s constructor itself takes shapeID as input parameter :(

    i.e

    Var1 = Microsoft.XLANGs.RuntimeTypes.Location(ShapeID)

    so it’s of  no use for us when you want to get shapeID.

    I tried the following code:

    Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID

    Add reference to the assembly: Microsoft.XLANGs.Engine

    I can get the shapeID, I have tested it. Though it says ExceptionLocation's shapeID, it get the shapeID even when there is not exception. it works.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.


    Wednesday, December 4, 2013 2:37 PM

All replies

  • If you're refering to what you see in the DTA database, the answer is: you don't.

    Those ID's are created to relate tracking of the instance, but really aren't part of the instance per se.

    Tuesday, December 3, 2013 10:03 PM
    Moderator
  • Create a variable of type “Microsoft.XLANGs.RuntimeTypes.Location” and you can access ShapeID from that variable instance.

     

    If it’s in C# code:

    Microsoft.XLANGs.RuntimeTypes.Location location;
    location.ShapeID
     

    If it’s in orchestration, create an orchestration variable of type Microsoft.XLANGs.RuntimeTypes.Location

     

    And in Expression shape, access:

    Var1.ShapeID

    Here Var1 is the orchestration variable.

    Reference: Location.ShapeID Property

    And additional info:

    And also we normally see shapeID being logged in eventlog when an exception occur. Following code can be used to exact shape ID from the thrown  exception object.

    Add reference to assembly Microsoft.XLANGs.RuntimeTypes

    Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID

     

    Hope this helps.

    Regards,

    M.R.ASHWINPRABHU


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.


    Tuesday, December 3, 2013 10:31 PM
  • Thank you.

    I added to orchestration a new variable Var1 of type Microsoft.XLANGs.RuntimeTypes.Location

    I use it in Expression shape

    eventStream.UpdateActivity("UnknownAct", activityID.ToString(),
                              "Value1", ActionId.ToString(),
                              "Value2","Message Received",
                              "Value3",System.DateTime.UtcNow,
                              "Value4",Var1.ShapeID);
    and  I can't build project with error:

     use of unassigned local variable 'Var1' 


    Tuesday, December 3, 2013 10:58 PM
  • Great point. That's the Designer Shape ID, correct, not the instance?
    Wednesday, December 4, 2013 1:06 AM
    Moderator
  • Just realised this error. For this you have to initialise the variable. But Microsoft.XLANGs.RuntimeTypes.Location’s constructor itself takes shapeID as input parameter :(

    i.e

    Var1 = Microsoft.XLANGs.RuntimeTypes.Location(ShapeID)

    so it’s of  no use for us when you want to get shapeID.

    I tried the following code:

    Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID

    Add reference to the assembly: Microsoft.XLANGs.Engine

    I can get the shapeID, I have tested it. Though it says ExceptionLocation's shapeID, it get the shapeID even when there is not exception. it works.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.


    Wednesday, December 4, 2013 2:37 PM
  • @ Boatseller: mmm its certainly not the shapeID for every instance of the orchestration. But if you have two expressions in an Orchestrations instance, they have two different IDs. Yes in one way its a designer shape ID.

    I hope questioner Michael L. Shapiro must to looking for an designer shapeID to log the status of a process at a particular shape. So in this case, this shall be helpful.


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful.

    Wednesday, December 4, 2013 2:42 PM
  • Thank you M.R.ASHWINPRABHU

    It is true, Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation.ShapeID returns OID of Expression Shape even when there is not exception.

    <om:Element Type="VariableAssignment" OID="45ef7631-eb48-4158-b51e-411d44b53500" ParentLink="ServiceBody_Statement" LowerBound="39.1" HigherBound="60.1">





    Wednesday, December 4, 2013 2:57 PM
  • Hi,

    Thanks for gicing this valuable info, but I am not able to find the ShapeID in ExceptionLocation, gicing Error at Design time saying that "identifier "ShapeID" does not exists in "Microsoft.XLANGs.Core.Service.RootService.ExceptionLocation".

    I have added Microsoft.XLang.Engine.dll as reference also. I am using BizTalk Server 2009.

    Wednesday, June 25, 2014 7:23 AM