How to manage conditions that control the advance to next process?

Confluence User - 10 Mar, 2018

Hi experts ¡

   I have an aproval procees with three activities, it use a workflow variable named status that must change in every activity, in the first activity i did define a field where the user must stablish a percent  , regarding this porcent i would like that in the second activity the user fill a field to pass to the last activitie.   

Someone could share an example of how can i apply this control on the form in order to enble the SAVE button only if the user fill a field with a value  equal to the percent stablished in the previus activity?

 

forms;process

2


12 Mar, 2018
confluenceUser
confluenceUser

Hi, there is a sample you can base on in Bean Shell Programming Guide#UseasFormValidator.

27 Mar, 2018
confluenceUser
confluenceUser

Hi Anders, please could you explain better how work this code? For example: Which part i must use to refer to field in the form that i need take to compare with my calculation field ? mport java.util.Arrays; import org.joget.apps.app.service.AppUtil; import org.joget.apps.form.model.Element; import org.joget.apps.form.model.Form; import org.joget.apps.form.model.FormData; import org.joget.apps.form.service.FormUtil; public boolean validate(Element element, FormData formData, String[] values) { boolean result = true; //get field 1 value from form data object String field1Id = "field1"; Form form = FormUtil.findRootForm(element); Element field1 = FormUtil.findElement(field1Id, form, formData); if (field1 != null) { //get value of field 1 String[] compareValues = FormUtil.getElementPropertyValues(field1, formData); //compare the value of field 2 and field 1 are equals if (!Arrays.equals(values, compareValues)) { String id = FormUtil.getElementParameterName(element); formData.addFormError(id, "Value not equal!!!!"); result = false; } } else { //ignore if the field 1 not exist } return result; } //call validate method with injected variable return validate(element, formData, values);

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print