Discussion:
Unable to set ISIM Request status to SUCCESFUL_WARNING for ADD account operation.
(too old to reply)
DIVYA RAIBAGKAR
2020-12-22 10:04:22 UTC
Permalink
I am working on a custom adapter which supports add/modify/delete operations.

The scenario is while adding user account if any of the attributes are failed, such attributes needs to be removed from account form and the status of ISIM request must be set to Warning.

In the script connector I am adding the failed entries to a new attribute called "failedAttribute" and set this in entry object.
Whereas the script in the ADD AL - After ADD Hook is as follows


var failed = conn.getAttribute("failedAttribute");
if(failed != null){
work.removeAllAttributes();
work.setAttribute("details",failed);
work.getAttribute("details").setOper(Packages.com.ibm.di.entry.AttributeValue.AV_UNCHANGED);
for(attrIdx=0;attrIdx<failed.getValues().length;attrIdx++) {
work.getAttribute("details").setValueOper(attrIdx,Packages.com.ibm.di.entry.AttributeValue.AV_UNCHANGED);
}
var v1 = new Packages.java.util.Vector();
v1.add(conn.getProperty(REQST_OP_STATUS_REASON));
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASON_MESSAGE_ARGS, v1);
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.STATUSCODE, new Packages.java.lang.Integer(Packages.com.ibm.itim.remoteservices.provider.Status.SUCCESSFUL_WARNING));
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASONCODE, Packages.com.ibm.itim.remoteservices.provider.Reason.PROCESSING_ERROR );
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASON_MESSAGE, Packages.com.ibm.di.dispatcher.DispatcherReasonMessage.ADAPTER_ADD_WARNING );
}else{
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.STATUSCODE, new Packages.java.lang.Integer(Packages.com.ibm.itim.remoteservices.provider.Status.SUCCESSFUL));
}

From Dispatcher log it is known that STATUSCODE is set to 3 i.e. SUCCESSFUL_WARNING and in ISIM trace.log I could see
<LogText><![CDATA[returning status=SUCCESSFUL_WARNING (SUCCESSFUL_WARNING), reason=PROCESSING_ERROR (PROCESSING_ERROR), reasonMsg=com.ibm.di.adapter.ADD_WARNING,{0}=::Failed to add access]]></LogText>

I am unable understand why the status is marked as SUCCESSFUL in ISIM.
Please any insight is highly appreciated
yn2000
2021-02-02 16:58:24 UTC
Permalink
Post by DIVYA RAIBAGKAR
I am working on a custom adapter which supports add/modify/delete operations.
The scenario is while adding user account if any of the attributes are failed, such attributes needs to be removed from account form and the status of ISIM request must be set to Warning.
In the script connector I am adding the failed entries to a new attribute called "failedAttribute" and set this in entry object.
Whereas the script in the ADD AL - After ADD Hook is as follows
var failed = conn.getAttribute("failedAttribute");
if(failed != null){
work.removeAllAttributes();
work.setAttribute("details",failed);
work.getAttribute("details").setOper(Packages.com.ibm.di.entry.AttributeValue.AV_UNCHANGED);
for(attrIdx=0;attrIdx<failed.getValues().length;attrIdx++) {
work.getAttribute("details").setValueOper(attrIdx,Packages.com.ibm.di.entry.AttributeValue.AV_UNCHANGED);
}
var v1 = new Packages.java.util.Vector();
v1.add(conn.getProperty(REQST_OP_STATUS_REASON));
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASON_MESSAGE_ARGS, v1);
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.STATUSCODE, new Packages.java.lang.Integer(Packages.com.ibm.itim.remoteservices.provider.Status.SUCCESSFUL_WARNING));
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASONCODE, Packages.com.ibm.itim.remoteservices.provider.Reason.PROCESSING_ERROR );
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.REASON_MESSAGE, Packages.com.ibm.di.dispatcher.DispatcherReasonMessage.ADAPTER_ADD_WARNING );
}else{
work.setProperty(Packages.com.ibm.di.dispatcher.Defs.STATUSCODE, new Packages.java.lang.Integer(Packages.com.ibm.itim.remoteservices.provider.Status.SUCCESSFUL));
}
From Dispatcher log it is known that STATUSCODE is set to 3 i.e. SUCCESSFUL_WARNING and in ISIM trace.log I could see
<LogText><![CDATA[returning status=SUCCESSFUL_WARNING (SUCCESSFUL_WARNING), reason=PROCESSING_ERROR (PROCESSING_ERROR), reasonMsg=com.ibm.di.adapter.ADD_WARNING,{0}=::Failed to add access]]></LogText>
I am unable understand why the status is marked as SUCCESSFUL in ISIM.
Please any insight is highly appreciated
First of all, you have to think that ISIM and SDI (where the AL is running) are two different machines, which they are.
When receive the instruction from ISIM, SDI must tag the result as successful to send a data, such as the value of failedAttribute, back to ISIM.
So, my guess, you need to configure the ISIM Operational Workflow of add account operation that check whether failedAttribute value exist. If it does then, flip the success message to warning message, or something similar to that avenue.
Rgds. YN.

Loading...