Lieutenant
Lieutenant
411 views

Java function call from <arg-node-set > ==> function called twice!

Jump to solution

Hello everyone!

I've detected very strange behavior and want to ask if somebody also detected it. (IDM 4.6). Maybe I'm doing something in a wrong way and you will return me on the right way. 🙂

I'm calling my very simple static java function from the driver policy. And when I use <arg-node-set > instead of <arg-string>, my function is called twice!

--------------

My function:

public static String callTestFunc(String driverDN) {
		Trace tracer = new Trace("dxqueue");
		tracer.trace("Starting Test Func with DriverDN: " + driverDN, 4);		
		tracer.trace("Test Func finished.", 4);
		return "success"; 
	}

When I make the following call from the driver policy:

<do-set-local-variable name="send-result" scope="policy">
	<arg-node-set>
		<token-xpath expression="dxqueue:callTestFunc('test driver')"/>
	</arg-node-set>
</do-set-local-variable>

 I see the following traces:

[08/15/2020 17:18:29.145] Driver ST: Action: do-set-local-variable("send-result",scope="policy",arg-node-set(token-xpath("dxqueue:callTestFunc('test driver')"))).
[08/15/2020 17:18:29.145] Driver ST: arg-node-set(token-xpath("dxqueue:callTestFunc('test driver')"))
[08/15/2020 17:18:29.145] Driver ST: token-xpath("dxqueue:callTestFunc('test driver')")
[08/15/2020 17:18:29.145] Driver ST: dxqueue: Starting Test Func with DriverDN: test driver
[08/15/2020 17:18:29.145] Driver ST: dxqueue: Test Func finished.
[08/15/2020 17:18:29.145] Driver ST: dxqueue: Starting Test Func with DriverDN: test driver
[08/15/2020 17:18:29.145] Driver ST: dxqueue: Test Func finished.
[08/15/2020 17:18:29.145] Driver ST: Token Value: "success".
[08/15/2020 17:18:29.145] Driver ST: Arg Value: {"success"}.

----------------------------------

And when I make the following call:

<do-set-local-variable name="send-result" scope="policy">
	<arg-string>
		<token-xpath expression="dxqueue:callTestFunc('test driver')"/>
	</arg-string>
</do-set-local-variable>

Traces show the following:

[08/15/2020 17:24:47.427] Driver ST: arg-string(token-xpath("dxqueue:callTestFunc('test driver')"))
[08/15/2020 17:24:47.427] Driver ST: token-xpath("dxqueue:callTestFunc('test driver')")
[08/15/2020 17:24:47.427] Driver ST: dxqueue: Starting Test Func with DriverDN: test driver
[08/15/2020 17:24:47.427] Driver ST: dxqueue: Test Func finished.
[08/15/2020 17:24:47.427] Driver ST: Token Value: "success".
[08/15/2020 17:24:47.427] Driver ST: Arg Value: "success".

1 Solution

Accepted Solutions
Knowledge Partner Knowledge Partner
Knowledge Partner
There was a bug in 4.6.0 where some token were processed twice, maybe that kicks in here as well. Patching to 4.6.1 or later solved the issue, iirc.
______________________________________________
https://www.is4it.de/identity-access-management

View solution in original post

2 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner
There was a bug in 4.6.0 where some token were processed twice, maybe that kicks in here as well. Patching to 4.6.1 or later solved the issue, iirc.
______________________________________________
https://www.is4it.de/identity-access-management

View solution in original post

Lieutenant
Lieutenant

Thanks!

Confirm, on 4.7 this bug can't be reproduced

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.