tla-sbuilder 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +328 -0
- data/VERSION +1 -0
- data/bin/sbuilder.rb +5 -0
- data/lib/cli/cli-customer.rb +420 -0
- data/lib/cli/cli-example.rb +92 -0
- data/lib/cli/cli-pet.rb +767 -0
- data/lib/cli/cli-text.rb +226 -0
- data/lib/cli/cli.rb +298 -0
- data/lib/sbuilder.rb +52 -0
- data/lib/sbuilder/constants.rb +72 -0
- data/lib/sbuilder/controller.rb +798 -0
- data/lib/sbuilder/default-sbuilder.yaml +372 -0
- data/lib/sbuilder/domain.rb +124 -0
- data/lib/sbuilder/domain_cardinality.rb +37 -0
- data/lib/sbuilder/domain_value.rb +81 -0
- data/lib/sbuilder/exception.rb +27 -0
- data/lib/sbuilder/extension_loader.rb +721 -0
- data/lib/sbuilder/factory.rb +234 -0
- data/lib/sbuilder/model.rb +356 -0
- data/lib/sbuilder/mustache/template.rb +125 -0
- data/lib/sbuilder/mustache/template_reader.rb +206 -0
- data/lib/sbuilder/mustache/template_reader_context.rb +371 -0
- data/lib/sbuilder/param_set.rb +132 -0
- data/lib/sbuilder/param_set_db.rb +20 -0
- data/lib/sbuilder/param_set_def.rb +57 -0
- data/lib/sbuilder/param_set_if.rb +68 -0
- data/lib/sbuilder/param_set_loader.rb +77 -0
- data/lib/sbuilder/param_set_loader_swagger.rb +424 -0
- data/lib/sbuilder/param_set_step.rb +62 -0
- data/lib/sbuilder/param_sets.rb +54 -0
- data/lib/sbuilder/parameter.rb +97 -0
- data/lib/sbuilder/parameter_container.rb +72 -0
- data/lib/sbuilder/parameter_dom.rb +70 -0
- data/lib/sbuilder/parameter_ref.rb +71 -0
- data/lib/sbuilder/resolver.rb +78 -0
- data/lib/sbuilder/resolver_loader.rb +79 -0
- data/lib/sbuilder/resolver_loader_yaml.rb +103 -0
- data/lib/sbuilder/resolver_rule.rb +36 -0
- data/lib/sbuilder/resolver_rule_match.rb +55 -0
- data/lib/sbuilder/resolver_rule_ref.rb +37 -0
- data/lib/utils/hash_inject.rb +12 -0
- data/lib/utils/logger.rb +80 -0
- data/lib/utils/netio.rb +58 -0
- data/lib/utils/string_inject.rb +10 -0
- data/lib/utils/version.rb +13 -0
- data/mustache/cfg/const_def.mustache +8 -0
- data/mustache/cfg/const_run.mustache +3 -0
- data/mustache/cfg/invariant-infrastructure-service.mustache +4 -0
- data/mustache/cfg/macro_run.mustache +6 -0
- data/mustache/cfg/module_footer.mustache +0 -0
- data/mustache/cfg/module_header.mustache +7 -0
- data/mustache/data-model-dump.mustache +19 -0
- data/mustache/data-model-footer.mustache +5 -0
- data/mustache/data-model-header.mustache +16 -0
- data/mustache/definition_types.mustache +40 -0
- data/mustache/domains.mustache +20 -0
- data/mustache/domains_assign.mustache +22 -0
- data/mustache/domains_run.mustache +21 -0
- data/mustache/extend/extend_assumptions.mustache +7 -0
- data/mustache/extend/extend_const.mustache +5 -0
- data/mustache/extend/extend_implementation.mustache +9 -0
- data/mustache/extend/extend_invariant.mustache +7 -0
- data/mustache/extend/extend_invariant_cfg.mustache +7 -0
- data/mustache/extend/extend_macros.mustache +19 -0
- data/mustache/extend/extend_operations.mustache +9 -0
- data/mustache/extend/extend_state.mustache +9 -0
- data/mustache/infrastructure-service-init.mustache +36 -0
- data/mustache/infrastructure-service-variables.mustache +10 -0
- data/mustache/interface_processes.mustache +38 -0
- data/mustache/interface_stubs_dummy.mustache +13 -0
- data/mustache/interface_types.mustache +52 -0
- data/mustache/markdown-header.mustache +24 -0
- data/mustache/markdown-toc.mustache +13 -0
- data/mustache/name_definition_type.mustache +5 -0
- data/mustache/name_domain.mustache +5 -0
- data/mustache/name_domain_value.mustache +5 -0
- data/mustache/name_domain_value_prefix.mustache +5 -0
- data/mustache/name_interface_response_type.mustache +6 -0
- data/mustache/name_interface_type.mustache +6 -0
- data/mustache/name_parameter_definition.mustache +5 -0
- data/mustache/name_parameter_type.mustache +6 -0
- data/mustache/name_process.mustache +6 -0
- data/mustache/name_type_invariant.mustache +5 -0
- data/mustache/name_variable.mustache +6 -0
- data/mustache/operator-infrastructure-service.mustache +13 -0
- data/mustache/possibility/module_extends.mustache +1 -0
- data/mustache/possibility/module_footer.mustache +1 -0
- data/mustache/possibility/module_header.mustache +8 -0
- data/mustache/possibility/possibility_definition.mustache +12 -0
- data/mustache/possibility/possibility_directive.mustache +1 -0
- data/mustache/possibility/possility_setup.mustache +28 -0
- data/mustache/setup/module_footer.mustache +1 -0
- data/mustache/setup/module_header.mustache +9 -0
- data/mustache/setup/operator_run.mustache +7 -0
- data/mustache/setup/operator_tick.mustache +2 -0
- data/mustache/setup/steps_run.mustache +22 -0
- data/mustache/setup/steps_run_bind_rule.mustache +51 -0
- data/mustache/setup/steps_run_bind_set.mustache +37 -0
- data/mustache/setup/steps_run_parameterBind.mustache +80 -0
- data/mustache/setup/steps_run_parameterExact.mustache +79 -0
- data/mustache/state_type_invariant-infrastructure-service.mustache +49 -0
- data/mustache/state_type_invariant.mustache +17 -0
- data/mustache/state_type_invariant_cfg.mustache +18 -0
- data/mustache/state_variables.mustache +20 -0
- data/mustache/tla/const_def.mustache +5 -0
- data/mustache/tla/const_run.mustache +3 -0
- data/mustache/tla/macro-infrastructure-service.mustache +14 -0
- data/mustache/tla/macro_run.mustache +40 -0
- data/mustache/tla/module_footer.mustache +2 -0
- data/mustache/tla/module_header.mustache +9 -0
- data/mustache/tla/operator_run.mustache +8 -0
- data/mustache/tla/operators-infrastructure-service.mustache +12 -0
- data/mustache/tla/plc_define_footer.mustache +1 -0
- data/mustache/tla/plc_define_header.mustache +1 -0
- data/mustache/tla/plc_define_run.mustache +59 -0
- data/mustache/tla/plc_footer.mustache +2 -0
- data/mustache/tla/plc_header.mustache +2 -0
- data/mustache/tla/plc_run_state.mustache +12 -0
- data/mustache/tla/plc_tail.mustache +8 -0
- data/mustache/tla/plc_translation.mustache +2 -0
- data/resources/schema/json_schema/draft-04.json +150 -0
- data/resources/schema/swagger/2.0/schema.json +1591 -0
- data/src-extend/README +2 -0
- data/src-extend/extend/extend_assumptions.mustache +7 -0
- data/src-extend/extend/extend_const.mustache +5 -0
- data/src-extend/extend/extend_implementation.mustache +9 -0
- data/src-extend/extend/extend_invariant.mustache +11 -0
- data/src-extend/extend/extend_invariant_cfg.mustache +7 -0
- data/src-extend/extend/extend_macros.mustache +19 -0
- data/src-extend/extend/extend_operations.mustache +9 -0
- data/src-extend/extend/extend_state.mustache +9 -0
- data/src-extend/extend_app/assumption +20 -0
- data/src-extend/extend_app/correctness +19 -0
- data/src-extend/extend_app/correctness.cfg +9 -0
- data/src-extend/extend_app/infrastructure +25 -0
- data/src-extend/extend_app/interface +11 -0
- data/src-extend/extend_app/operator +18 -0
- data/src-extend/extend_app/possibility +16 -0
- data/src-extend/extend_app/service +33 -0
- data/src-extend/extend_app/state +16 -0
- data/src-extend/extend_app/transaction +22 -0
- data/src/pet/assumption +29 -0
- data/src/pet/assumption_address_domains.tla +12 -0
- data/src/pet/assumption_domains.tla +16 -0
- data/src/pet/assumption_generic.tla +8 -0
- data/src/pet/assumption_id_domains.tla +2 -0
- data/src/pet/assumption_owner_domains.tla +14 -0
- data/src/pet/assumption_pet_domains.tla +16 -0
- data/src/pet/assumption_tag_domains.tla +13 -0
- data/src/pet/correctness +24 -0
- data/src/pet/correctness.cfg +9 -0
- data/src/pet/correctness_coherent_owner_address.tla +6 -0
- data/src/pet/correctness_pet_name.tla +4 -0
- data/src/pet/correctness_ref_tag.tla +13 -0
- data/src/pet/correctness_type_invariants.tla +12 -0
- data/src/pet/correctness_unique_pet.tla +3 -0
- data/src/pet/correctness_unique_tag.tla +3 -0
- data/src/pet/docs/Petstore.md +117 -0
- data/src/pet/extend/extend_assumptions.mustache +7 -0
- data/src/pet/extend/extend_implementation.mustache +9 -0
- data/src/pet/extend/extend_invariant.mustache +11 -0
- data/src/pet/extend/extend_invariant_cfg.mustache +7 -0
- data/src/pet/extend/extend_macros.mustache +19 -0
- data/src/pet/extend/extend_operations.mustache +9 -0
- data/src/pet/extend/extend_state.mustache +9 -0
- data/src/pet/infrastructure +25 -0
- data/src/pet/infrastructure_id_get.tla +24 -0
- data/src/pet/interface +12 -0
- data/src/pet/interface_delete_pet.tla +5 -0
- data/src/pet/interface_get_pet.tla +4 -0
- data/src/pet/interface_post_pet.tla +5 -0
- data/src/pet/interface_post_tag.tla +5 -0
- data/src/pet/interface_put_tag.tla +3 -0
- data/src/pet/operator +30 -0
- data/src/pet/operator_find_tag_by_owner_name.tla +1 -0
- data/src/pet/operator_get_pet.tla +4 -0
- data/src/pet/operator_get_pet_by_tag.tla +4 -0
- data/src/pet/operator_get_tag.tla +10 -0
- data/src/pet/operator_new_owner.tla +3 -0
- data/src/pet/operator_new_pet.tla +13 -0
- data/src/pet/operator_new_tag.tla +3 -0
- data/src/pet/operator_next_pet_id.tla +3 -0
- data/src/pet/operator_responses.tla +8 -0
- data/src/pet/operator_tag_exists.tla +2 -0
- data/src/pet/operator_tag_owner_validated.tla +2 -0
- data/src/pet/operator_tag_referenced.tla +4 -0
- data/src/pet/operator_valid_owner.tla +17 -0
- data/src/pet/operator_valid_pet.tla +6 -0
- data/src/pet/operator_valid_tag.tla +5 -0
- data/src/pet/possibility +18 -0
- data/src/pet/possibility_at_least_two_tags.tla +12 -0
- data/src/pet/possibility_invalid_tag_address.tla +8 -0
- data/src/pet/service +35 -0
- data/src/pet/service_pet_delete.tla +11 -0
- data/src/pet/service_pet_get.tla +27 -0
- data/src/pet/service_pet_post.tla +78 -0
- data/src/pet/service_tag_post.tla +53 -0
- data/src/pet/service_tag_put.tla +82 -0
- data/src/pet/state +16 -0
- data/src/pet/state_infra.tla +6 -0
- data/src/pet/state_pet.tla +5 -0
- data/src/pet/state_tag_id.tla +2 -0
- data/src/pet/transaction +23 -0
- data/src/pet/transaction_delete_pet.tla +13 -0
- data/src/pet/transaction_enter_pet.tla +13 -0
- data/src/pet/transaction_enter_tag.tla +56 -0
- data/src/pet/transaction_error.tla +23 -0
- data/tla-sbuilder.gemspec +43 -0
- metadata +353 -0
@@ -0,0 +1,24 @@
|
|
1
|
+
## {{META.desc}}
|
2
|
+
|
3
|
+
<!-- a class='navigator' href='#top'>[top]</a -->
|
4
|
+
|
5
|
+
{{!
|
6
|
+
|
7
|
+
Usage
|
8
|
+
|
9
|
+
- desc: <descriprion>
|
10
|
+
modelData: <definitions>
|
11
|
+
template: markdown-header.mustache
|
12
|
+
templateParameters:
|
13
|
+
include: <template-to-include>
|
14
|
+
|
15
|
+
to configure this template to include template with name 'template-to-include'
|
16
|
+
|
17
|
+
}}
|
18
|
+
<pre>
|
19
|
+
{{! here expand }}
|
20
|
+
{{>!PARAMETERS.include}}
|
21
|
+
</pre>
|
22
|
+
|
23
|
+
<!-- a class='navigator' href='#top'>[top]</a><br/ -->
|
24
|
+
|
@@ -0,0 +1,13 @@
|
|
1
|
+
(******************************************************************
|
2
|
+
{{META.desc}}
|
3
|
+
- modelData {{META.modelData}}
|
4
|
+
- template {{META.template}}
|
5
|
+
|
6
|
+
******************************************************************)
|
7
|
+
InterfaceOperation2ProcessName( op ) == CASE op = "xxXXxx" -> Nil {{! to ease generation
|
8
|
+
}}{{#infrastructureServices}}
|
9
|
+
[] op = "{{interface_operation}}" -> "{{>name_process.mustache}}" {{/infrastructureServices}}
|
10
|
+
[] OTHER -> Assert( FALSE, "Unknown infrastructure service" )
|
11
|
+
|
12
|
+
|
13
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
EXTENDS setup
|
@@ -0,0 +1 @@
|
|
1
|
+
=============================================================================
|
@@ -0,0 +1,12 @@
|
|
1
|
+
|
2
|
+
(*
|
3
|
+
Define possibility for operator {{possibility}}
|
4
|
+
|
5
|
+
We require that {{META.outputModule}} is false allways.
|
6
|
+
Interpreat violation of this property that it is possible
|
7
|
+
to reach a state where the property holds.
|
8
|
+
|
9
|
+
*)
|
10
|
+
|
11
|
+
|
12
|
+
possible_{{possibility}} == [] ~{{possibility}}
|
@@ -0,0 +1 @@
|
|
1
|
+
PROPERTY possible_{{possibility}}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
(*
|
2
|
+
|
3
|
+
Model version: {{META.model_version}}
|
4
|
+
Generator version: {{META.version}}
|
5
|
+
Generation timestemp: {{META.timestamp}}
|
6
|
+
|
7
|
+
*)
|
8
|
+
|
9
|
+
\* Configuration taken from {{META.setup}}/setup.cfg
|
10
|
+
|
11
|
+
|
12
|
+
\* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
13
|
+
\* Start here
|
14
|
+
|
15
|
+
{{!
|
16
|
+
|
17
|
+
Concatenate content of setup.cfg for current setup 'META.setup'
|
18
|
+
generated under directory 'CONFIG.gen_dir'.
|
19
|
+
|
20
|
+
}}
|
21
|
+
{{#ACTIONS.cat}}
|
22
|
+
{{CONFIG.gen_dir}}/{{META.setup}}/tla/setup.cfg
|
23
|
+
{{/ACTIONS.cat}}
|
24
|
+
|
25
|
+
|
26
|
+
\* End here
|
27
|
+
\* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
28
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
=============================================================================
|
@@ -0,0 +1,7 @@
|
|
1
|
+
(* Control execution *)
|
2
|
+
|
3
|
+
\* RunProcessRunning( stepdefs ) == { e.process : e \in Head( stepdefs ) }
|
4
|
+
RunProcessRunning( stepdefs ) == (CHOOSE s \in Head( stepdefs ): TRUE ).process
|
5
|
+
RunProcessEnabled( stepdefs, s ) == Len( stepdefs ) # 0 /\ s = RunProcessRunning( stepdefs )
|
6
|
+
RunProcessesToRun( stepdefs ) == Tail( stepdefs )
|
7
|
+
RunProcessParameter( stepdefs ) == Head( stepdefs )
|
@@ -0,0 +1,22 @@
|
|
1
|
+
|
2
|
+
(******************************************************************
|
3
|
+
Environment model running the steps
|
4
|
+
|
5
|
+
{{META.desc}}
|
6
|
+
- modelData {{META.modelData}}
|
7
|
+
- template {{META.template}}
|
8
|
+
******************************************************************)
|
9
|
+
|
10
|
+
|
11
|
+
RunSteps == <<
|
12
|
+
{{#steps}}
|
13
|
+
|
14
|
+
{ [ process |-> "p_{{process}}",
|
15
|
+
bindRule |-> {{>setup/steps_run_bind_rule.mustache }},
|
16
|
+
bindSet |-> {{>setup/steps_run_bind_set.mustache }}
|
17
|
+
]
|
18
|
+
} {{_comma}} (* interface/process : {{process}} *)
|
19
|
+
{{/steps}}
|
20
|
+
|
21
|
+
>>
|
22
|
+
|
@@ -0,0 +1,51 @@
|
|
1
|
+
{{#bindRule}}{{#columns.length}}{{!
|
2
|
+
|
3
|
+
Evaluate 'bindRule' inputs
|
4
|
+
|
5
|
+
- :process: _pets__id__delete_
|
6
|
+
:_comma: ''
|
7
|
+
:bindRule:
|
8
|
+
columns: (* HERE *)
|
9
|
+
- :parameter_name: id
|
10
|
+
:domain_element: pet_id_1
|
11
|
+
rows: false
|
12
|
+
columns: false
|
13
|
+
_comma: ''
|
14
|
+
|
15
|
+
|
16
|
+
}}[ {{!
|
17
|
+
|
18
|
+
Iterate 'bindRule' for each column
|
19
|
+
|
20
|
+
}}{{/columns.length}}{{#columns}}{{>setup/steps_run_parameterBind.mustache}}{{/columns}}{{!
|
21
|
+
|
22
|
+
end of some columns defined
|
23
|
+
|
24
|
+
}}{{#columns.length}}]{{/columns.length}}{{!
|
25
|
+
|
26
|
+
If no inputs --> WildCard
|
27
|
+
|
28
|
+
}}{{^columns.length}}WildCard{{/columns.length}}{{/bindRule}}{{!
|
29
|
+
|
30
|
+
Evaluate 'parameterExact' intpus
|
31
|
+
|
32
|
+
- :process: _customers_post_
|
33
|
+
:_comma: ''
|
34
|
+
:parameter: false
|
35
|
+
:parameterExact: (* HERE *)
|
36
|
+
columns:
|
37
|
+
- :parameter_name: customers
|
38
|
+
rows:
|
39
|
+
- rows: false
|
40
|
+
columns:
|
41
|
+
- :parameter_name: id
|
42
|
+
:domain_element: customer_id_1
|
43
|
+
rows: false
|
44
|
+
columns: false
|
45
|
+
_comma: ","
|
46
|
+
|
47
|
+
|
48
|
+
}}{{^bindRule}}WildCard{{/bindRule}}{{!
|
49
|
+
|
50
|
+
No new line --> outputs on one line
|
51
|
+
}}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{{!
|
2
|
+
if 'bindSets' - defined
|
3
|
+
|
4
|
+
- open with {
|
5
|
+
|
6
|
+
}}{{#bindSets.length}} { {{/bindSets.length}}{{#bindSets}}{{!
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
Start of bind set
|
11
|
+
- iterate each input as an record
|
12
|
+
|
13
|
+
|
14
|
+
}} {{#columns.length}}[ {{/columns.length}}{{>setup/steps_run_parameterExact.mustache}}{{#columns.length}} ] {{/columns.length}}{{!
|
15
|
+
|
16
|
+
End of bind set iteration
|
17
|
+
|
18
|
+
output _comma (to separate bind sets
|
19
|
+
|
20
|
+
}}{{_comma}}{{/bindSets}}{{!
|
21
|
+
|
22
|
+
|
23
|
+
End of bind set
|
24
|
+
output }
|
25
|
+
|
26
|
+
}}{{#bindSets.length}} } {{/bindSets.length}}{{!
|
27
|
+
|
28
|
+
else 'bindSet' - not defined
|
29
|
+
|
30
|
+
}}{{^bindSets}}{{!
|
31
|
+
|
32
|
+
Nil if 'bindSet' not defined.
|
33
|
+
|
34
|
+
|
35
|
+
}}Nil{{/bindSets}}{{!
|
36
|
+
No new line --> output to one line
|
37
|
+
}}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
Domain case.
|
4
|
+
|
5
|
+
:parameter:
|
6
|
+
columns: (*HERE *
|
7
|
+
- :parameter_name: id
|
8
|
+
:domain_element: pet_id_1
|
9
|
+
rows: false
|
10
|
+
columns: false
|
11
|
+
_comma: ''
|
12
|
+
|
13
|
+
|
14
|
+
Cases:
|
15
|
+
|
16
|
+
1) domain_element defined --> "domain_element"
|
17
|
+
2) domain_value defined --> domain_value
|
18
|
+
3) else --> Nil
|
19
|
+
4) records/columns
|
20
|
+
5) rows
|
21
|
+
|
22
|
+
|
23
|
+
Case 1:
|
24
|
+
|
25
|
+
}}{{#domain_element}}{{parameter_name}}|->"{{domain_element}}"{{_comma}}{{/domain_element}}{{!
|
26
|
+
|
27
|
+
Case 2:
|
28
|
+
|
29
|
+
}}{{#domain_value}}{{parameter_name}}|->{{domain_value}}{{_comma}}{{/domain_value}}{{!
|
30
|
+
|
31
|
+
Case 3:
|
32
|
+
|
33
|
+
}}{{^domain_value}}{{^domain_element}}{{^columns.length}}{{^rows.length}}{{parameter_name}}|->Nil{{_comma}}{{/rows.length}}{{/columns.length}}{{/domain_element}}{{/domain_value}}{{!
|
34
|
+
|
35
|
+
|
36
|
+
Record
|
37
|
+
|
38
|
+
:parameter:
|
39
|
+
columns: (*HERE* NOTICE NO domain_element )
|
40
|
+
- :parameter_name: pet
|
41
|
+
rows: false
|
42
|
+
columns: (** NOTICE: columns length defined **)
|
43
|
+
- :parameter_name: name
|
44
|
+
:domain_element: pet_name_1
|
45
|
+
rows: false
|
46
|
+
columns: false
|
47
|
+
_comma: ","
|
48
|
+
- :parameter_name: tag
|
49
|
+
:domain_element: pet_tag_1
|
50
|
+
rows: false
|
51
|
+
columns: false
|
52
|
+
_comma: ''
|
53
|
+
_comma: ''
|
54
|
+
|
55
|
+
|
56
|
+
}}{{#columns.length}} _key |-> {[ key |-> "{{parameter_name}}", rec |-> [ {{/columns.length}}{{!
|
57
|
+
|
58
|
+
Here recurse columns
|
59
|
+
|
60
|
+
|
61
|
+
}}{{#columns}}{{>setup/steps_run_parameterBind.mustache}}{{/columns}}{{!
|
62
|
+
|
63
|
+
end of columsn iteration
|
64
|
+
|
65
|
+
}}{{#columns.length}} ]]}{{_comma}}{{/columns.length}}{{!
|
66
|
+
|
67
|
+
NOTICE: no newline --> parameter nicely on one line
|
68
|
+
|
69
|
+
Start array parameter
|
70
|
+
|
71
|
+
}}{{#rows.length}} _rows |-> { [ key |-> "{{parameter_name}}", set |-> { {{/rows.length}}{{!
|
72
|
+
|
73
|
+
iterate rows
|
74
|
+
[ <recursion> ] _comma
|
75
|
+
|
76
|
+
}}{{#rows}} [ {{#columns}} {{>setup/steps_run_parameterBind.mustache}} {{/columns}} ] {{_comma}} {{/rows}}{{!
|
77
|
+
|
78
|
+
End of rows
|
79
|
+
|
80
|
+
}}{{#rows.length}} } ]} {{/rows.length}}
|
@@ -0,0 +1,79 @@
|
|
1
|
+
{{!
|
2
|
+
|
3
|
+
Evaluate
|
4
|
+
|
5
|
+
columns:
|
6
|
+
- :parameter_name: customers
|
7
|
+
rows:
|
8
|
+
- rows: false
|
9
|
+
columns:
|
10
|
+
- :parameter_name: id
|
11
|
+
:domain_element: customer_id_1
|
12
|
+
rows: false
|
13
|
+
columns: false
|
14
|
+
_comma: ","
|
15
|
+
- :parameter_name: address
|
16
|
+
rows: false
|
17
|
+
columns:
|
18
|
+
- :parameter_name: street
|
19
|
+
_comma: ","
|
20
|
+
rows: false
|
21
|
+
columns: false
|
22
|
+
:domain_element: customer_street_1
|
23
|
+
:domain_value: false
|
24
|
+
- :parameter_name: city
|
25
|
+
_comma: ''
|
26
|
+
rows: false
|
27
|
+
columns: false
|
28
|
+
:domain_element: customer_city_1
|
29
|
+
:domain_value: false
|
30
|
+
_comma: ","
|
31
|
+
}}{{!
|
32
|
+
|
33
|
+
Start iterating columns (expect '[' ']' outputted in calling context
|
34
|
+
|
35
|
+
}}{{#columns}} {{!
|
36
|
+
|
37
|
+
- output Name of column
|
38
|
+
- output |->
|
39
|
+
|
40
|
+
}}{{parameter_name}} |-> {{!
|
41
|
+
|
42
|
+
Case 1: column value is a domain_element
|
43
|
+
|
44
|
+
- output "domain_element"
|
45
|
+
|
46
|
+
Notice: if domain_element is false --> use domain_value, and vice versa.
|
47
|
+
Domain value should be used litreralle, and domain element is should be prefixed
|
48
|
+
|
49
|
+
|
50
|
+
}}{{#domain_element}}"{{domain_element}}"{{/domain_element}}{{!
|
51
|
+
|
52
|
+
Case 2: domain_value
|
53
|
+
|
54
|
+
- output: domain_value
|
55
|
+
|
56
|
+
}}{{#domain_value}}{{domain_value}}{{/domain_value}}{{!
|
57
|
+
|
58
|
+
Case 3: no domain_value, no domain_elment, no rows, no columns
|
59
|
+
|
60
|
+
}}{{^domain_value}}{{^domain_element}}{{^columns.length}}{{^rows.length}}Nil{{/rows.length}}{{/columns.length}}{{/domain_element}}{{/domain_value}}{{!
|
61
|
+
|
62
|
+
Case 4: rows
|
63
|
+
|
64
|
+
- output {
|
65
|
+
- iterate rows [ <recursion> ]
|
66
|
+
- output }
|
67
|
+
|
68
|
+
}}{{#rows.length}} { {{/rows.length}}{{#rows}}[ {{>setup/steps_run_parameterExact.mustache}} ]{{_comma}}{{/rows}}{{#rows.length}} }{{/rows.length}}{{!
|
69
|
+
|
70
|
+
Case 5: columns
|
71
|
+
- output [
|
72
|
+
<recursion>
|
73
|
+
- output ]
|
74
|
+
|
75
|
+
}}{{#columns.length}}[ {{>setup/steps_run_parameterExact.mustache}} ] {{/columns.length}}{{!
|
76
|
+
|
77
|
+
End of columns (add comma)
|
78
|
+
|
79
|
+
}}{{_comma}}{{/columns}}
|