Reputation: 103
I've created a workflow utilizing the script task (exam_result as integer, exam_grade as integer, remarks as string) job. In the user task, i created a form reference (with textfield) that will handle the data entry of exam result. The exam result text field should be passed to the exam_result variable which will be evaluated thru decision table task.
What is the best practice to send data from form field control to script task variable or vice versa?
Your help is highly appreciated, thank you.
Upvotes: 1
Views: 1446
Reputation: 1486
Store these values into execution variable and you should be able to access them across all the tasks.
You can use task listeners to read the form values and store them into execution variables like below.
execution.setVariable('exam_result',task.getVariable('exam_result'));
execution.setVariable('exam_grade',task.getVariable('exam_grade'));
execution.setVariable('remarks',task.getVariable('remarks'));
If you want to access them in another task listeners,
var examResult = execution.getVariable('exam_result');
var examgrade = execution.getVariable('exam_grade');
var remarks= execution.getVariable('remarks');
This is on the delegates side, you can access them like below.
int examResult = (int) executionVariables.get("exam_result");
int examGrade = (int) executionVariables.get("exam_grade");
string remarks = (string) executionVariables.get("remarks");
Hope this helps you.
Please let me know if it not clear to you.
Upvotes: 4