Reading properties file variable in rule

Which IIQ version are you inquiring about?

IdentityIQ 8.4

Please share any images or screenshots, if relevant.


image

Share all details about your problem, including any error messages you may have received.

Would like to ask based on above screenshots is there a way for us to read .properties file variable in a rule source (Java) in SailPoint?

Meaning how to make the property ready appName from .properties file?

String appName = %%appName%%; - will this work?

Hi @shijingg,

in this case you can use the tokenization of ssb; in your target.properties file you have all the tokens like your second image and on the other file you can put the token, like this:

String appName = “%%appName%%”.

When you deploy this rule from ecplipse or vscode, the ssb put the value of token.
image

Into SSB guide you can find all the info

1 Like

Hi @enistri_devo understand the point about the target.properties, but would like to understand in the rule if I were to create
<entry key = "appName" value = "%%appName%%"/>

How do I call it in the Java source?

<Source>
String appName = appName; [is this how it is supposed to be called?]
</Source>

you need to put this in your file into project:
<entry key = "appName" value = "%%appName%%"/>

later when you deploy through SSB, SSB automatic change the token with the values of token.

if I understood you correctly, I do not need declare String appName variable?

<Source>
String appName = appName;
</Source>

Just <entry key = "appName" value = "%%appName%%"/> will be sufficient?

1 Like

depeds how you want to do. The tokenization replaces all string between %%, with the value of some string contains in your target.properties. You can use like that:

<entry key = "appName" value = "%%appName%%"/>
or
String appName = “%%appName%%”

in both cases SSB replace %%appName%% with ACB123APP, for example.

for %%appName%% = ACB123APP the result will be:
<entry key = "appName" value = "%ACB123APP"/>
or
String appName = “ACB123APP”

Also, you can configure multiple target.properties file for each enviroment and use different values for different enviroment for the same file.
For example dev.target.properties, pre.target.properties or prod.target.properties

1 Like

for the property in .properties file will it allow spaces as well? Example:

%%appName%% = ABC 123 APP

@shijingg
yes it will

yes, also you can you can use with or withou " ":

%%appName%% = ABC 123 APP
%%appName%% = "ABC 123 APP"

PS remember this is Java, if you want you special caracthers must regex:

\\ -> \
\n -> \
ecc...

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.