Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ITDI Modify Parameters

19 views
Skip to first unread message

Jonathan Green

unread,
Dec 15, 2009, 10:14:21 AM12/15/09
to
Hi There,

I am trying to create a custom ITDI adapter and having an issue where
on my modify statements it is passing the old account attributes to
the ITDI Assembly line. The custom adapter is built to override the
update function as it calls a stored procedure to update a database
with the attributes passed.

Why is it that even when attributes are changed the old ones are
passed? Does it have to do with the service.def and insisting that
all attributes must be passed regardless of change?

Thanks,
Jon

flamesnm

unread,
Dec 16, 2009, 6:19:54 AM12/16/09
to
The value being passed in is an attribute and contains and operation
code and value for both the old and new values. If you're accessing it
as a string, it will only give the old value.
Something like the following will show you what's happening :

function getCorrectOpValue(att)
{
task.logmsg("INFO","= Att size: " + att.size());
for (i = 0; i < att.size(); i++) {
task.logmsg("INFO","= " + att.getValue(i));
task.logmsg("INFO","= " + att.getValueOperation(i));
}
}

Eddie Hartman

unread,
Dec 17, 2009, 5:28:13 AM12/17/09
to
Niall is right in that you get both Att values: one tagged as "add"
and the other as "delete". Note that Update mode automatically
removes "delete" tagged values before writing. If you are overriding
this then you need to remove these yourself:

attnames = conn.getAttributeNames();
for (aname in attnames) {
att = conn.getAttribute(aname);
if (att.getOperation() == "modify") {
// values are only tagged if the Attribute is "modify"


for (i = 0; i < att.size(); i++) {

if (att.getValueOperation(i) == "delete") {
att.removeValueAt(i);
i--; // dec i or we skip a value
}
}
}
}

Hope this helps!
-Eddie

0 new messages