Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.plugtree.examples;
- import org.plugtree.examples.model.OutRecord;
- declare InRecord
- firstname: String
- lastname: String
- age: Integer
- end
- global OutRecord outRecord;
- rule "Maximum Age"
- when
- $maxAge : Number() from accumulate(
- InRecord($age: age),
- max($age))
- $record : InRecord(age ==$age)
- then
- //Use $record here. it has the max age
- outRecord.setValue("MaxAge", $maxAge);
- end
- rule "Longest Name"
- when
- $n : Number() from accumulate(
- InRecord($first : firstname, $last : lastname),
- max($first.length() + $last.length()) )
- $record : InRecord(firstname ==$first, lastname ==$last)
- then
- outRecord.setValue("Longest", $n);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement