cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
craftereric
Level 2

accessing IA and Java variables

I have a couple of questions about accessing and using variables. During a pre-install, I am executing the attached FindHostName.java plugin. This code sets the Java properties localhost.IP and localhost.name. By including an Output Debug Information action, I can see that indeed both of these values get set because they show up in the log file.

Immediately after executing the plugin, I am using a Get User Input - Advanced action. In the textbox, I am trying to use as a default value, localhost.name using $localhost.name$. This does not work. (see ia1.jpg and ia2.jpg attachments)

My question is what I am doing wrong?

In a second textbox, I was able to populate the field if I used $lax.nl.env.exact_case.HOSTNAME$ (see ia1.jpg attachment)

I would like to understand why localhost.name does not work but I need to be able to run custom code and pass the variables back to a IA user input screen.

Last question:
In the FindHostName.java code I attempted to set the IA variable CC_HOSTNAME using ip.setVariable. CC_HOSTNAME does not show up at all when the debug information action is executed.

What do I need to do in order to set CC_HOSTNAME properly?
Labels (1)
0 Kudos
(1) Reply
xzhang
Level 3

1. to get a java property value by an IA variable, you may want to use "$prop.$", i.e. "$prop.localhost.IP$" in your case.

2. as for your second question, you may try "$CC_HOSTNAME$" instead,
i.e. ip.setVariable("$CC_HOSTNAME$",InetAddress.getLocalHost().getHostName() );

Regards,
0 Kudos