Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BizRule Messages and...
Message
De
02/05/2001 19:26:11
Gerald McKinsey
Keystone Consulting Services, Inc.
Yorktown, Indiana, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00502660
Message ID:
00502821
Vues:
13
Hi Robert,

>Q1. Is there a way to display all messages returned by the BizRule? For example, if a BizRule detects three errors I want to display all errors to the user instead of just the first one.

I wanted to do something like this also and here is the approach I took:

In the DisplayBrokenRules method of my base from I have the following code:
LPARAMETERS tobizobj

LOCAL lnRuleCount, lcRuleText, lcRuleString

*If no business object is specified, default 
*to the primary business object
IF VARTYPE(toBizObj) != 'O'
 IF VARTYPE(ThisForm.oBizObj) == 'O'
  toBizObj = ThisForm.oBizObj
 ELSE
  RETURN
 ENDIF
ENDIF

*If there are business rules attached to this business object check
*the rules and report any problems
IF TYPE('toBizObj.oBizRules') = 'O'
	
 *Check the business rules
 toBizObj.oBizRules.CheckRules()

 *If there are any violations, build a string and display it in a box
 IF toBizObj.oBizRules.GetCount() > 0
  FOR lnRuleCount = 1 To toBizObj.oBizRules.GetCount()
	
   lcRuleText = toBizObj.oBizRules.GetBrokenRule[lnRuleCount]
		
   IF lnRuleCount = 1
    lcRuleString = lcRuleText
   ELSE
    lcRuleString = lcRuleString + CHR(13) + lcRuleText
   ENDIF
		
  ENDFOR
	
  =MESSAGEBOX('The following problem(s) have been encountered:' + CHR (13) +
  CHR(13) + lcRuleString, 0+48 , 'Visual Payroll Business Rule Violation')
		
  RETURN 
 ELSE
  *No violations, proceed as normal
  RETURN 
 ENDIF
ELSE
 *No business rules, proceed as normal
 RETURN 
ENDIF
HTH,

Brian
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform