Topic
  • 2 replies
  • Latest Post - ‏2013-05-02T10:36:37Z by LeonilsonLopes
LeonilsonLopes
LeonilsonLopes
93 Posts

Pinned topic How to use attribute type "list" in ITIM Workflows

‏2013-04-30T22:56:21Z |

Hi,

I was unable to find documentation for this.

In ITIM workflow properties, there is the variable type "list". I'd like to know what are those methods and how to use.

I have to store a list of accounts. Usually, I just keep the DN string, and them I can get the account (using new Account()) using this DN, but i would be so good to keep the account object stored in relevant data.

 

Regards

Leonilson Lopes

 

  • franzw
    franzw
    339 Posts

    Re: How to use attribute type "list" in ITIM Workflows

    ‏2013-05-01T06:19:05Z  

    When defining a list relevant data property you will be asked what object type the list should hold (e.g. account, string etc.). So if you need to store account objects you can define a list of accounts - but you need to make sure when you store the data that you supply a JavaScript array of account objects - which may give you some problems (definitely not impossible).

    In many cases it is better to use a list of strings and then store the object dn instead (as a string) - there are several reasons for this :

    1.You should always do a e.g. new Account(dn) to ensure that your copy of the entity is the latest version (as another worflow may have changed the data in the ldap)

    2.Your  scripting will be much simpler working with strings instead of (Java) objects.

    You need to understand that the wrapper is a little special - if you read a list (using <list>.get()) you will get a JavaArray object - but you will have supply a JavaScript Array when writing the list (using <list>.set()).

    HTH

    Regards

    Franz Wolfhagen

     

  • LeonilsonLopes
    LeonilsonLopes
    93 Posts

    Re: How to use attribute type "list" in ITIM Workflows

    ‏2013-05-02T10:36:37Z  
    • franzw
    • ‏2013-05-01T06:19:05Z

    When defining a list relevant data property you will be asked what object type the list should hold (e.g. account, string etc.). So if you need to store account objects you can define a list of accounts - but you need to make sure when you store the data that you supply a JavaScript array of account objects - which may give you some problems (definitely not impossible).

    In many cases it is better to use a list of strings and then store the object dn instead (as a string) - there are several reasons for this :

    1.You should always do a e.g. new Account(dn) to ensure that your copy of the entity is the latest version (as another worflow may have changed the data in the ldap)

    2.Your  scripting will be much simpler working with strings instead of (Java) objects.

    You need to understand that the wrapper is a little special - if you read a list (using <list>.get()) you will get a JavaArray object - but you will have supply a JavaScript Array when writing the list (using <list>.set()).

    HTH

    Regards

    Franz Wolfhagen

     

    Hi Franz,

    Thank you so much for your answer. But I still have some doubts about how to script it, could you please provide some example?

     

    Regards,

    Leonilson Lopes