Wizzi schema wfjob
Exports
production
Element | Tag | Super | Flags |
---|---|---|---|
wfjob | wfjob |
Description
The root element of the wfjob schema.
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
modelsBaseFolder | models-base-folder | string | string |
The base path for the source models used by this "wfjob".
|
||
destBaseFolder | dest-base-folder | string | string |
The base folder path for the generated artifacts.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
require | requires | one-to-many | |||
model | models | one-to-many | |||
line | lines | one-to-many | |||
production | productions | one-to-many |
Element | Tag | Super | Flags |
---|---|---|---|
require | require |
Description
Requires a WizziFactoryPackage.
The IttfNodeValue is the package name.
If the package is not globally installed must be a fully qualified path.
Element | Tag | Super | Flags |
---|---|---|---|
model | model |
Description
A Wizzi model instance acting as a data context during the evaluation of another "model"
or during an artifact generation.
The IttfNodeValue is the name of the model.
The name of the model must be unique in a "wfjob"; it will become the default export name of the context
value that exposes the model during evaluations.
A "model" will be loaded once, and will be reused if
referenced in many evaluations.
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
src | src | string | string |
The path to the PrimaryIttfDocument of the "model".
When relative, the base path is the "modelsBaseFolder"
declared on the "wfjob" element.
|
||
schema | schema | string | string |
The name of the WizziSchema that will validate the "model".
|
||
dumpFile | dump-file | string | string |
A filepath where the loaded must be dumped for test.
The model must implement the toJson method. See the "exportTo" attribute in wizzischema root nodes.
When declared the loaded model is JSON.stringyfied and written
to the "dumpFile" filepath.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
modelRef | modelRefs | one-to-many | References to "model" instances acting as data context during this "model" evaluation. A "model" is referenced by its name. |
Element | Tag | Super | Flags |
---|---|---|---|
modelRef | model-ref |
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
exportName | export-name | string | string |
The name of the context property that will expose the loaded model during
an evaluation. Overrides the name of the "model" that is the default export name.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
transformer | transformers | one-to-many | A model may have one or more transformers. Transformers are chained and the output of a transformation is the input for the next one. | ||
modelCollection | modelCollections | one-to-many | TODO This is a one-to-one relation, not yet implemented. Single items of a collection contained in the "model" may act as data contexts of artifacts where each collection item generates a separate artifact. |
Methods
Signature | Statements |
---|---|
wzinitialize
|
if this.modelCollections.length > 0;
|
Element | Tag | Super | Flags |
---|---|---|---|
modelCollection | model-coll |
Description
Single items of a collection contained in a "model" may act as data contexts
of artifacts where each collection item generates a separate artifact.
This element, contained in a "modelRef" element, specifies:
. the collection name: the IttfNodeValue of this element
. the export name of the collection item when acting as a data context: the "item-name" attribute
. the property names of the collection item that will be used to build the destination path
of the artifact: the "pathTemplateValues" child elements
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
itemName | item-name | string | string |
The export name of a collection item when acting as a data context.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
pathTemplateValue | pathTemplateValues | one-to-many |
Element | Tag | Super | Flags |
---|---|---|---|
pathTemplateValue | path-template-value |
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
attribute | attribute | string | string |
The property of the context object (a collection item) containing the value which will replace
the "token" value in the generated artifact path template.
Is alternative to "function"
|
||
function | function | string | string |
The function of the context object (a collection item) that returns the value which will replace
the "token" value in the generated artifact path template.
Is alternative to "attribute"
|
||
token | token | string | string |
The token that will be replaced by the value returned accessing "attribute" or calling "function"
on a context object.
|
Element | Tag | Super | Flags |
---|---|---|---|
transformer | transformer |
Description
A model transformer
The IttfNodeValue is the transformer path {wizzischema}/{transformerName}
to be found in {wizziPackage}/artifacts/{wizzischema}/{transformerName}/trans/main.js
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
dumpFile | dump-file | string | string |
A filepath where the transformed model must be dumped for test.
When declared the transformed model is JSON.stringyfied and written
to the "dumpFile" filepath.
|
Element | Tag | Super | Flags |
---|---|---|---|
artifact | artifact |
Description
An artifact to be generated.
It is a child element of a "line" element.
Can be one of:
. A Wizzi model instance, acting as a template, which WizziSchema targets a code language technology.
. A swig template.
. A code write generation that takes in input a context of one or more WizziModels.
. A final artifact to be copied to a destination folder without transformations.
. A reference to another WfJob, to be executed before the current WfJob where the artifact is declared.
Context value objects for template transformations are declared in the "model" element, child of the "wfjob" root element
and may be referenced in the elements "modelRef", children of the "artifact" element.
The "src" or "destPath" attributes of an "artifact" element may contain tokens enclosed in graph parens.
When one of the "modelRef@" is a collection model, the artifact generation is repeated
for each item of the collection and the "src" or "destPath" attributes become the template of the destination path.
See the "pathTemplateValues" child elements of the "modelRef" for the values that will replace the tokens.
Example
artifact
dest-path app/db/{table}Datalayer.js.ittf
...
model-ref rdbms
model-coll tables
item-name table
path-template-value
attribute tableName
token table
model rdbms
...
the Wizzi model instance after loading rdbms: {
....
tables: [{
tableName: 'user',
...
},{
...
}]
}
will produce an artifact of path .../app/db/userDatalayer.js, and as many as the items in the tables collection.
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
src | src | string | string |
The path to the primary source document of the artifact.
If relative, the base path is the cwdFolder of the parent line.
Can be a glob pattern
If the artifact is a code write artifact the @src@ attribute must not be declared.
|
||
ignore | ignore | string | string |
files returned by the src pattern to be ignored
Can be a glob pattern
|
||
schema | schema | string | string |
When the artifact source is an Ittf document, is the schema that will load and validate the Wizzi model instance.
May be null if the artifact is a swig template or a final artifact.
|
||
isWfJob | is-wf-job | boolean | false |
Indicator that the artifact source document is a wizzi factory job (WfJob).
The job will be executed before any other artifact production of the current WfJob.
This could be autodected from the schema, but autodetection would forbid other uses or transformations
of a "wfjob" model, so the indicator is required.
|
||
generator | generator | string | string |
When the artifact is a Wizzi model instance, acting as a template is the name of
the artifact generator that will transform the template.
When the artifact is a 'swig template' must contain 'swig'.
When the artifact is a code write generation or a final artifact must be omitted.
|
||
destPath | dest-path | string | string |
The artifact source file path (@src@) is the default relative destination path
of the generated artifact. When set, this attribute overrides the default.
It may be an absolute path.
If the artifact is a code write generation the @destPath@ attribute must be declared.
|
||
extension | extension | string | string |
The document path extension of the generated artifact. Optional. The default is the #src# extension
without the ending '.ittf' string, if present.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
transformer | transformers | one-to-many | When the artifact source is an Ittf document, the loaded WizziModel may need one or more transformations before being passed to the artifact generator. Transformers are chained and the output of a transformation is the input for the next one. | ||
modelRef | modelRefs | one-to-many | References to Wizzi model instances acting as transformation contexts for both wizzi and swig templates. When a final artifact must not be declared. |
Element | Tag | Super | Flags |
---|---|---|---|
line | line |
Description
A line is a group of artifacts having the same "cwdFolder".
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
cwdFolder | cwd-folder | string | string |
The source folder of the artifact templates of this line.
|
||
destFolder | dest-folder | string | string |
The destination folder of the generated artifacts of this line.
Overrides the attribute "destFolder" of the "production" element.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
artifact | artifacts | one-to-many | The artifacts of the "line" |
Element | Tag | Super | Flags |
---|---|---|---|
lineRef | line-ref |
Description
A reference to a line.
Element | Tag | Super | Flags |
---|---|---|---|
production | production |
Description
A job execution unit that generates a set of Software artifacts
into one destination folder.
Attributes
Name | Tag | Type | Default | Inherited | Flags | Description |
---|---|---|---|---|---|---|
destFolder | dest-folder | string | string |
The destination folder of the generated artifacts.
|
Relations
Name | Role | Cardinality | Inherited | Flags | Description |
---|---|---|---|---|---|
modelRef | modelRefs | one-to-many | References to the context WizziWodels used by this "production". | ||
lineRef | lineRefs | one-to-many | References to the "line(s)" to be generated. |
Methods
Signature | Statements |
---|---|
wzinitialize
|
set this.wfjob = this.wzParent;;
foreach modelRef in this.modelRefs;
set this.lines = [];;
foreach lineRef in this.lineRefs;
|