0

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.

i.e., 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.

  • You should always provide relevant error details in the body of the question. Generally: what do you want to do, what did you try, and what results did you get. –  Oct 12 '17 at 17:08
  • @jdv I only get the warning at the time of executing it does not work, besides that it does not find in the documentation of the editor how to carry out the procedure and what I want to do is to learn to capture information of the text boxes and also to be able to load information in the text boxes – esteban fabian patiño Oct 12 '17 at 17:13
  • An error or warning is useful information that you should share _in the body of the question_. –  Oct 12 '17 at 17:16
  • `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 – esteban fabian patiño Oct 12 '17 at 17:20
  • I have put those details in the body of the question for you. –  Oct 12 '17 at 17:23
  • @jdv I forgot, thank you for editing the question – esteban fabian patiño Oct 12 '17 at 17:27

2 Answers2

0

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.

Antoine Mottier
  • 1,185
  • 1
  • 8
  • 13
0

Use .getResponseText() instead.

karel
  • 5,489
  • 46
  • 45
  • 50
  • 3
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 29 '21 at 00:10