-
Notifications
You must be signed in to change notification settings - Fork 9
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
DROOLS-7475 Proposed feature for ['key'] accessor #50
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+6.33 MB
...ok-integration-runtime-1.0.2-SNAPSHOT.jar → ...ok-integration-runtime-1.0.3-SNAPSHOT.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
- RuleSet: | ||
hosts: | ||
- all | ||
name: test squared accessor | ||
rules: | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range['pi'] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r1 | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range["pi"] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r2 | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range["pi"].value | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r3 | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range[0] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r4 | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range[-1] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r5 | ||
- Rule: | ||
action: | ||
Action: | ||
action: debug | ||
action_args: {} | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Fact: range["x"][1][2].a["b"] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r6 | ||
sources: | ||
- EventSource: | ||
name: range | ||
source_args: | ||
limit: 5 | ||
source_filters: [] | ||
source_name: range |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
- RuleSet: | ||
hosts: | ||
- all | ||
name: Test squared accessor | ||
rules: | ||
- Rule: | ||
actions: | ||
- Action: | ||
action: debug | ||
action_args: | ||
msg: 'Testcase #1 passes' | ||
condition: | ||
AllCondition: | ||
- EqualsExpression: | ||
lhs: | ||
Event: asd["x"][1][2].a["b"] | ||
rhs: | ||
Float: 3.1415 | ||
enabled: true | ||
name: 'r1 squared accessor' | ||
sources: | ||
- EventSource: | ||
name: generic | ||
source_args: | ||
payload: | ||
- asd: | ||
x: | ||
- 0 | ||
- - 0 | ||
- 0 | ||
- a: | ||
b: 3.1415 | ||
id: 'Testcase #1' | ||
source_filters: [] | ||
source_name: generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
- RuleSet: | ||
hosts: | ||
- all | ||
name: Test squared accessor with selectattr operator | ||
rules: | ||
- Rule: | ||
actions: | ||
- Action: | ||
action: debug | ||
action_args: | ||
msg: Output for testcase | ||
condition: | ||
AllCondition: | ||
- SelectAttrExpression: | ||
lhs: | ||
Event: asd["x"][1][2].a | ||
rhs: | ||
key: | ||
String: b | ||
operator: | ||
String: == | ||
value: | ||
Float: 3.1415 | ||
enabled: true | ||
name: r1 selectattr and squared accessor interaction | ||
sources: | ||
- EventSource: | ||
name: generic | ||
source_args: | ||
payload: | ||
- asd: | ||
x: | ||
- 0 | ||
- - 0 | ||
- 0 | ||
- a: | ||
b: 3.1415 | ||
id: 'Testcase #1' | ||
source_filters: [] | ||
source_name: generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tarilabs if you use the tools/convert_to_ast.py from the ansible-rulebook repo and convert the rulebook to ast format you will get the sources data included and then if we add the ast yml file to this list
drools_jpy/tests/test_ruleset.py
Line 935 in f1fade2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with 324f2de