Taking User confirmation in drools 5.4 -
i have requirement in
- if validation fails, have ask user whether continue or not.
- if user says yes, have
persist data in db
, - if user says no
data won't persisted in db
. - the validations performed in validate.drl.
once these validations performed,i have ask user if wants continue or not. process flow follows:
start -> input.drl -> validate.drl -> takeuserconfirmation.drl -> persistdata.drl
in above flow, have add logic in takeuserconfirmation.drl
user should confirm if wants continue or not. depending on answer given i’ll restrict rule in persistdata.drl
. execute if user confirms persistence. how can achieve this? can human task i.e. work item handler useful case? how pause drools flow, take user confirmation , start same flow again ?
the question why want in drools. rule file doesn't seem right place user interaction. rather return application code collection of objects validation failed (you can flag them) , if confirmed execute presistdata.drl them.
so in final version have 2 separate flows:
- input -> validate -> persist (you can have additional flag on object validated checked in persist)
- persist executed once more after confirmation
also wonder purpose input.drl?
this should rather comment post don't have required 50 rep.
Comments
Post a Comment