OPALE - Utilisation - Ordre de priorités des règles sur le moteur de règles MAPPING IBM-i/en

Différence entre versions

De MappingDoc
Ligne 40 : Ligne 40 :
 
  INV*      *CPT      INVOICES  *ALL      *ALL      ACTION2<br>
 
  INV*      *CPT      INVOICES  *ALL      *ALL      ACTION2<br>
 
  INVO*      *CPT      *ALL      *ALL      *ALL      ACTION3<br>
 
  INVO*      *CPT      *ALL      *ALL      *ALL      ACTION3<br>
  INVEXP   *ALL      INVOICES  *ALL      *ALL      ACTION4<br>
+
  INVOIEXP   *ALL      INVOICES  *ALL      *ALL      ACTION4<br>
  
  

Version du 9 juin 2020 à 19:38

Autres langues :
English • ‎français

Introduction

When we release a spooled file into an OUTQ monitored by MAPPING, the program search in the association between spooled files and actions settings which action must be executed.

This documentation describes the priority order of the execution of those rules.

Details

  1. The engine search first in the rules associated the full name of the spooled file.
    MATCH --> We look for the other parameters (user, job, reference, formtype, etc) the values different from *ALL and compare their values. Those which will have the more matching criterias with values different from *ALL will be executed. (Priority to the most selective rule). In the event where multiple rules have those same criterias, the first in the list will be taken and executed.
    NO MATCH --> Go to point 2
  1. The engine search in the rules associated another match with the other parameters (Please note that the partiel name has the same effect as the other parameters. Example : INV* for INVOICE. Indeed there is no priority on the partiel spooled file name) .
    MATCH --> We look for the other parameters (user, job, reference, formtype, etc) the values different from *ALL and compare their values. Those which will have the more matching criterias with values different from *ALL will be executed. (Priority to the most selective rule). In the event where multiple rules have those same criterias, the first in the list will be taken and executed.
    NO MATCH --> The default rule the rule with all criterias set to *ALL (if existing) will then be executed. (If not existing, a non visible error message in the MAPPING robot log will be risen and no action will be executed)

When a rule is found, the action defined for this rule will be executed.

Remarks

The generic names

We can also use generic names. We just need to indicate INV* in the spooled file name parameter. This criteria can match all the spooled file starting with INV (Example : INVOICE, INVENTORY, etc) The generic names can also be used for the other criterias (except for the width of the spooled file)

The groups

We can define a rule using a group. To create a group, put the cursor in the parameter to be defined, press F4. Select option 1 to select a group. You can also press F6 to create a new group. The option 5 on a group is used to defined the values of the group. For instance : Create a group ACCOUNT (for ACCOUNTING) then indicate the different users of the group. In the settings of the rules, you simply need to specify *ACCOUNT to refer to the ACCOUNT group. This will allow you not to have to create a rule per person of the accounting department.

Best rule selection

The program goes through all the different rules. If one does not match the incoming spooled file, the rule is ignore. But what is happening when multiple rules match with the same priority? Answer : The first rule with the more parameter different from *ALL will be used.

Examples

Example 1

F. Spool   User.    Job.    Reference  Print    Action
INV* *ALL *ALL *ALL *ALL ACTION1
INV* *CPT INVOICES *ALL *ALL ACTION2
INVO* *CPT *ALL *ALL *ALL ACTION3
INVOIEXP *ALL INVOICES *ALL *ALL ACTION4


Case 1

Spooled file released : INVOICE, utilisateur QPGMR, travail INVOICES.

Executed action : ACTION1

Explanation

The program will look for a rule with spooled file name equals to INVOICE. The is not such rule. It then search on the other rules.
Line 1 matches one criteria (Spooled file name)
Line 2 does not match (QPGMR is not part if the CPT group)
Neither line 3
Neither line 4 (wrong spooled file name)

Case 2

Spooled file released : INVOICE, utilisateur DUMOULIN, travail INVOICES.

Executed action : ACTION2

Explanation

The program will look for a rule with spooled file name equals to INVOICE. The is not such rule. It then search on the other rules.
Line 1 matches 1 criteria (Spooled file name)
Line 2 matches 3 criterias (Spooled file name, user (Dumoulin belong to the group), job
Line 3 matches 2 criterias (Spooled file name, user
Line 4 does not match a rule (wrong spooled file name)


Case 3

Spooled file released : INVOIEXP, utilisateur DUMOULIN, travail INVOICES.

Executed action : ACTION4

Explanation

The program found a rule for INVOIEXP. This one is taken. The lines INV* and INVO* are not executed.

Remarque : Notez que même si FACT* est plus précis que FAC*, la ligne sera analysée après les lignes FAC* et ne sera donc exécutée que si plus de critères (autres que *ALL) sont indiqués que pour FAC*.


Exemple 2

F. Spool   Utilis.    Travail    Référence  Imprimé    Action
FACTURE    *ALL       *ALL       *ALL       *STD       ACTION1
FACTURE    *ALL       FACTURES   *ALL       *ALL       ACTION2
FACTURE    *CPT       *ALL       *ALL       *ALL       ACTION3
FACTEXP    *ALL       FACTURES   *ALL       *ALL       ACTION4


Fichier spool libéré : FACTURE, utilisateur *CPT, travail FACTURES, imprimé*STD.

L’action exécutée sera ACTION1

Explication

Nous avons 3 lignes qui correspondent, et toutes les 3 ont le même nombre de critères valides (2 critères)
De ce fait la première dans la liste sera exécutée, soit ACTION1