cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PeterFloyd
Level 3

HELP: Trying to read a value from an INI file.

Hello everyone,

I have downloaded and installed properly the Wizard Beans and one of them is Read INI Value. I have added it to my sequences.

The problem I am having is how to access the data that is being read.

I saw somewhere that I should be able to use (within my installation) the following: $W(BeanID.value) but the value is bringing back Null. It is my understanding that "value" is actually a hidden property but it seems that I can't read the value.

I am 99% sure that the INI file is being read but I could be wrong.

I would also like to access these values in a custom event (java code) so I can read or manipulate the data. I have not yey figured out what java code I need to use in order to read a Wizard Bean Property.

Your help is greatly appreciated.

Peter Floyd
Labels (1)
0 Kudos
(5) Replies
RobertDickau
Flexera Alumni

In the $W expression, have you replaced "BeanID" with the (case sensitive) actual bean ID?
0 Kudos
PeterFloyd
Level 3

Hey Robert,

RobertDickau wrote:
In the $W expression, have you replaced "BeanID" with the (case sensitive) actual bean ID?


Yes I have. I have changed the bean from bean8 to beanSeqVersion.
The Read INI bean, I am setting the following:

Bean ID = beanSeqVersion
File Name = $J(is.external.home)\support\ODPI_System.ini
Subject = OPTIONS
Variable = SEQ_VERSION

The ODPI_System.ini file has the following:
[OPTIONS]
SEQ_VERSION=1.0
WRAPPER_VER=1.0
LOG_DIR=$J(is.external.home)\logs
LOG_FILENAME=ODPI_Wrapper.log
ABORTONCAFAIL=1

Immediately after, I am Setting a Variable. It has the following:
Bean ID = beanSeqVersion
Name = varSeqVersion
Value = $W(beanSeqVersion.value)

If I want to access the $W(beanSeqVersion.value) in a custom event (Custom Java Code), how would I access that?

Peter
0 Kudos
RobertDickau
Flexera Alumni

You should be able to call resolveString in custom code to expand the value of a $X expression. Searching these forums and the online help for "resolveString" should give examples.
0 Kudos
PeterFloyd
Level 3

RobertDickau wrote:
You should be able to call resolveString in custom code to expand the value of a $X expression. Searching these forums and the online help for "resolveString" should give examples.


Thanks for the info.

Am I doing everything correct to use the Read INI Value?
0 Kudos
RobertDickau
Flexera Alumni

I've never used that (custom?) wizard action, but it appears you're setting the properties correctly; as a test, does it work if you put the INI file somewhere else (such as hard-coded location)?
0 Kudos