Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Can i read context.Variable by its value, lets say
I have 3 context variables in a job
Variable Name-----------------Datatype------------Value
context.Student---------------String----------------Name,Email
context.Name-----------------String----------------Meet
context.Email-------------------String-----------------m@gmail.com
There is only one component in my job 'tJava', and in that i have written following code:
----------------------------------CODE--------------------------------------------------------------------
String student = context.Student;
String[] students = student.split(",");
for ( int i = 0 ; i<students.length;i++)
{
System.out.println(students[i].trim()); //prints Name and Email
System.out.println(context[students[i]]); //want to print the Value of "context.Name" and "context.Email"
}
-----------------------------------tJava throws Error-----------------------------------------
Please help and let me know if more information needed on this.
Regards
Meet
Achieved my requirements
Instead of writing
System.out.println(context[students[i]].trim());
Got a solution using this :
System.out.println( context.getProperty(students[i]).trims() );
Regards
Meet
Reading Global variable using its value
Suppose Student contains 'Name'
in my code i'm getting Name as a output and then i want to get value of "Name" context in my code
Regards
Meet
Achieved my requirements
Instead of writing
System.out.println(context[students[i]].trim());
Got a solution using this :
System.out.println( context.getProperty(students[i]).trims() );
Regards
Meet