stringwhitespaceilogjrules

Remove whitespaces, from input string type parameter value, using BAL in ILog Jrule


I have a rule which take a String type input parameter. Can I remove the whitespaces from the value this parameter holds using BAL.

If not what is the other option to do this. In this JRule there is a decision table where condition column is this parameter and then output is action column.

Say you define Rulset Paramter "Name" of type String for Rule IsDepartmentManager where output ruleset parameter is boolean.

Now in the decision table the values in Name column is say "John" and out for this is True. Otherwise False.

Now when this rule is invoked as web-service the input send is "John ". As the name contains white spaces and the decision table do the exact matching, the result return is False.


Solution

  • You can add an Initial Action in your Rule Task (that contains the Decision Table or the rule) in which you can execute theInputString.trim();