L.S.,
I'm trying to reuse/convert a whole set of templatebindings, tasks, etc. used in v3.5 now in v4.2
In that set of template files there are a few lpt templates (e.g. LptFkBuildParameterStrings) in C# which are labeled with includeOnly="true", which I understood means that no separate class is generated in the generator source; in stead the lpt file will only be used to complete the "calling" lpt template classes, by using a line like:
_%> <# LptFkBuildParameterStrings #> <% _
When trying to generate source code, the "calling" lpt template classes are generated correctly but it also generates a separate class in the generator source for the IncludeOnly template; which gives an error like:
Error Code Generation Cycle failed.
Error CS0103, at line: 447, pos: 112: The name 'relation' does not exist in the current context
obviously relation is a variable in the "calling" lpt script.
in templatebindings if have defined:
• templateID="FkBuildParameterStrings"
• filename="BusinessLogic\C#\fkBuildParameterStrings.lpt"
• templateLanguage="C#"
• includeOnly="true"
The first part of the generated class is presented below. Any ideas? How do I make sure an IncludeOnly template is only included in other templates (other than using the described settings)?
_
public class FkBuildParameterStrings : ITemplateClass {
private StreamWriter __outputWriter;
private IGenerator _executingGenerator;
private Dictionary<string, TaskParameter> _parameters;
private string _templateID = "COWI_FkBuildParameterStrings";
private string _templateBindingDefinitionName="COWI";
private object _activeObject;
public COWI_FkBuildParameterStrings() {
__outputWriter=null;_executingGenerator=null;_parameters=null;_activeObject=null;
}
private void __ScriptCode() {
String _forDatatypeParameter = "";
String _forAttributeParameter = "";
String _forParameter = "";
String _forEntityDeleteParameter = "";
String _forEntityAttributeParameter = "";
String _forParameterCamelCase = "";
String _forConcatParameter = "";
String _forFilterFieldValue = "";
String _relatedDatatypeParameter = "";
String _relatedAttributeParameter = "";
String _relatedParameter = "";
String _relatedEntityDeleteParameter = "";
String _relatedEntityAttributeParameter = "";
String _relatedParameterCamelCase = "";
String _relatedConcatParameter = "";
String _relatedFilterFieldValue = "";
int countfieldPairs = 1;
foreach( SD.Tools.Algorithmia.GeneralDataStructures.Pair<IFieldElementCore, IFieldElementCore> fieldPair in relation.GetRelationshipFieldPairs() )
{_