Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression language: how to flatten? #6

Open
pieterbos opened this issue Jul 5, 2016 · 2 comments
Open

Expression language: how to flatten? #6

pieterbos opened this issue Jul 5, 2016 · 2 comments

Comments

@pieterbos
Copy link

The flattening operation and operational template creation operation do not mention the rules section. However, a spec on how to do and possibly a change in the AOM is useful, because nowhere is specified how to handle the following cases:

  • a specialization with rules, parent archetype having rules. What should the flattened archetype look like?
  • archetype root use in a template, with several template overlays containing rules. What should the operational template look like?

I'm not sure if it's possible to merge two rules sections. We could do something like 'component_rules', same as 'component_terminologies' to make things easier, or specify how to merge multiple rules sections into one.

@wolandscat
Copy link
Member

You are right, we need a specification of flattening of the rules section. I think it would be roughly like this:

  • existing declarations remain
  • new statements can be added that use variables declared in a parent
  • new assertions are considered to be ANDed with any stated in specialisation parents
  • existing assertions can be redefined with new statements.

In templates, the scope of any rules section is only the enclosing archetype, not the whole template, so I think this case is simpler.

@pieterbos
Copy link
Author

Sounds good!

With templates that can certainly be easier.

However, if you create an operational template based on a template using archetype_roots, you have only one rules section left in the result, where you have several in the source.
We could choose to say 'you cannot evaluate rules in an operational template, you need the source archetypes for that', or we could find a solution to combine the rules in the operational template, for example with a component_rules section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants