No problem. I'm not sure how you'd do this in a decision table (it's probably pretty trivial) but in DRL you'd do: rule "makePhoneNumber" when s: String() then insert(new PhoneNumber(s)); retract(s); end With two caveats: 1) you need some conditions on the String matched if there are other Strings that don't make PhoneNumbers. 2) The rule could use a salience value higher than the pricing rules, but that isn't necessary. Actually, there's a third caveat, and it's a big one: this won't work with sequential mode. This is because the rule above would alter working memory with the expectation that the pricing rules would react to the change. If you want to use sequential mode you'll have to convert to PhoneNumber objects before hand. I understand that you're using this Jbilling package, but is there no way you can put an intermediate adapter between the two? It'd be as simple as inserting "new PhoneNumber(someString)" instead of "someString". --- On Fri, 5/14/10, Antonio Anderson Souza <antonio@voicetechnology.com.br> wrote:
|