AnsweredAssumed Answered

RulesDeployer: What should happen if there are no rules?

Question asked by njames on Oct 3, 2012
Latest reply on Nov 17, 2012 by trademak

I am trying to introduce Drools rules into my current processes. My process currently has a UserTask to manually approve a request. I am looking to add a BusinessRuleTask before it that would only allow the rules to circumvent the UserTask, effectively "auto-approving" the request.

I would like to allow the rules to be custom, but I have a problem in that the RulesDeployer only creates the KnowledgeBase if one or more rules are deployed. If there are no rules deployed, the process fails because it has no KnowledgeBase. My question is "shouldn't the RulesDeployer (or more likely the RulesHelper)  create the KnowledgeBase even if there are no rules"?

      knowledgeBase = (KnowledgeBase) knowledgeBaseCache.get(deploymentId);
      if (knowledgeBase==null) {
        throw new ActivitiException("deployment "+deploymentId+" doesn't contain any rules");

My argument is that the process can allow the possibility of providing business rules without having to have a base "vanilla" "not-approved" rule just to make sure that the KnowledgeBase is created. ( I am more than a little worried about being able to remove the base rule, if some better rules are provided).

Any thoughts, anyone?