I'm using the EA12 (1215) document generator API to create some documentation. I've a situation where is would be very useful to replace the field value for one or two fields within a template in a particular situation, so I've tried the following JScript fragment:
generationSuccess = docGenerator.DocumentElement( connectedElement.ElementID, level, PROCESS_TEMPLATE );
if ( !generationSuccess )
ReportWarning( "Error generating process documentation: " + docGenerator.GetLastError() );
generationSuccess = docGenerator.ReplaceField("Element.Name", "Method: " + method.Name );
if ( !generationSuccess )
ReportWarning( "Error replacing field: " + docGenerator.GetLastError() );
However, it doesn't seem to replace the field, or give any error. What it does seem to do is truncate the document at the point I call ReplaceField
I don't understand the scope of the ReplaceField method, since wherever I put it, it either breaks the document, or does nothing.
The only reason I could think of for this not doing anything, is that the template calls fragments in which the `Element.Name` field was referenced, but having converted the fragment to a template and called it explicitly, ReplaceField still seems to do nothing.
Does anyone have a good example piece of script that uses ReplaceField effectively with element data fields?
The ACMEContextDocumentGenerator example I've found so far only uses ReplaceField on a single document level custom data field, which is not what I'm trying to do.
Any pointers or suggestions would be greatly appreciated, since I've tried everything I can think of.