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

Rule creation fails if template or module types are not present #58

Closed
kaikreuzer opened this issue Aug 14, 2015 · 2 comments
Closed

Rule creation fails if template or module types are not present #58

kaikreuzer opened this issue Aug 14, 2015 · 2 comments
Assignees

Comments

@kaikreuzer
Copy link
Collaborator

The constructor of RuleImpl throws an IllegalArgumentException, if used templates or module types are not available in the system.
This can create a bunch of critical lifecycle problems:

  • Rules can not be restored from the database, if the ManagedRuleProvider starts before bundles holding the templates or module types
    -The RuleBundleResourceImporter will fail the import, if a rule is declared in one bundle why the types are provided by a specific provider from another bundle.

I see two solutions to this problem:

  1. Try to get the dynamic behavior under control, i.e. listen for things coming and going and retry instantiation, as soon as all dependencies are available. I think this might be quite nasty to implement.
  2. Only use the DTO model within the RuleRegistry, which would cut all those dependencies. Move the instantiation problem to the RuleEngine, where the RuleImpl instances are really only required. This would allow the RuleRegistry to offer a consistent view on the rules in the system, regardless if their underlying module types are (still) available in the system or not.

I very much prefer option 2 as I think in option 1 rules can miraculously disappear from the system when module types disappear - they should rather be in an error status in this case.

This was referenced Aug 14, 2015
@danchom
Copy link

danchom commented Aug 17, 2015

We agree that rule must be created even the template does not exist. It will be done.
ModuleTypes are not used by the RuleEngine and there is no problem with them. The HandlerFactories are tracked by the rule engine and they reflect to the rule status.
We are Ok with point 2. See the issue #60.

@dnobel
Copy link
Collaborator

dnobel commented Aug 18, 2015

Ok, perfect.

danchom pushed a commit to danchom/smarthome that referenced this issue Aug 25, 2015
Rule creation fails if template or module types are not present eclipse-archived#58
marinmitev#58

DTO model is not "clean" eclipse-archived#60
marinmitev#60

Make RuleRegistry work without ManagedProvider (StorageService) eclipse-archived#65
marinmitev#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit to danchom/smarthome that referenced this issue Aug 25, 2015
Rule creation fails if template or module types are not present eclipse-archived#58
marinmitev#58

DTO model is not "clean" eclipse-archived#60
marinmitev#60

Make RuleRegistry work without ManagedProvider (StorageService) eclipse-archived#65
marinmitev#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit to danchom/smarthome that referenced this issue Aug 26, 2015
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present eclipse-archived#58
marinmitev#58

DTO model is not "clean" eclipse-archived#60
marinmitev#60

Make RuleRegistry work without ManagedProvider (StorageService) eclipse-archived#65
marinmitev#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit to danchom/smarthome that referenced this issue Aug 27, 2015
fix comments of PR eclipse-archived#72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present eclipse-archived#58
marinmitev#58

DTO model is not "clean" eclipse-archived#60
marinmitev#60

Make RuleRegistry work without ManagedProvider (StorageService) eclipse-archived#65
marinmitev#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit that referenced this issue Oct 9, 2015
fix comments of PR #72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present #58
#58

DTO model is not "clean" #60
#60

Make RuleRegistry work without ManagedProvider (StorageService) #65
#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
kaikreuzer pushed a commit to kaikreuzer/smarthome that referenced this issue Oct 15, 2015
fix comments of PR eclipse-archived#72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present eclipse-archived#58
marinmitev#58

DTO model is not "clean" eclipse-archived#60
marinmitev#60

Make RuleRegistry work without ManagedProvider (StorageService) eclipse-archived#65
marinmitev#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit that referenced this issue Nov 13, 2015
fix comments of PR #72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present #58
#58

DTO model is not "clean" #60
#60

Make RuleRegistry work without ManagedProvider (StorageService) #65
#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit that referenced this issue Nov 23, 2015
fix comments of PR #72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present #58
#58

DTO model is not "clean" #60
#60

Make RuleRegistry work without ManagedProvider (StorageService) #65
#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
danchom pushed a commit that referenced this issue Nov 23, 2015
fix comments of PR #72
The PR contains inplementation of issues: 58, 60, 65

Rule creation fails if template or module types are not present #58
#58

DTO model is not "clean" #60
#60

Make RuleRegistry work without ManagedProvider (StorageService) #65
#65

Signed-off-by: Yordan Mihaylov <j.mihailov@prosyst.bg>
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

4 participants