简体   繁体   中英

How is a getText done in groovy?

good morning the reason for my question is how to perform a getText in groovy, since I'm used to Bonitasoft(7.3) and manages that editor what I want to do is something very simple to capture data from a text box to to pass it to another box text but at the time of doing the getText it does not work for me I am new managing the editor and I do not have many experience in editor annex the code

 import java.lang.exception.*; import java.lang.StackTraceElement; try{ String aux =""; aux = nombre1.getText(); }catch(Exception e ) { StackTraceElement[] stackTraceElement =e.getStackTraceElement(0); int n = stackTraceElement.length; aux = aux+ " -----"; for (int i = 0 ;i<n;i++ ) { aux = aux+ " "+stackTraceElement[i].getLineNumber()+">>"+stackTraceElement[i].getMethodName(); } } return aux;

the name of the box is fine and I have rectified it, but not if I am doing it properly in the code I get a warning regarding the name of the text box, but I do not know if I am called well to the text box.

ie, I get:

Name1 can not be resolved. It can lead to run-time error

But, if in the code put $ name1 the warning is removed but the code does not work I think I'm calling the text box wrong, but I do not know how to call it. I've looked at groovy documentation but I can not figure out how to perform the procedure.

In Bonita, forms are created using the UI Designer. A tool that rely on HTML5, JavaScript, AngularJS and Bootstrap. Groovy is only used on server side. So you should not have to use it for your use case.

Basically in a form you will associate your widgets with a JavaScript object and also associate the JavaScript object with the button used to submit the form. When the button is clicked it will send the data to Bonita. Data structure need to match a contract defined at process or task level. You can then use the contract data to initialize or update a business variable.

In a form you can display business variables values by getting them using Bonita Engine REST APIs.

To learn about Bonita I recommend to watch Bonita Camp video. It cover all the basic features.

改用 .getResponseText() 。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM