Rules not being run.

27 views
Skip to first unread message

Rawlins

unread,
Feb 13, 2013, 7:38:38 AM2/13/13
to valida...@googlegroups.com
Hello Guys,

I've got an object that I'm trying to validate, but I can't seem to get any of the rules to run, and the debug object is always an empty array.

<cfset LOCAL.VResult = getValidateThis().validate(theobject=ARGUMENTS.Delivery, context=ARGUMENTS.ValidationContext, debuggingMode='strict') />

<cfdump var="#LOCAL.VResult.getDebugging()#" />
<cfabort />

There are two rules defined within the file, and the xml appears to be being loaded by the framework as if there is a syntax eror in their it's throwing an exception about it.

<?xml version="1.0" encoding="UTF-8"?>
<validateThis xsi:noNamespaceSchemaLocation="validateThis.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<objectProperties>
<property name="Delivered" desc="State of the object.">
<rule type="date" contexts="*" />
</property>

<property name="State" desc="State of the object.">
<rule type="required" contexts="*" />
<rule type="custom" contexts="*" failureMessage="The stock for this order has been moved on since it was delievered so you can no longer undo this delivery.">
<param name="methodName" value="_validation_canUncomplete" />
</rule>
</property>
</objectProperties>

</validateThis>

Any help would be greatly appreciated.

Rob

John Whish

unread,
Feb 13, 2013, 8:47:35 AM2/13/13
to valida...@googlegroups.com
Is the object in the same directory as the rules?
> --
> You received this message because you are subscribed to the Google Groups
> "ValidateThis" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to validatethis...@googlegroups.com.
> To post to this group, send email to valida...@googlegroups.com.
> Visit this group at http://groups.google.com/group/validatethis?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Rawlins

unread,
Feb 13, 2013, 9:23:41 AM2/13/13
to valida...@googlegroups.com, john....@googlemail.com
Certainly is John,

It seems that the XML is being found by the framework as it throws an exception if it is invalid.

Rob

John Whish

unread,
Feb 13, 2013, 10:36:57 AM2/13/13
to valida...@googlegroups.com
Is it to do with the context - can't see anything wrong but worth trying?
Reply all
Reply to author
Forward
0 new messages