Hi All,
I wanted to know whether it is possible to call a recipe inside another recipe. Say for example, I have 1 recipe each to create a business entity project, data access layer project etc., Now, say for creating a solution, is there any way where I can say my CreateSolution recipe will call BusinessEntity recipe, DAL recipe etc.??.. Or the only way is to specify as individual actions grouped together??..
Any help is appreciated..
Regards,
- Santhoo |
| SanthoshMReddy Monday, July 03, 2006 7:16 AM |
Only one recipe can be executing at a given point in time in a given package. So, you could execute more than one recipe, if they were on different packages, but this is an unlikely scenario.
In your case, what you should try is to have different recipes for each, and from the CreateSolution include all the relevant pieces of the other recipes, such as:
<Recipe Name="CreateSolution" xmlns:xi="http://www.w3.org/2001/XInclude"> <Arguments> <--! Solution-level specific arguments --> <--! Include business entity recipe arguments -->
<xi:include href="BusinessEntity.xml" xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(//gax:Argument)" /> </Arguments> <Actions> <--! Solution-level specific actions -->
<--! Include business entity recipe actions -->
<xi:include href="BusinessEntity.xml"
xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(//gax:Action)" />
</Actions> </Recipe>
That way you are achieving composition by reuse of configuration through inclusions.
Let me know how it goes.
|
| kzu Monday, July 03, 2006 8:09 PM |
Only one recipe can be executing at a given point in time in a given package. So, you could execute more than one recipe, if they were on different packages, but this is an unlikely scenario.
In your case, what you should try is to have different recipes for each, and from the CreateSolution include all the relevant pieces of the other recipes, such as:
<Recipe Name="CreateSolution" xmlns:xi="http://www.w3.org/2001/XInclude"> <Arguments> <--! Solution-level specific arguments --> <--! Include business entity recipe arguments -->
<xi:include href="BusinessEntity.xml" xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(//gax:Argument)" /> </Arguments> <Actions> <--! Solution-level specific actions -->
<--! Include business entity recipe actions -->
<xi:include href="BusinessEntity.xml"
xpointer="xmlns(gax=http://schemas.microsoft.com/pag/gax-core) xpointer(//gax:Action)" />
</Actions> </Recipe>
That way you are achieving composition by reuse of configuration through inclusions.
Let me know how it goes.
|
| kzu Monday, July 03, 2006 8:09 PM |
I tried using the xi:include statements but it doesn't seem to work.. For some reason, registration fails whenever I use the xi:include statements. It works fine if I specify explicitly instead of "including". Am I missing something??..
- Santhoo |
| SanthoshMReddy Wednesday, July 05, 2006 10:56 AM |
I've tried using "include" to separaterecipe xmlfrom the main GuidancePackage xml (we have a lot of recipes for service code generation) and hit the sameproblem with registration via the IDE causing an error - although doing a full install still works Ok, but is rather time consuming for testing purposes.
Using"include" for other xml within a recipe itself seems to work Ok though i.e. if I type the recipe directly into the package xml and then use "include" for the TypeAlias.xml in the recipe this allows me to register my package through the IDE just fine. It definitely seems to be something to do with using include in the package xml to include recipes.
Does anyone know how to resolve this problem or do I have to resign myself to lengthly installs and uninstalls every time I want to test my package?
Thanks, Sara |
| Sara_H Wednesday, September 27, 2006 3:56 PM |
Hi Sara_H,
We've a working package which includes whole recipes in separate files and it is working ok, so I don't believe this is an issue with GAX or the XInclude implementation.
It is really easy to miss the XInclude syntax and the fact that VS is not really ready to support this (i.e. intellisense, etc) doesn't help much too...
Can you post your failing package manifest and include file? Or maybe a reduced down version that breaks?
thanks, -Victor. |
| vga Saturday, September 30, 2006 5:50 PM |
Morning Victor,
I actually tried a very much cut down test of this using just the basic package generated by the Guidance Package Development package, I'll try to explain what I did and hopfully you can point out where I'm going wrong :)
I created a new package using the wizard I then took a copy of the main recipe (CreateSolution)from the main package Xml I placed this copy in a separate Xml file called CreateSolution.xml I created a new project folder called "Recipes" I placed the file CreateSolution.xml in the directory "Recipes" I then commented out the recipe CreateSolution in the main package Xml file Finally I added an <include> element like this <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="Recipes\CreateSolution.xml"/>
When I try to use the Register option I get this error message in the output window "The element 'Recipes' in namespace 'http://schemas.microsoft.com/pag/gax-core' has invalid child element 'Recipe'. List of possible elements expected: 'Recipe' in namespace 'http://schemas.microsoft.com/pag/gax-core'"
If I do a similar thing with the file TypeAlias.xml(i.e. move it into my recipes sub-directory and change the XInclude statement to find it there) but leave all the recipe definitionsin the main package Xml then that works fine, hence my confusion :(
Am I doing something obviously wrong?
Thanks for the help, Sara |
| Sara_H Monday, October 02, 2006 10:08 AM |
Hi Sara,
How does your CreateSolution.xml looks like? Please make sure that it starts this way (note the namespace):
<? xml version="1.0" encoding="utf-8" ?>
< Recipe Name="CreateGuidancePackage" xmlns="http://schemas.microsoft.com/pag/gax-core">
And please try referencing it this way (make sure it lives within the <Recipes> element):
< xi:include parse="xml" href="Recipes/CreateSolution.xml" />
Note that I omitted the XI namespace in the above element, this is possible because I added it at the <GuidancePackage> root element,
< GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"
xmlns:xi="http://www.w3.org/2001/XInclude"
....>
I've this working ok in our package, it would be great if you could use it the same way and tell us your results.
HTH, -Victor. |
| vga Tuesday, October 03, 2006 3:59 AM |
Morning :)
I've tried the suggestions you've made above and I still get exactly the same error (The element 'Recipes' in namespace 'http://schemas.microsoft.com/pag/gax-core' has invalid child element 'Recipe' in namespace 'http://schemas.microsoft.com/pag/gax-core>'. List of possible elements expected: 'Recipe' in namespace 'http://schemas.microsoft.com/pag/gax-core')when I try to register the package by right clicking on it.
My CreateSolution.xml now looks like this:
<? xml version="1.0" encoding="utf-8" ?>
< Recipe Name="CreateSolution" xmlns="http://schemas.microsoft.com/pag/gax-core>"> ......
And my package xml now looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<GuidancePackage xmlns="http://schemas.microsoft.com/pag/gax-core"
xmlns:xi="http://www.w3.org/2001/XInclude"
Name="GuidancePackage1"
...
< Recipes>
< xi:include Parse="xml" href="Recipes/CreateSolution.xml" />
< Recipe Name="BindingRecipe"> ........
I'm using the June 2006 GAT & GAX which I downloaded off the MS downloads site last month, is there a newer version I should be using maybe?
Thanks, Sara |
| Sara_H Tuesday, October 03, 2006 9:18 AM |
Hi Sara,
This is weird... I'm using it this way without any issues... did you properly set the buidl action of the external xml files to 'content' right? (although if you didn't I guess you should be getting a different error).
If you can send me (vga AT clariusconsulting.net) the complete main xml and all the included ones (either the ones you're working with orsimpler ones that still repro theissue)I could take a closer look at everyone of them and see if I can see anything wrong with them...
-Victor.
|
| vga Tuesday, October 03, 2006 9:27 PM |
Morning Victor,
Are you aware of the warning to never work with children or animals, as they tend to show you up in some way? Well as far as I'm concerned you can add computers to that list too now!! 
I've arrived at work to read your replythis morning andimmediately set about recreating the problem by performingthe exact same steps as I did yesterday (and the day before!)on yet another new solution with the intention ofzipping it allupto send to you as arepro,but now I can't get it to go wrong unless I do something obviously wrong! So unfortunately I currently cannot reproduce the problem I was having,which hasreally confused me since I'm not aware of having done anything any different! (If the problem does come back I'll try to log exactly what I was doing immediately prior and send you a repro).
To add tomy confusion, the copy I've taken of our main team guidance project is now also co-operating with the in IDE registration process - the only possible difference between this version and the 'proper' version that I can think of is that I've taken the Source Control elements out of everything while I try out ideas.
The only reasoning I can offer is that today is Wednesday ( )
Thank you very much for your help it's been invaluable in getting me this far 
Sara |
| Sara_H Wednesday, October 04, 2006 1:06 PM |
Hi Sara,
Glad you could finally make it work!!
-Victor. |
| vga Thursday, October 05, 2006 12:03 AM |