This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
question("S1"){ | |
"Select something" select: ['one','two','three','four','five'], | |
map: 'selectme', | |
hint: 'select one of the options', | |
default: 'three', | |
preamble: 'Yep you can explain this with a preamble' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form { | |
question("test") { | |
"All elements" group: "theLot", | |
hint: 'This is a group', { | |
"Text input 20?" text: 20, | |
map: 'text20', | |
hint: 'this is a 20 char text', | |
preamble: 'This is 20 char text with a pattern match so only letters can be entered', | |
pattern: [/[A-Za-z]+/, 'You can only have letters'], | |
sugest: 'colour', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.nerderg.rules.RulesEngine | |
import com.nerderg.rules.RulesetDelegate | |
import groovy.io.FileType | |
/** | |
* User: pmcneil | |
* Date: 18/10/11 | |
* | |
*/ | |
File dir = new File(".") | |
def nameMatch = ~/.*\.ruleset/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rule('M8 Fap Health Care Card') { | |
def faps = fact.fap | |
faps.each { fap -> | |
def M8Q = fact.M8.fap[fapName(fap)] | |
if (M8Q?.yes && M8Q.healthCard == 'none') { | |
fact.require.add([Q: 'M8', message: "a copy of ${fap}'s health care or pensioner concession card."]) | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
question("G2") { | |
"What is your name?" group: "names", hint: "Name of the person requiring assistance", { | |
"Title" text: 10, hint: "e.g. Mr, Mrs, Ms, Miss, Dr", suggest: "title", map: 'title' | |
"Given Names" text: 50, required: true, map: 'givenNames' | |
"Last or Family Name" text: 50, required: true, map: 'lastName' | |
"Have you been or are you known by any other names?" hint: "e.g. maiden name, previous married name, alias, name at birth", map: 'knownByOtherNames',{ | |
"List your other names" listOf: "aliases", { | |
"Other name" text: 50, map: 'otherName' | |
"Type of name" text: 40, hint: "e.g maiden name", suggest: "nameType", map: 'otherNameType' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.nerderg.rules.RulesEngine | |
import com.nerderg.rules.RulesetDelegate | |
import groovy.io.FileType | |
/** | |
* User: pmcneil | |
* Date: 18/10/11 | |
* | |
*/ | |
File dir = new File(".") | |
def nameMatch = ~/.*\.ruleset/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.nerderg.rules.RulesEngine | |
import com.nerderg.rules.RulesetDelegate | |
import groovy.io.FileType | |
/** | |
* User: pmcneil | |
* Date: 18/10/11 | |
* | |
*/ | |
File dir = new File(".") | |
def nameMatch = ~/.*\.ruleset/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.nerderg.rules.RulesEngine | |
import com.nerderg.rules.RulesetDelegate | |
import groovy.io.FileType | |
/** | |
* User: pmcneil | |
* Date: 18/10/11 | |
* | |
*/ | |
File dir = new File(".") | |
def nameMatch = ~/.*\.ruleset/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void testSomething() { | |
Collection.metaClass.and = { Collection b -> | |
addAll(b) | |
} | |
List a = ['one','two', 'three'] | |
List b = ['four', 'five'] | |
a & b | |
println a | |
assert a == ['one','two', 'three','four', 'five'] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.nerderg.test | |
class TestController { | |
def index = { | |
} | |
def changeColour = { | |
withPerson { | |
log.debug dump() |
NewerOlder