All Questions
230
questions
0
votes
0
answers
32
views
How do I create a custom PMD rule to check if a specific method is called?
I am completely new with the PMD. I am trying to write some basic rules to get used to it. I have this very basic code:
public class Main {
static void print() {
System.out.println("I ...
1
vote
2
answers
100
views
Drools to decide fields to display in UI
I have a scenario where the fields in UI should be displayed based on User roles. For Example- If user is from role "A" then UI will display 5 fields but if the user is from role "B&...
-1
votes
1
answer
60
views
nullPointer envoked on .contains method when querying for String jobTitle
I'm writing a return statement for specific role provisioning -
If everything is in scope, it should return as true and assign the role.
Part of the logic requires the user of
identity.getAttribute(&...
0
votes
0
answers
69
views
Rules executing multiple times- unable to disable the rule
Currently i started using the latest drools engine (9.44.0.Final ) in our project . Previouly i used 7.x version. In my previous version i used the custom java method to enable and disable the rule....
0
votes
1
answer
129
views
How to serialize kiebase in drools-engine 8.43.0.Final
Since the SessionsAwareKnowledgeBase implements KieBase which can't be serializable.
Usecase: Need to serialize the kiebase and store into the cache (redis). At runtime i have to deserialize the ...
0
votes
0
answers
24
views
Can I check file existence using PMD rules?
I want to check if files existence using PMD rules, such as (gitignore, version, readme, . . . ) files.
What is the recommended way to do so?
I searched for the java rules and xpath rules in pmd but I ...
0
votes
1
answer
35
views
How to implement periodic data receiving and executing self-defined tasks?
I'm developing an android app which is connected to a BLE device (to receive temperature values) and the OpenWeatherMap API for receiving weather data.
Now i want to request every 30 minutes the ...
1
vote
1
answer
121
views
Sonar rule for interfaces only RSPEC-1213
I want to modify / make the rule target only public interfaces (not public classes etc). Is this possible ? Im using this rule in Java code but its too strict for my project and I would love to know ...
1
vote
0
answers
218
views
Unable to serialize kiebase in drools-engine 8.29.0.Final
Since the SessionsAwareKnowledgeBase implements KieBase which can't be serializable.
Struggling from the past one week.
Usecase: Need to serialize the kiebase and store into the database.
At runtime i ...
-1
votes
1
answer
2k
views
How to write custom rule to prevent some method call in SonarQube?
Suppose i have one class A and it has three method met1,met2 and met3 i want to build a custom rule where if someone calls met3 it should throw some custom message showing as non compliant solution in ...
0
votes
0
answers
57
views
Drools Business Rules : Unable to determine what is this NULL in exception detail and What these number with colon
I am using Drools BPMN rule engine for business rules validation and getting below errors intermittently in my application.
Exception while executing rules. [determine_flow_name:1 - Determine Flow ...
0
votes
1
answer
309
views
how to execute 2 drool rules in Java with different logic having dependency between them, used ruleflow-group but 2nd rule not getting executed
I am trying to execute different drool rules in java having different business logic but rule 2 needs to be executed after rule 1 gets executed. For this, I have used ruleflow-group. I am able to ...
-1
votes
1
answer
59
views
How to switch from different instructions/rules in an elegant way
hoping for your help!
I'm doing a java project that reproduces the logo language and im capped as I can't find an elegant and not too complicated way to switch between different rules / instructions, ...
1
vote
1
answer
295
views
Drools KieContainer does not fire rules with custom classloader
I am trying to add a non-existing method to a Java bean, compile it and use the newly added method in Drools rules. Via a custom class loader.
I am using CompilerUtils to bind newly modified class to ...
0
votes
1
answer
44
views
Assign either of value that exists or not null RuleInput($date = (this["startDate"] || this["startingDate"]))
Inside RuleInput there may be either "startDate" or "startingDate" , I need to assign value to $date variable either of the value that exists.
Something Like,
RuleInput($date = (...