locked
Spec Explorer Crashes: using Guid as a parameter in cord file RRS feed

  • Question

  • i have a model whcih has a rule with signature:

    static AppDefinition CreateApp(TypeOfApp appType, Version appVersion, Guid appID)
    

    in the Cord file in Main Config i defined the following abstract method for this rule:

    action abstract static bool AppTestModel.InstallApp(TypeOfApp appType, Version appVersion, Guid appID);
    

    it builds successfully, when i try to explore the model it says "Object Reference is not set to an instance of object". and in the errors i get

    undefined type reference 'Version'

    undefined type reference 'Guid'.

    Both of these are managed types, and how can i make use of them in the cord file?

    Thanks,

    anirudh

    Thursday, August 11, 2011 10:17 AM

Answers

  • Hi, I have reproduced your issue successfully, i think the root cause is that you did not write "using System" and other necessary namespaces in your cord.

     

    Monday, August 22, 2011 4:06 AM
    Moderator

All replies

  • Hi anirudh,


    there are restrictions for allowed rule method parameter types - beyond managed types. This might be the problem here. In your case I hope you can replace the GUID-type with a normal string "appID" and convert it in the test adapter :

    Guid guid = new Guid(appID);

    Hope this helps

     

    Friday, August 12, 2011 10:47 AM
  • Hi, Anirudh,

    Can you share your model code and cord here? I am a little confused because your rule returns AppDefinition, but the corresponding action returns a boolean value.

    What is the constraint that you applied on appID?

     

    Thanks,
    Xiang

    Monday, August 15, 2011 8:31 AM
    Moderator
  • Hi, I have reproduced your issue successfully, i think the root cause is that you did not write "using System" and other necessary namespaces in your cord.

     

    Monday, August 22, 2011 4:06 AM
    Moderator
  • Thanks Xiang for the help, i was able to get around with this issue after including the relevant namespaces. Ideally it should have prompted during compilation, shouldn't it?
    Tuesday, November 15, 2011 1:24 PM
  • Anirudh, yes, ideally it should, but since cord editor is not very mature at current stage, we still require users to import the relevant namespaces manually.

    But thanks for reporting this, I will regard your issue as a feature request for cord, and keep you update if we implement that feature in the future.

    Friday, January 6, 2012 2:45 PM
    Moderator