DIAC1 ;SLCISC/KCM,MKB - Policy Evaluation API's ;17FEB2017
Source file <DIAC1.m>
| Name | Comments | DBIA/ICR reference | 
|---|---|---|
| CANDO(DIFN,DIENS,DIACTN,DIUSR,DIVAL,DIFLDS,DITXT,DIERROR) | ;main API
 ; Can user take requested action on [given record in] this file? ; ; Returns 1 = Yes (permit) ; 0 = No (deny) ; "" = Undetermined/no applicable policy ; -1 = Error  | 
|
| C1 | ; find & evaluate policy
 | 
|
| CQ | ;return result
 | 
|
| FIND(FILE,ACTION) | ; -- find matching Event, return Policy^Event iens
 | 
|
| FQ | ||
| EN | ; -- process policy DIPOL, returns DIRESULT (P/D)
 ; Expects all input parameters from $$CANDO to be defined and valid ; If DIZTRACE = true, the execution trace will be captured  | 
|
| ENQ | ; exit
 | 
|
| POP | ; -- pop the stack [set]
 | 
|
| PROC | ; -- process member
 | 
|
| POLICY(DIEN) | ; -- loop on matching rules of policy DIEN
 | 
|
| MATCH(IEN) | ; -- return 1 or 0, if target matches
 | 
|
| MQ | ;done
 | 
|
| DISABLED(IEN) | ; -- return 1 or 0, if item is disabled
 | 
|
| FCN(IEN) | ; -- run attribute function to accummulate DIVAL(key)=value
 | 
|
| DONE(IEN) | ; -- return 1 or 0, if quit condition is met for policy IEN
 | 
|
| COND(IEN) | ; -- evaluate any rule IEN conditions [return boolean in Y]
 | 
|
| ADDMSG(IEN,RES) | ; -- add line to DIMSG array
 | 
|
| MSG() | ;
 | 
|
| OBLIG(IEN,RES) | ; -- execute obligation code
 | 
|
| FIELDS(IEN,FN) | ; -- return available fields in DIFLDS
 | 
|
| VIENS(IENS,FN) | ; -- validate IENS string for file# FN
 | 
|
| ERROR(CODE,PARAM,TYPE) | ; -- create error message
 | 
|
| TRACE(IEN,STK,ACT,COND) | ; -- set trace array
 ; DIZTRACE(#) = PolicyIEN ^ stack level ^ match? (1/0) ; or = PolicyIEN ^ stack level ^ done (2) ^ ResultFcnIEN ; DIZTRACE(#,c) = ConditionDA ^ stack level ^ result (1/0)  | 
|
| NXT() | ; -- increment trace array subscript
 |