Hello,

I created a resource with an entitlement that has an admin defined list of values. When the resource is assigned I can choose multiple values. In the driver I am trying to read the values to send them to the remote app. When I assign the resource multiple times it is outputting the same value each time through the loop:


Code:
<rule>
	<description>Oracle Database Accounts</description>
	<conditions>
		<and>
			<if-class-name mode="case" op="equal">User</if-class-name>
			<if-entitlement name="Account" op="changing"/>
		</and>
	</conditions>
	<actions>
		<do-for-each>
			<arg-node-set>
				<token-added-entitlement name="Account"/>
			</arg-node-set>
			<arg-actions>
				<do-add-dest-attr-value name="dbaccounts">
					<arg-value type="string">
						<token-entitlement name="Account"/>
					</arg-value>
				</do-add-dest-attr-value>
			</arg-actions>
		</do-for-each>
	</actions>
</rule>

Here is a trace when adding two resources:

Code:
[01/23/17 09:11:49.388]:OracleDB Users ST:Applying policy: %+C%14CV-sub-ctp-Accounts%-C.
[01/23/17 09:11:49.388]:OracleDB Users ST:  Applying to add #1.
[01/23/17 09:11:49.388]:OracleDB Users ST:    Evaluating selection criteria for rule 'DB Account'.
[01/23/17 09:11:49.388]:OracleDB Users ST:      (if-class-name equal "User") = TRUE.
[01/23/17 09:11:49.388]:OracleDB Users ST:      (if-entitlement 'Account' changing) = TRUE.
[01/23/17 09:11:49.388]:OracleDB Users ST:    Rule selected.
[01/23/17 09:11:49.388]:OracleDB Users ST:    Applying rule 'DB Account'.
[01/23/17 09:11:49.388]:OracleDB Users ST:      Action: do-for-each(arg-node-set(token-added-entitlement("Account"))).
[01/23/17 09:11:49.388]:OracleDB Users ST:        arg-node-set(token-added-entitlement("Account"))
[01/23/17 09:11:49.388]:OracleDB Users ST:          token-added-entitlement("Account")
[01/23/17 09:11:49.389]:OracleDB Users ST:          Token Value: {<entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1",<entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1"}.
[01/23/17 09:11:49.395]:OracleDB Users ST:          Arg Value: {<entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1",<entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1"}.
[01/23/17 09:11:49.400]:OracleDB Users ST:        Performing actions for local-variable(current-node) = <entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1".
[01/23/17 09:11:49.400]:OracleDB Users ST:          Action: do-add-dest-attr-value("dbaccounts",token-entitlement("Account")).
[01/23/17 09:11:49.400]:OracleDB Users ST:            arg-string(token-entitlement("Account"))
[01/23/17 09:11:49.402]:OracleDB Users ST:              token-entitlement("Account")
[01/23/17 09:11:49.404]:OracleDB Users ST:                Token Value: "mdm".
[01/23/17 09:11:49.406]:OracleDB Users ST:              Arg Value: "mdm".
[01/23/17 09:11:49.408]:OracleDB Users ST:        Performing actions for local-variable(current-node) = <entitlement-impl> @id = "" @name = "Account" @qualified-src-dn = "O=data\OU=users\OU=Corporate\CN=xxxxxxx" @src = "UA" @src-dn = "\IDVDEV\data\users\Corporate\xxxxxxx" @src-entry-id = "46157" @state = "1".
[01/23/17 09:11:49.411]:OracleDB Users ST:          Action: do-add-dest-attr-value("dbaccounts",token-entitlement("Account")).
[01/23/17 09:11:49.411]:OracleDB Users ST:            arg-string(token-entitlement("Account"))
[01/23/17 09:11:49.411]:OracleDB Users ST:              token-entitlement("Account")
[01/23/17 09:11:49.411]:OracleDB Users ST:                Token Value: "mdm".
[01/23/17 09:11:49.411]:OracleDB Users ST:              Arg Value: "mdm".
[01/23/17 09:11:49.412]:OracleDB Users ST:Policy returned:
[01/23/17 09:11:49.413]:OracleDB Users ST:
<snip>
      <add-attr attr-name="dbaccounts">
        <value type="string">mdm</value>
      </add-attr>
      <add-attr attr-name="dbaccounts">
        <value type="string">mdm</value>
      </add-attr>
Any suggestions on how to get the individual values of changing entitlements?

Thanks,
Jeremiah