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 = (this["startDate"] || this["endDate"]))
What would be the correct syntax for drools?
The correct syntax is to have two rules.
Since the rules are mutually exclusive you won't accidentally fire both.
As a side note, you used an interesting syntax in your question:
The
this["key"]syntax is very old, but it works with objects that have a method of the formpublic Object get(String key). It's most commonly used withMap. You'd hardly ever want to use it in modern drools (and you don't want to pass Maps into rules in general because they serialize very poorly.)