Skip to Content
avatar image
Former Member

BO 4.1 java sdk not able to pick "SI_ALIASES"

Hi,

I am trying to get the list of BO users and their alias status in our 4.1 system. The below line is what i am using to get the 'alias name' and 'alias status'.

1)aliasName=iInfoObject.properties().getProperties("SI_ALIASES").getProperties(1).getProperty("SI_NAME").toString();

2)aliasStatus=usercount2.properties().getProperties("SI_ALIASES").getProperties(1).getProperty("SI_DISABLED").toString().toUpperCase();

I am able to fetch the aliasName but the getting an empty string for the aliasStatus.

Note: The same code is fetching the aliasStatus correctly when run with BO 3.1 libraries. Only BO 4.1 libraries does not seems to fetch the aliasStatus with the above line.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 11, 2017 at 03:17 PM

    getProperty() returns an IProperty object, and the SI_DISABLED property is a boolean. I'm not sure why, but IProperty.toString() (and IProperty.getValue().toString()) does not property render boolean values (it shows an empty string for false and a "1" for true). You can instead use:

    .properties().getProperties("SI_ALIASES").getProperties(1).getBoolean("SI_DISABLED")

    Or better, cast to IUser and use the native methods:

    Iterator<IUserAlias> iAlias = iUser.getAliases().iterator();
    while(iAlias.hasNext())
    {
       IUserAlias alias = iAlias.next();
       System.out.println(alias.getName());
       System.out.println(alias.isDisabled());
    }
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 13, 2017 at 10:22 AM

    Hi Joe,

    Many thanks for the help,

    Boolean AliasStatus=usercount2.properties().getProperties("SI_ALIASES").getProperties(1).getBoolean("SI_DISABLED");

    aliasStatus = AliasStatus.toString().toUpperCase();

    The above way has worked for fetching the 'alias status'. But is there any direct API to fetch the Alias status for the User as a whole instead of the individual aliases assigned for the User ?

    In the attachment the highlighted field is what i am trying to fetch instead of the individual status of the alias assigned for the User.

    Thanks,

    Ramcapture.jpg

    Add comment
    10|10000 characters needed characters exceeded