Advertisement
Guest User

Untitled

a guest
Sep 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
D 0.55 KB | None | 0 0
  1. package org.plugtree.examples;
  2.  
  3. import org.plugtree.examples.model.OutRecord;
  4.  
  5. declare InRecord
  6.     firstname: String
  7.     lastname: String
  8.     age: Integer
  9. end
  10.  
  11. global OutRecord outRecord;
  12.  
  13.  
  14. rule "Maximum Age"
  15.     when
  16.         $maxAge : Number() from accumulate(
  17.             InRecord($age: age),
  18.             max($age))
  19.     then
  20.         outRecord.setValue("MaxAge", $maxAge);
  21. end
  22.  
  23.  
  24. rule "Longest Name"
  25.     when
  26.         $n : Number() from accumulate(
  27.             InRecord($first : firstname, $last : lastname),
  28.             max($first.length() + $last.length()) )
  29.     then
  30.         outRecord.setValue("Longest", $n);
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement