Spis treści

Drools, part 1.

Problem statement

The goal of this class is to model an offer process in a small company. The diagram below shows a generalized task flow in the process:

The offer process is initiated via an external document describing the order. The description takes many different forms, from informal inquiries (contact is the only valuable part), to highly formalized documents describing the order, broken down into several aspects (commercial, formal, etc). One can distinguish two important features of the query:

  1. formal requirements defining the process, eg. preventing or limiting contact with the ordering party at the offer stage, as well as the commercial terms of joining the offer procedure.
  2. the level of order specification, e.g. from one that barely signals the subject matter and does not allow any analysiks without further inquiries, to a coherent and complete presentation of the item, which should be enough to prepare the offer.

The process that we want to model will support the user in making decisions during the three main stages of processing the offer inquiry:

  1. Formal analysis.
  2. Substantive analysis.
  3. Preparing the right offer.

Formal Analysis

First of all, a formal/commercial analysis has to performed. One has to check the conditions, whether the company is able to fulfill the order according to the proposed procedure.

At this stage, the conditions are verified, such as having the right permissions, having the required certificates, appropriate company qualifications, etc.
Negative completion of this stage results in automatic termination of the offer process.

Substantive Analysis

If the formal analysis ends with a positive result, the substantive analysis is performed on the query. Substantive analysis consists of two phases: preliminary substantive analysis and proper substantive analysis. During the initial analysis, it is determined (based on the available knowledge) whether the order can be completed. Factors such as availability of teams, project risk, attractiveness of the order etc. are taken into account here. If the order is feasible, then the proper analysis is performed, during which the cost estimate and the substantive part of the offer are prepared based on the opinions of the experts (e.g. IT department employees). If it turns out that the specification provided in the inquiry is insufficient, then the customer is contacted (if it is possible) to the get missing data. If the contact with the customer is impossible, the request is rejected.

The results of the substantive analysis are: the concept of the solution and the initial cost estimates.

Creating the offer

The substantive analysis' results serve as a starting point for preparing the right offer. This stage, carried out by the sales department, is designed to develop the final valuation. The final valuation is calculated on the basis of the valuation prepared by the IT department and appropriate modifiers as: commercial attractiveness, substantive attractiveness, how important is the client, etc.

The offer prepared this way has to be approved by the board, and can be sent to the clien only after applying required fixes and changes.

The modeling of the described example will include:

  1. Rule aspect: Defining a rule system supporting a user in the decision-making process at the stages of formal, substantive and offer preparation.
  2. Process aspect: Mmdeling the complete process describing the request processing.

The description you've just read is only meant to introduce into the context. Details, like sizes, attributes, coefficients and their dependencies describing the problem will be introduced only at the appropriate modeling stage. The instructions are not binding and you can freely make modifications at your own discretion / invention.

Scope of the 1st part

Guvnor - Knowledge Repository

Having the JBoss running, visit the following address:
http://127.0.0.1:8080/drools-guvnor
In case you were asked to log in, enter:

login: admin
password: admin

In the left panel there are several entries:

Defining a new package

Compiling the package

Creating resources

Defining the facts' model

Defining the facts

Defining simple rules

Precisely, the reqsFormalOK rule is triggered by the following conditions:

  1. There is a fact State with state field set to value formal.
  2. There is no fact of type reqsFormal (or derived), that:
    1. would have Asked field equal false.
    2. Asked == true and at the same time Answer not equalt the ProceedAnswer.