Can we use Constants or Rules under decision Table?
Currently I believe either we have to hard code conditions or we have to execute a logic outside of the decision table and Pass into decision table as boolean in order to display Error message. Also to display error message we have to hardcode it . can we create a constant and use it inside decision Table? can we execute the logics using expression rule inside a table?
Discussion posts and replies are publicly visible
hi karthikk640
in decision table we can use constants and expression with in input and output variables,
Select Input/output >> Use a drop down to list values you can select for this input >>Edit as expressions
their we can find Choice Values,Choice Label's
ASFIK,we can not execute the logic's using expression rule inside a table
please correct me if i'm wrong ...
input output
rule!test(ruleinput)= true output1
rule!test(ruleinput)= false output1
you have to hard code rule input,and the rule must return Boolean value,
currently you are doing this right?
in input i have configured a rule which returns List of Number(this rule returns the data based on rule input,we have to hard code it in decision table),
by doing this we will get drop down to select the values return by the rule which we configured in input
kchaitanyam Thank you very much for your answer. Now I got it what your saying, yeah we can do this but my view is to execute expression based on input entered by the user. for Example. if we are using a number field which has validation "Values should be less than 255 characters"(where we have to check length )and "value should be greater than 100" (Comparison) When user enters values in Integer field from UI , Currently we can achieve this by creating an expression rule which returns true or false and trigger a decision from decision table based on Boolean value returned by expression rule. You got it right? Please let me know if we can achieve this in decision table itself.
try this
a!integerField( label: "Number", value: ri!number, saveInto: ri!number, validations: rule!Test_Decision_rule(number: ri!number ))
karthik no need to take another rule (rule!checkValue),decision table is enough. in your take input as number Integer,output as Text
if input < 100 output 1 if input > 255 output 2
pass your input which is entered from UI,to that decision table a!integerField( label: "Number", value: ri!enteredValue, saveInto: ri!enteredValue, validations: rule!Test_Decision(input:ri!enteredValue) )
ok karthik
if you want len(), regexMatch() valadations,
pass inputs from UI