/*
 * Copyright 2015 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

template header
name
age[]
log
coolness

package decisiontables.templates;
//generated from Decision Table
import example.model.User;
import example.model.Car;

template "coolness"
name
age
log
coolness
rule "How cool is @{name} @{row.rowNumber}"
    when
        user.getName().equals("@{name}")
        user.getAge() >= @{age0} && user.getAge() <= @{age1}
    then
        System.out.println( "@{log}" );
        user.setCoolness("@{coolness}");
end
end template
template "uncoolness"
name
age
log
rule "How uncool is @{name} @{row.rowNumber}"
    when
        user.getName().equals("@{name}")
        user.getAge() >= @{age0} && user.getAge() <= @{age1}
    then
        System.out.println( "@{log}" );
        user.setCoolness("Not so cool"); //@{coolness} putting the column in the comments makes the line conditionally display
end
end template

