AnsweredAssumed Answered

How to use pattern in decision table

Question asked by yihua_evan_yang@yahoo.com on Jul 16, 2015
Latest reply on Jul 23, 2015 by Spar

I have a data model like this:

ContainerClass

     String channel;

     ChildClass[] childList;

ChildClass

     boolean condiftionFlag;

     String decision;

 

I tried to use decision table like this

Channel (condifion)condiftion Flag (condition)decision (action)
Channel oneTrueYes
Channel oneFalseNo

 

So I defined a parameter input is a ContainerClass and a pattern child is any ChildClass in collection input.childList.

And add the above condition and action cells, all works fine, till I compile the project I got this error: Pattern is not allowed in this context.

How to use a pattern for the collection (Array or List) in the decision table?

 

And also when I try to write a test function to initialize the test data:

theChildList is an array of ChildClass initially {

it[0] = aChild;

it[1] = bChild;

}

theContainer is ConatinerClass initially {

  it.channel = "Channel one";

  it.childList = theChildList;

}

and got this error that cant assign a array_of_ChildClass for a "fix_array_of_ChildClass".

How to initialized a fix array?

Outcomes