cancel
Showing results for 
Search instead for 
Did you mean: 

Constraints doesn't work in workflows

riogrande
Champ in-the-making
Champ in-the-making
Hi all,

I'm making an advanced workflow in which there is a simple task with one field to fill. I put a constraint on it. At the beginning I was thinking that I did something wrong, because I was able to put whatever I wanted. But I find out that if I press the "Save Change" button I have the wanted message (warning about the incorrect input).

So is there a way to have the constraint check before the workflow goes to the next step ?

(Windows XP SP3, alfresco 3.0.0 (Stable 1526), tomcat, mysql)
4 REPLIES 4

riogrande
Champ in-the-making
Champ in-the-making
Curiously works now :roll:
but not completly, just if I put nothing it give me an error.

_sax
Champ in-the-making
Champ in-the-making
In your workflow model, make sure, that the constraint gets applied to the field:
<property name="xy:TextField">                 <type>d:text</type>                                                        
                                                                <constraints> <constraint ref="xy:Constraint_For_TextField" />    </constraints>
</property>

riogrande
Champ in-the-making
Champ in-the-making
yes it is set :


      <type name="afwf:checkCodeOut">
         <parent>afwf:changableStatus</parent>
         <mandatory-aspects>
            <aspect>afwf:borrowCheckOut</aspect>
         </mandatory-aspects>                     
      </type>



   <aspects>
      <aspect name="afwf:borrowCheckOut">  
         <title>Check Item Code Out</title>
         <properties>
            <property name="afwf:checkItemCodeOut">
               <type>d:text</type>
               <mandatory>true</mandatory>
               <constraints>
                  <constraint ref="af:numericCode" />
                  <constraint ref="af:itemCodeLenght" />
               </constraints>
            </property>            
         </properties>
      </aspect>   
   </aspects>

and the two constraints that works perfectly when adding files Smiley Wink (are in an other model, and Yes I imported the "af" model to my workflow model)


      <constraint name="af:numericCode" type="REGEX">
         <parameter name="expression"><value>[0-9]*</value></parameter>
         <parameter name="requiresMatch"><value>true</value></parameter>
      </constraint>
      
      <constraint name="af:itemCodeLenght" type="LENGTH">
         <parameter name="minLength"><value>7</value></parameter>
         <parameter name="maxLength"><value>7</value></parameter>
      </constraint>   

So as I said, the mandatory aspect works in any cases. But the constrain Length works only if in press "Save change" and ht Regex doesn't work at all.

_sax
Champ in-the-making
Champ in-the-making
I've never tried to use the types of LENGTH or REGEX. Maybe you could try to use the type "text" in an additional constraint or by changing an existing type - through it you could find, if it's a problem with your configuration (problem persists) or with the special types of constraints you're using.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.