Sunday, May 02, 2010 11:04 PM
I am learning how to use the Model bus feature to integrate 2 model files (same DSL schema). In the first model I have a shape say "X" which has reference relationship to shape "Y". Now i am trying to add shape "X" on model 1 and shape "Y" on model 2. "X" has a domain property "ExtRef" of type ModelBusReference to indicate that "X" and "Y" are on different model files. Whenever I click on the "ExtRef" property and browse to model 2, I get an errror saying "Not able to open the model*, browse to choose to chosse another model file to reference", am i missing something?
[I am using VS 2010 RC]
Thanks in advance
Monday, May 03, 2010 11:14 PMOwner
Did you create a modelbus adapter for the model you are trying to open?
Wednesday, May 05, 2010 12:13 AM
Yes, i created the model bus adpater using the DslDesignerExtensionForModelbusAuthoring vsix which does everything specified at http://msdn.microsoft.com/en-us/library/ff519531.aspx.
I enabled the model bus on my dsl and added a domain property of type ModelBusReference to a domain class and enabled the model bus reference property to be able to link to another model file (*.testmodel extension) . Afteri build and run my code from experimental hive I open a new solution and add test1.testmodel and test2.testmodel files to the project. I add the shape associaated with the domain class having the ModelBusReference type domain property on test1.test model and try to click the elipse and browse to test2.testmodel and select it. That is when the "Create a reference to model" dialog box shows a error with "Not able to open the model, browse to choose another model file to reference".
Is there a way to find out what is going wrong since this error doesnt help much.
Wednesday, May 05, 2010 10:52 AMOwner
Thanks for your detailed answer. that makes it easier for me to understand.
I don't see anywhere in your description that you also enabled the modelbus for your other model (.testmodel). You need at least to make it visible to the modelbus (have the modelbus authoring extension create an adapter and an adapter manager for it). Did you do that?
Friday, May 07, 2010 7:29 AM
Thanks for your reply.
May be I am missing something here. From the Dsl project I have enabled model bus, then I create a new VS solution with a class library and add two instances of the model file (test1.testmodel and test2.testmodel) to the project using add item dialog. Now I drop a shape on the test1.testmodel and a shape on test2.testmodel. Now on test1.testmodel, I click the property (type ModelBusReference) and try to browse to test2.testmodel and select it. This is when the error is displayed int he "Create reference to model" dialog box.
Please note that I have a single DSL, only that I am adding 2 model items to the project, dropping shapes on this and trying to add reference between these models. I can further explian this with an example.
If you consdier WSSF I think which has 3 types of model one for DataContacts (model1.datacontracts) and one for ServiceContracts (model2.servicecontracts) so it is possible for you to create a reference between these model files as they are two different dsl's. In my case i have one dsl but 2 instances (items) in the project and I am trying to refer 1 instance to the other. So in the dsl project I have only one DslDefinition.dsl file for which I have already enabled model bus and I have the adapter project created.
Hope this clarifies the scenario.
Monday, May 10, 2010 5:52 AMOwner
I understand now.
The only thing I'm not sure is, where did you deploy your DSL? In the experiemental instance of Visual Studio? In that case did you create your class library project with the experimental instance as well?
Wednesday, May 19, 2010 8:49 PMOwner
Can you please respond to JM so that he can help resolve your question? Thanks!
Esther Fan | User Education | If a post answers your question, please click "Mark As Answer" for that post. Thanks!
Thursday, June 03, 2010 3:01 AM
Sorry for the delayed response.
Yes, I had my dsl source project opened in experimental hive, then made changes to enable model bus, rebuilt the solution and hit F5 to open a sample solution in experimental hive, even though I could see the newly added domain property for the model bus and click it to open the model picker, i cannot select a DSL.