AnsweredAssumed Answered

Passing srl-entity type to type operator dynamically?

Question asked by Dan Covaliu on Feb 12, 2015

Hi,

 

I am trying to build a completely dynamic template that will be used in multiple ruleset instances, all instances of the same ruleset template.

I have the following value holders:

  1. rulesetNameVH, is of string-provider type and is set as a Single Argument
  2. primitiveTypesVH is of Value list provider and contains the strings 'boolean', 'integer', 'real', 'money'
  3. entityVH is of type SRL Entities Provider and some of its arguments are dynamically overridden as follows: ('Include local entities' argument is set to true)
    1. Ruleset receives rulesetNameVH
    2. SRL Type receives primitiveTypesVH
  4. entityTypeVH is of type SRL Entity Type Provider and some of its arguments are dynamically overridden as follows:
    1. Ruleset receives rulesetNameVH
    2. SRL Entity receives entitiyVH
  5. typeOperatorVH is of type Type Operators Provider and its SRL Type argument dynamically receives entityTypeVH
  6. valueVH is of type typevalues-provider and its SRL Type argument dynamically receives entityTypeVH

 

I set then the Display Format of the template to "For primitive of type: <primitiveTypesVH>, compare <entityVH> <typeOperatorVH> <valueVH>".

I set the SRL Content field to "<entityVH> <typeOperatorVH> <valueVH>"

In order to test this template, because the template uses arguments, I needed to build a "parent" testing template that uses it and passes to it a user selected ruleset from a Rulesets Provider. So the user is supposed to choose a ruleset instance from a list, a primitive type and an entity of that type, and the type and value providers are supposed to adjust themselves. Here is the testing template:

testing template.PNG

I then try to create an instance of the testing template, but I get this error:

Exception logged on Thu Feb 12 11:23:09 EST 2015:

com.blazesoft.util.NdWrappedRuntimeException: Errors were encountered while generating default value for template '/Technical Library/.../Templates/Condition Code Templates/Code Template2'

Error at node 'entityVH'

[0] MissingAllowedValues

Unable to resolve content from entity.

1 error(s) occurred resolving entities.

Resolve Entity Error 1:

Unable to fully resolve the srl content section in template 'Code Template2'.

2 problem(s) occurred while resolving:

  Problem 1: At node Value Holder2.typeOperatorVH: Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeOperatorsProvider' (defined in template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value.Type Operators Provider') invoked from value holder 'typeOperatorVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

  Problem 2: At node Value Holder2.valueVH: Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeValuesProvider' (defined in template '/typevalues-provider') invoked from value holder 'valueVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

 

Error at node 'entityTypeVH'

[1] MissingValue

Argument 'entity' missing for provider 'com.blazesoft.template.repository.provider.NdPromSrlEntityTypeProvider' (defined in template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value.SRL Entity Type Provider') invoked from value holder 'entityTypeVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

Error at node 'typeOperatorVH'

[2] Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeOperatorsProvider' (defined in template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value.Type Operators Provider') invoked from value holder 'typeOperatorVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

Error at node 'valueVH'

[3] Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeValuesProvider' (defined in template '/typevalues-provider') invoked from value holder 'valueVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

MissingAllowedValues

Unable to resolve content from entity.

1 error(s) occurred resolving entities.

Resolve Entity Error 1:

Unable to fully resolve the srl content section in template 'Code Template2'.

2 problem(s) occurred while resolving:

  Problem 1: At node Value Holder2.typeOperatorVH: Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeOperatorsProvider' (defined in template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value.Type Operators Provider') invoked from value holder 'typeOperatorVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

  Problem 2: At node Value Holder2.valueVH: Dynamic override argument 'type' does not have a value for provider 'com.blazesoft.template.repository.provider.NdPromSrlTypeValuesProvider' (defined in template '/typevalues-provider') invoked from value holder 'valueVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

 

com.blazesoft.template.engine.NdMissingArgumentException: Argument 'entity' missing for provider 'com.blazesoft.template.repository.provider.NdPromSrlEntityTypeProvider' (defined in template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value.SRL Entity Type Provider') invoked from value holder 'entityTypeVH' of template '/Technical Library/.../Templates/Condition Code Templates/Compare Primitive Variable to Value'

   at com.blazesoft.template.engine.NdDefaultTemplateValueProvider.missingArgument(String name, NdProviderContext context)

   at com.blazesoft.template.repository.provider.NdPromSrlEntityTypeProvider.getInstantiationValue(NdProviderContext context)

   at com.blazesoft.template.engine.NdValuedInstance.getInstantiationValue()

 

The curious thing is, with the SRL Content section of the template empty, my template works perfectly!!!

I tried to add one by one the placeholders into the SRL Content section: entityVH only, the template still works; but as soon as I add the typeOperatorVH, I get the error.

I surely must do something wrong, but I squeezed my brains for 2 days now. I am using Blaze advisor for .Net 6.10.1.0. Any kind of help would be greatly appreciated. Thank you!

Outcomes