!7 //set flag SimpleCRUD_v2_debug. //set flag formLayouter1_debug. beaConcept BPattern { S text; toString { ret "[\*id*/] " + shortDynName(this) + " " + quote(text); } void reactWith(BInput input, IBEAReactor reactor) {} } beaConcept BStarPattern > BPattern { void reactWith(BInput input, IBEAReactor reactor) { LS mapping = matchesToStringList(flexMatchIC_first(text, input.text)); if (mapping == null) ret; reactor.uniqResult(BEAObject, type := "match", +input, pattern := this, +mapping); } } beaConcept BAngleVarPattern > BPattern { void reactWith(BInput input, IBEAReactor reactor) { SS mapping = flexMatchAngleBracketVarsIC_first(text, input.text); if (mapping == null) ret; reactor.uniqResult(BEAObject, type := "match", +input, pattern := this, +mapping); } } beaConcept BMatch { new Ref pattern; SS mapping; } beaConcept BMatchToScenario { void reactWith(BMatch match, IBEAReactor reactor) { reactor.uniqResult(BEAObject, type := "scenario", text := mapToLines(match.mapping, (a, b) -> format_curly("* is a *.", b, a)); } } beaConcept BScenarioToOutput { bool canReactWith(BEAObject o) { ret o.typeIs("scenario"); } void reactWith(BEAObject scenario, IBEAReactor reactor) { reactor.uniqResult(BOutput, type := "Output", text := scenario~.text); } } cmodule2 > DynBEAReactor_textInOut { { input = "UBports community delivers 'second-largest release of Ubuntu Touch ever'"; } start { crud.showClassNameSelectors = true; crud.allowNewFields = true; crud.emptyStringsToNull = true; crud.humanizeFieldNames = false; } void createInitialObjects { uniq BMatchToScenario(); uniq BScenarioToOutput(); //uniq BPattern(text := "* delivers *"); uniq BAngleVarPattern(text := " delivers "); } }