locked
Can i get access of RuleEngine without workflow ? RRS feed

  • Question

  • Hello Every body

    In my application i have schenerio like this.

    1. A user (actually user in this case is admin or domain expert). will configure its UI , means  he will select  'column1' column of 'table1' will be of type 'type1'  and will follow rules 'rule1' , 'rule2' and 'rule3'. 

    in this way he will prepare his presentation layer, (as he is itself uploading data)now in this case there will be some implecit rules applied , and some will be applied by user.

    say id field of table is implicitely sey to number,  but can be set to alphnumeric by user (its a rule applied to that column, that must be executed before data insert)

    so my question is what would be best choice of technology , WF with Rule engine, or just RuleEngine ,

    system is like

    user will upload data(in his own defined schema) -->validate data (again rules)-->cleanse data (Rules )-->enrich data(possible rules again).

    but not all will from start to end , may by some one use this system just for, validation, others for cleansing , and may be others just for enrichment purpose. means any combination.

    in any case rules will be dynamic and our system must be able to accomodate new rules , edited rules and also delete rules.

    may be rules will be stored in DB in xml format

    Rule ID

    Rule description

    Last runtime

    Repository – data model.  Each rule would be closely tied to the repository that it will reside in. 

    Type of rule activity:

    Change data in the record

    Evaluate a condition and display a True or False option – did the rule pass or fail?

    (forget abt extra attributes)

     

    what i am looking from a rule engine is ,

    it extreact rules from DB ---> send then to rule executor(Engine`s other part that will evaluate it)--->send result to the host application.

    and i am in trouble with their triggering event. (when to execute them)

     

    thanks (looking for some gr8 replies)

    Pradeep Tiwari

     

    Thursday, February 8, 2007 10:42 AM

Answers

  • Pradeep emailed us - but adding the response to the thread for the benefit of others.

     

    Hi Pradeep

    As Jurgen said, WF rules can definitely be used outside of a WF. Here are the specific samples you'll need:

     

    External Ruleset Demo:

    http://wf.netfx3.com/files/folders/rules_samples/entry309.aspx

     

    This shows how to externalize the rules to a DB. The sample application that's part of this demo uses these external rules (coming from a DB) inside a WF, but it doesn’t have to.

     

    Rules Driven UI:

    http://wf.netfx3.com/files/folders/rules_samples/entry819.aspx

     

    This shows how to use rules to drive UI - it uses the external ruleset demo's DB to store the rules, but uses it from a plain winforms app.

     

    Thanks

    Kavita

     

    Thursday, February 8, 2007 8:37 PM
    Moderator

All replies

  • Pradeep emailed us - but adding the response to the thread for the benefit of others.

     

    Hi Pradeep

    As Jurgen said, WF rules can definitely be used outside of a WF. Here are the specific samples you'll need:

     

    External Ruleset Demo:

    http://wf.netfx3.com/files/folders/rules_samples/entry309.aspx

     

    This shows how to externalize the rules to a DB. The sample application that's part of this demo uses these external rules (coming from a DB) inside a WF, but it doesn’t have to.

     

    Rules Driven UI:

    http://wf.netfx3.com/files/folders/rules_samples/entry819.aspx

     

    This shows how to use rules to drive UI - it uses the external ruleset demo's DB to store the rules, but uses it from a plain winforms app.

     

    Thanks

    Kavita

     

    Thursday, February 8, 2007 8:37 PM
    Moderator
  •  

    Thanks alot for ur suggestions,
    But still i `m having some doubts, so i prepared a rouph diagram in visio.  Rule DB and its related to Component i took from example u suggested (ExternalRuleSetDemo). but the thing is in ur demo app rulesetservice only services to Policy activities of WF, Is it possible

    1. To use rulesetservice  to service a RuleExecutor and which inturn expose services to the external system, and can be called in any event handler ?
    plz see below ---

    basically looking for UI validation and also DB table schema validation consider 1st one.

    Say i have a InputBox and i want to apply these 4 constraints
    1. it will accept only numeric value
    2. value must not be null
    3. i/p data lenght should be equal to 9 means (xxx-xxx-xxx)
    4. and in xxx-xxx-xxx format

    now all these rules are stored in DB, and i also have a relation b/n control ID in UI and rule ID in relation table.
    now  say on OnLoad even, i want to call these rules and execute them against that perticular control, in this case i have

    1. Dynamic target type (means this time it is inputbox, may be next time some other control, but sure it will be a UI control),
     can i construct rules without knowing target type?

    2. I have to put constrint on various attributes of that control is it possible ?
    3. I am not using WPF, will it be helpfull to use WPf?, see the case is ,UI controls are dynamic means
     user itself will construct UI layout for his group and at the same time he will select which all rules should be applied to that UI control.
     if using WPF will my task easier plz give a brief introduction.

     (sorry this is no facility to attach visio image plz click this link, it represents the architecture of ruleEngine system )

    or suggest me a best possible way to handle this issue.

    please help me..

    thanks

    Pradeep Tiwari

    Friday, February 9, 2007 10:40 AM
  • Hi Pradeep

    I dont understand your question #1, but looking ahead in your post, let me try to answer the ones I do understand.

    1) To author rules using our dialog, you need to bind to a target type so intellisense can pick up the fields/properties/method etc. That said, once authored, the rules can be executed against any other target type as long as the other type has the fields/properties on it that are used by the rules. It doesnt have to be the exact same type, just make sure the fields/props/methods that rules are invoking are on that type.

    2) The RulesDrivenUI demo has constraints on the control. Have you checked that out?

    3) WPF is not required.

    Please let me know if you still have more questions,

    Kavita

    Friday, February 9, 2007 6:57 PM
    Moderator
  • Thanks a lot for ur quick response,

    once again i am in trouble , plz help me

    1. Is it possible to  create Rule which uses Regular expression ?

    I mean, i want to match the input provided by a user should be in the formate of xxx-xxx-xxx and numeric, as this can be easily verified using an object of RegEx and match, but the thing is , user of my system will apply these contraint, "which type and format of i/p he wants in actual from end user",

    so the thing is we have to provide the facility to the imtermediate person(Admin) so he can apply various contraint on the input Controls and end user must follow them.

     

    all in all, Rules are just conditions within if, while etc or we can write a block of code.

    if (a rule) 

    {

    do some thing

    }

    like this or

    match m = regex.match( txt1.text, "^[0-9]*$");

    if (match.success == true)            // here rule is       match.success == true

    {

    do some thing ;

    }

     

    plz help me.

    Thanks

    Pradeep Tiwari

    Thursday, February 15, 2007 1:03 PM
  • Yes it should be possible to do this  - write a custom Rule Expression for Match that takes a string and the regex to compare against. In the Evaluate method, do your RegEx match and return a bool.

    We have a custom rule expression sample to get you started on the community site. http://wf.netfx3.com

    Thursday, February 15, 2007 11:34 PM
    Moderator