-
Notifications
You must be signed in to change notification settings - Fork 115
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
Clara rules throws a Null Pointer Exception even though there is no Null values #437
Comments
@stLalo, As to why the null pointer is thrown, do you have the state of the atom when the RHS is fired?
|
@EthanEChristian
As the ETL Software is a Parallel Synchronous multi-thread processor, the state was lost somewhere in between threads. I think my proper solution could be the following steps:
Please bare with me as I am refactoring legacy code and it is the first time encountering this problem. |
@stLalo,
Without knowing the constraints of your codebase I can't say for sure, but I feel that all events could be processed in the same session for:
But regardless of 3&4, I think that the |
So what I have in mind would be something like
Repeat the same steps with other rules and queries. |
Rules that bind and insert the same fact type can be dangerous as they are prone to infinite looping. For queries, you could use parameters to be more flexible in the event that you need other event types:
|
So to continue with this thread, I went back and did the following to my rules.
This works wonderful for only one rule. However, I have cases where Event Records will be true for several Rules. Inserting! the true fact into NewEvent, will cause the creation of duplicates of the same events but with different values here and there. |
@stLalo, From some of the things that you posted so far, it looks like you are trying to apply a series of changes to the original model. The way I was thinking would be something like this: Facts:
Correction Rules:
Consolidation:
Query:
This side steps the duplicate event behavior by adding an accumulator and consolidation rule. |
I suppose if the Session had enough scope it might include rules that wanted to correct the same field. That might require a hierarchy of what corrections need to be applied in what order. The approach above could also be done where the correction fact would contain a |
Description
I am building a ETL Software and I use clara rules to clean data by applying certain constraints (rules) to shape the data as I want. Rules always work well, until I make my ETL Software a multi-threading parallel synchronous processor. After this, I started running stress testing on the software and I was able to caught an exception that is weird because Clara is screaming at me for trying to divide a null value.
Steps to reproduce
Actual Behavior
The text was updated successfully, but these errors were encountered: