CodeGenTaskSet
Represents the data for and results of a code generation session comprising of one or more CodeGen tasks. A CodeGenTaskSet object is processed by the CodeGenerator class in order to generate code.
For an example of generating code with the CodeGen API look here.
Syntax
Definition: public class CodeGenTaskSet
Namespace: CodeGen.Engine
Assembly: CodeGenEngine.dll
Constructors
Name |
Description |
CodeGenTaskSet
|
Initializes a new instance of the CodeGenTaskSet class. |
Methods
Name |
Description |
LoadFromFile(String,CodeGenTaskSet)
|
De-serializes a previously saved XML file back to a CodeGenTaskSet object. |
SaveToFile(String)
|
Serializes the current objects data to an XML file. |
Required Properties Set by Calling Application Before Processing
Name |
Type |
Description |
Tasks
|
@ObservableCollection<CodeGenTask> |
|
Optional Properties Set by Calling Application Before Processing
Name |
Type |
Description |
Aliases
|
@ObservableCollection<String> |
The alias names for one or more structures. The number of aliases specified must be less than or equal to the number of structures specified via the Structures property. Aliases listed here will be used for any task that does not list aliases.
|
ContinueAfterError |
Boolean |
Continue processing after errors. If multiple templates, files or tasks are being processed then this option allows code generation to continue even though one template/structure combination has generated an error. Setting this property is the equivalent of using the -c command line option.
|
DatabaseType
|
Database to target with the SQL_ field loop replacement tokens. Setting this property is equivalent to using the -database command line option. The default database targeted is Microsoft SQL Server.
|
|
DataMappingsFile |
String |
Specifies that custom data mappings are loaded from an XML file. Refer to Customizing Data Type Mappings in the docs for more info. Setting this property is the equivalent of using the -cdm command line option.
|
Defines
|
@ObservableCollection<String> |
Defined identifiers. Adding values to this collection is equivalent to using the -define command line option. |
Description
|
String |
A description of the task set. Not used by CodeGen, but it may be useful for consuming code to display task set descriptions in their UI. |
EchoCommands
|
Boolean |
Display the command line used to start CodeGen. Setting this property is the equivalent of using the -e command line option. |
EmptyLoopFail
|
Boolean |
This option restores the original CodeGen behavior of causing a failure if certain types of loop are encountered with no supporting data. For example, if a key loop is encountered when processing a structure with no keys. Setting this property to true is equivalent to using the -elf command line option.
|
FileOverrides
|
@ObservableCollection<String> |
File Overrides. This option allows you to specify which repository file definition is used for each structure that you are processing. This option is useful if the structure that you are using is assigned to multiple files, because CodeGen will by default will always select the first assigned file. The number of file overrides must be less than or equal to the number of structures being processed. Adding repository file definition names to this collection is equivalent to using the -fo command line option.
|
ListGeneratedFiles |
Boolean |
List Files. Lists the names of any files generated when not running in verbose or debug logging modes. Setting this property is the equivalent of using the -lf command line option.
|
LoggingLevel
|
Logging level. Setting this property is the equivalent of using using one of the -v, -d, or -debug command line option. |
|
LogTokenizerResults |
Boolean |
Causes CodeGenerator to create log files containing the internal results of the code tokenization and parsing phases. Setting this property is the equivalent of using the -dt command line option.
|
|
The method catalog instance on which code generation is currently based. |
|
OutputFolder |
String |
Output directory. Defaults to the current directory, or the directory specified with the CODEGEN_OUTDIR environment variable. You can use a full or relative path, or a logical followed by a colon (e.g. SRC:). Setting this property is the equivalent of using the -o command line option. A value set here provides a default value to each task in the task set.
|
String |
Repository main file to use for this task set. Providing a value here provides a default value for each task in the task set. Setting this property is the equivalent to using the -rps command line option, or setting the RPSMFIL environment variable.
|
|
String |
Repository text file to use for this task set. Providing a value here provides a default value for each task in the task set. Setting this property is the equivalent to using the -rps command line option, or setting the RPSTFIL environment variable.
|
|
StructFieldPrefix
|
String |
Prefix to be applied to struct fields (optional). |
Structures
|
@ObservableCollection<String> |
The names of one or more repository structures to be processed. Structures listed here will be used for any task that does not list structures. |
TemplateFolder |
String |
Input file directory containing templates. Defaults to the current directory, or the directory specified with the CODEGEN_TPLDIR environment variable. You can specify a full or relative path, or a logical name followed by a colon (e.g. TPL:). Setting this property is the equivalent of using the -i command line option. Setting a value here provides a default value for all tasks in the task set.
|
ThrowOnError
|
Boolean |
Should some errors be re-thrown to a assist with debugging? |
Properties Set by CodeGenerator During Processing
Name |
Type |
Description |
Complete
|
Boolean |
Indicates that all tasks within the task set completed without errors or warnings. |
LastErrorMessage
|
String |
The last error message that was reported for all tasks in the task set. |
Messages
|
@ObservableCollection<String> |
All messages that were reported while processing the task set. |
Events Raised During Processing
Name |
Description |
StartingTaskSet
|
Raised by CodeGenerator just before it starts processing the task set. |
TaskSetComplete
|
Raised by CodeGenerator just after it finishes processing the task set. |
TaskSetMessage
|
Raised each time a new message is added to the messages collection. |
Copyright © 2021 Synergex International, Inc.