I have a work order driver setup that manages the removal of "job Positions"
at future dates. When a Position is stamped with an end date, a work order
is created, and the "nwoContent" value is the value of an attribute that I
want deleted from the user at the appointed hour. However, we have found
over time that HR sometimes modifies the position AFTER they have stamped
the end date. The modify comes through and another work order is created.
The original work order errors out... it ultimately works but is VERY messy.
Too many work orders get created, too many associations to work orders get
created. Way too much processing going on.

So, my goal is to update existing work orders with the new values that need
to be removed. I haven't been getting desired results.

Initially, I thought it would be very easy as each modify was processed
(even when MULTIPLE modifies get generated because the user has MULTIPLE
positions, and multiple associations....
==================
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.5.10.20070918 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify cached-time="20100421152251.123Z" class-name="User"
event-id="DEV-IDV-01-DS#20100421152251#2#1#0"
qualified-src-dn="O=data\OU=usr\OU=edu\CN=BrehmCa"
src-dn="\DEV-ClientIDV\data\usr\edu\BrehmCa" src-entry-id="40512"
timestamp="1271863371#2">
<association
state="associated">\WorkOrder\PosDeleteBrehmCa0211 021142000 04/21/2010 10:02
(Pending)</association>
<modify-attr attr-name="ClientPosition">
<remove-value>
<value timestamp="1271860626#2" type="string">12|0211|42000
|021142000|DD|09/15/2009|05/06/2010</value>
</remove-value>
<add-value>
<value timestamp="1271863371#2" type="string">12|0211|42000
|021142000|EE|09/15/2009|05/06/2010</value>
</add-value>
</modify-attr>
</modify>
<modify cached-time="20100421152251.123Z" class-name="User"
event-id="DEV-IDV-01-DS#20100421152251#2#1#1"
qualified-src-dn="O=data\OU=usr\OU=edu\CN=BrehmCa"
src-dn="\DEV-ClientIDV\data\usr\edu\BrehmCa" src-entry-id="40512"
timestamp="1271863371#2">
<association
state="associated">\WorkOrder\PosDeleteBrehmCa0211 021142000 04/21/2010 10:37
(Pending)</association>
<modify-attr attr-name="ClientPosition">
<remove-value>
<value timestamp="1271860626#2" type="string">12|0211|42000
|021142000|DD|09/15/2009|05/06/2010</value>
</remove-value>
<add-value>
<value timestamp="1271863371#2" type="string">12|0211|42000
|021142000|EE|09/15/2009|05/06/2010</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>

For Each modify, see if the removed attribute is equal to the value of
"nwoContent" on the object referenced by the current association work order.
That seems most foolproof...But I could use some ideas on the correct method
of achieving this...

My second approach says, OK... stop trying to figure out the associated
object. Let's just query the entire batch of work orders to see if ANY of
them have an nwoContent value that matches the "removedAttribute"
Here's the code... but my "node" that I expect to see (i.e. the DN of the
object that matches) is not returned/displayed, even though the query is
successful, and I have verified that an object exists with this value. What
have I done wrong here?
===========================
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.5.10.20070918 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<modify cached-time="20100421152251.123Z" class-name="User"
event-id="DEV-IDV-01-DS#20100421152251#2#1#0"
qualified-src-dn="O=data\OU=usr\OU=edu\CN=BrehmCa"
src-dn="\DEV-ClientIDV\data\usr\edu\BrehmCa" src-entry-id="40512"
timestamp="1271863371#2">
<association
state="associated">\WorkOrder\PosDeleteBrehmCa0211 021142000 04/21/2010 10:02
(Pending)</association>
<modify-attr attr-name="ClientPosition">
<remove-value>
<value timestamp="1271860626#2" type="string">12|0211|42000
|021142000|DD|09/15/2009|05/06/2010</value>
</remove-value>
<add-value>
<value timestamp="1271863371#2" type="string">12|0211|42000
|021142000|EE|09/15/2009|05/06/2010</value>
</add-value>
</modify-attr>
</modify>
<modify cached-time="20100421152251.123Z" class-name="User"
event-id="DEV-IDV-01-DS#20100421152251#2#1#1"
qualified-src-dn="O=data\OU=usr\OU=edu\CN=BrehmCa"
src-dn="\DEV-ClientIDV\data\usr\edu\BrehmCa" src-entry-id="40512"
timestamp="1271863371#2">
<association
state="associated">\WorkOrder\PosDeleteBrehmCa0211 021142000 04/21/2010 10:37
(Pending)</association>
<modify-attr attr-name="ClientPosition">
<remove-value>
<value timestamp="1271860626#2" type="string">12|0211|42000
|021142000|DD|09/15/2009|05/06/2010</value>
</remove-value>
<add-value>
<value timestamp="1271863371#2" type="string">12|0211|42000
|021142000|EE|09/15/2009|05/06/2010</value>
</add-value>
</modify-attr>
</modify>
</input>
</nds>
[04/21/10 11:22:51.212]:*** ST:Applying policy: %+C%14CWork Order
Processing%-C.
[04/21/10 11:22:51.213]:*** ST: Applying to modify #1.
[04/21/10 11:22:51.213]:*** ST: Evaluating selection criteria for rule
'Modify Positions on Existing Workorder'.
[04/21/10 11:22:51.214]:*** ST: (if-class-name equal "User") = TRUE.
[04/21/10 11:22:51.215]:*** ST: (if-operation equal "modify") = TRUE.
[04/21/10 11:22:51.216]:*** ST: (if-op-attr 'ClientPosition' available)
= TRUE.
[04/21/10 11:22:51.216]:*** ST: Rule selected.
[04/21/10 11:22:51.217]:*** ST: Applying rule 'Modify Positions on
Existing Workorder'.
[04/21/10 11:22:51.218]:*** ST: Action:
do-for-each(arg-node-set(token-removed-attr("ClientPosition"))).
[04/21/10 11:22:51.218]:*** ST:
arg-node-set(token-removed-attr("ClientPosition"))
[04/21/10 11:22:51.219]:*** ST:
token-removed-attr("ClientPosition")
[04/21/10 11:22:51.220]:*** ST: Token Value: {<value> @timestamp =
"1271860626#2" @type = "string"}.
[04/21/10 11:22:51.221]:*** ST: Arg Value: {<value> @timestamp =
"1271860626#2" @type = "string"}.
[04/21/10 11:22:51.221]:*** ST: Performing actions for
local-variable(current-node) = <value> @timestamp = "1271860626#2" @type =
"string".
[04/21/10 11:22:51.222]:*** ST: Action:
do-set-local-variable("extantWO",scope="policy",arg-node-set(token-query(class-name="DirXML-nwoWorkOrder",datastore="src",scope="subordinates" ,arg-dn("\"+token-global-variable("treeName")+"\system\idm\WorkOrders"),arg-match-attr("DirXML-nwoContent",token-local-variable("current-node"))))).
[04/21/10 11:22:51.224]:*** ST:
arg-node-set(token-query(class-name="DirXML-nwoWorkOrder",datastore="src",scope="subordinates" ,arg-dn("\"+token-global-variable("treeName")+"\system\idm\WorkOrders"),arg-match-attr("DirXML-nwoContent",token-local-variable("current-node"))))
[04/21/10 11:22:51.225]:*** ST:
token-query(class-name="DirXML-nwoWorkOrder",datastore="src",scope="subordinates" ,arg-dn("\"+token-global-variable("treeName")+"\system\idm\WorkOrders"),arg-match-attr("DirXML-nwoContent",token-local-variable("current-node")))
[04/21/10 11:22:51.228]:*** ST:
arg-dn("\"+token-global-variable("treeName")+"\system\idm\WorkOrders")
[04/21/10 11:22:51.229]:*** ST: token-text("\")
[04/21/10 11:22:51.229]:*** ST:
token-global-variable("treeName")
[04/21/10 11:22:51.230]:*** ST: Token Value:
"DEV-ClientIDV".
[04/21/10 11:22:51.231]:*** ST:
token-text("\system\idm\WorkOrders")
[04/21/10 11:22:51.232]:*** ST: Arg Value:
"\DEV-ClientIDV\system\idm\WorkOrders".
[04/21/10 11:22:51.233]:*** ST:
arg-match-attr("DirXML-nwoContent",token-local-variable("current-node"))
[04/21/10 11:22:51.234]:*** ST:
arg-string(token-local-variable("current-node"))
[04/21/10 11:22:51.235]:*** ST:
token-local-variable("current-node")
[04/21/10 11:22:51.236]:*** ST: Token Value:
"12|0211|42000 |021142000|DD|09/15/2009|05/06/2010".
[04/21/10 11:22:51.237]:*** ST: Arg Value: "12|0211|42000
|021142000|DD|09/15/2009|05/06/2010".
[04/21/10 11:22:51.238]:*** ST: Query from policy
[04/21/10 11:22:51.239]:*** ST:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.5.10.20070918 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<input>
<query class-name="DirXML-nwoWorkOrder"
dest-dn="\DEV-ClientIDV\system\idm\WorkOrders" scope="subordinates">
<search-class class-name="DirXML-nwoWorkOrder"/>
<search-attr attr-name="DirXML-nwoContent">
<value type="string">12|0211|42000
|021142000|DD|09/15/2009|05/06/2010</value>
</search-attr>
<read-attr/>
</query>
</input>
</nds>
[04/21/10 11:22:51.245]:*** ST: Pumping XDS to eDirectory.
[04/21/10 11:22:51.246]:*** ST: Performing operation query
for \DEV-ClientIDV\system\idm\WorkOrders.
[04/21/10 11:22:51.248]:*** ST: Query from policy result
[04/21/10 11:22:51.249]:*** ST:
<nds dtdversion="3.5" ndsversion="8.x">
<source>
<product version="3.5.10.20070918 ">DirXML</product>
<contact>Novell, Inc.</contact>
</source>
<output>
<status level="success"></status>
</output>
</nds>
[04/21/10 11:22:51.250]:*** ST: Token Value: {}.
[04/21/10 11:22:51.251]:*** ST: Arg Value: {}.

Thanks in advance for any ideas!!



__________ Information from ESET Smart Security, version of virus signature database 5047 (20100421) __________

The message was checked by ESET Smart Security.

http://www.eset.com