AnsweredAssumed Answered

Field validation during in a Workflow form

Question asked by dranakan on Nov 23, 2011
Latest reply on Feb 28, 2013 by dranakan

I would like to the check value of a field in a Workflow form. The verification of a field when it is property of a document is working :

I get problem to check the field in my workflow… I think that the error comes from my share-config-custom.xml. When the page is displayed, in source code mode in the browser, the link to the js function is not done with the field. I can't see something like this (with field-validation-alfresco-share-form sample) :

fieldId : "template_x002e_edit-metadata_x002e_edit-metadata_x0023_default_prop_ex_gross",
               handler : Alfresco.forms.validation.exampleGrossValidation, …

I try to give access to a function Alfresco.forms.validation.exampleGrossValidation.
My share-config-custom.xml

<config evaluator="string-compare" condition="activiti$Simple">
               <show id="bpm:workflowDescription" />
               <show id="bpm:workflowDueDate" />
               <show id="bpm:workflowPriority" />
               <show id="sgfwf:centre1" />
               <show id="bpm:assignee" />
               <show id="packageItems" />
               <!–  <show id="bpm:sendEMailNotifications" /> –>
               <set id="" appearance="title" label-id="workflow.set.general" />
               <set id="info" appearance="" template="/org/alfresco/components/form/2-column-set.ftl" />
               <set id="assignee" appearance="title" label-id="workflow.set.assignee" />
               <set id="items" appearance="title" label-id="workflow.set.items" />
               <set id="other" appearance="title" template="/org/alfresco/components/form/table-5-column-set.ftl" label-id="workflow.set.other" />
               <field id="bpm:workflowDescription" label-id="workflow.field.message">
                  <control template="/org/alfresco/components/form/controls/textarea.ftl">
                     <control-param name="style">width: 95%</control-param>
               <field id="sgfwf:centre1" set="other" help-id="" >
                                       <constraint type="MANDATORY" validation-handler="Alfresco.forms.validation.exampleGrossValidation" event="keyup" />

Has someone done a field validation during a workflow ?
To validate my field, I need to access an external database… I think it's easier to access in Java code. Can I access my classes from the JS or can I access my classes directly from the form ?


(Alfresco 4.0b).