PX Illegal Argument Exception for SetNotifier function. Please someone guide me to solve this error. I have pasted the code below.

public class SetNotifiersEvent implements IEventAction
 
 
 
{ 
public IRow row1; 
IUserGroup usergroup;
 
@Override 
public EventActionResult doAction(IAgileSession session, INode node, 
IEventInfo info) { 
try { 
//IChange change = null; 
IWFChangeStatusEventInfo changestatus = (IWFChangeStatusEventInfo) info; 
IChange change; 
String str1 = ""; 
//IItem itm; 
IDataObject obj = changestatus.getDataObject(); 
Collection al = new ArrayList(); 
if(obj instanceof IChange) 
{ 
change = (IChange) obj;
 
ITable table = change.getTable(ChangeConstants.TABLE_AFFECTEDITEMS); 
Iterator it = table.iterator(); 
while(it.hasNext()) 
{ 
IRow row = (IRow) it.next(); 
ICell attr = (ICell) row.getCell(ChangeConstants.ATT_AFFECTED_ITEMS_ITEM_TYPE);
 
String itemNumber = (String) row.getValue(ChangeConstants.ATT_AFFECTED_ITEMS_ITEM_NUMBER);
 
IAgileList str = (IAgileList) attr.getValue(); 
change.logAction(str.toString()); 
//IAgileList[] list1 = str.getSelection(); 
//change.logAction(list1.toString()); 
change.logAction("Inside while, Before IF3-"+str); 
//change.logAction("Inside while, Before IF2-"+str.getName()); 
//change.logAction("Inside while, Before IF1-"+str.getValue()); 
if((str.toString()).equals("Business Process (Document Type)")|| (str.toString()).equals("Product Definition (Document Type)")) 
{ 
change.logAction("Inside IF"); 
/*IItem item1= session.getObject(I, arg1)*/ 
change.logAction("ItemNumber"+itemNumber); 
IItem item = (IItem) session.getObject(ItemConstants.CLASS_DOCUMENT, 
itemNumber);
 
ICell cell =item.getCell(ItemConstants.ATT_PAGE_TWO_LIST12); 
IAgileList lis = (IAgileList) cell.getValue(); 
change.logAction("value="+lis.toString()); 
String li = lis.toString(); 
//} 
List usergroup1 = new ArrayList(); 
change.logAction("adding notifiers2"); 
IQuery query = (IQuery)session.createObject(-5, "User Group"); 
change.logAction("adding notifiers3"); 
query.setCriteria((new StringBuilder("[General Info.Name] contains 'R&D'")).toString());
 
/*query.setCriteria((new StringBuilder("[General Info.Name] equal to R&D_Test")).toString()); 
*/
 
ITable tbl = query.execute(); 
Iterator iter = tbl.iterator(); 
//ArrayList users = new ArrayList(); 
//IUser user; 
change.logAction("adding notifiers1");
 
for(; iter.hasNext(); usergroup1.add(usergroup)) 
{ change.logAction("adding notifiers5"+usergroup); 
usergroup = (IUserGroup)((IRow)iter.next()).getReferent(); 
} 
/*usergroup1.add("R&D_Test");*/
 
change.logAction("adding notifiers4="+usergroup1);
 
changestatus.setNotifiers(usergroup1); //Error_Line 
change.logAction("adding notifiers"); 
ActionResult result= new ActionResult(ActionResult.STRING,"Finished"); 
return new EventActionResult(info,result); 
}
 
}
 
}
 
//}
 
} catch (APIException e) { 
// TODO Auto-generated catch block 
e.printStackTrace(); 
ActionResult result= new ActionResult(-1,"Exception"); 
return new EventActionResult(info,result); 
}
 
ActionResult result= new ActionResult(ActionResult.STRING,"Success"); 
return new EventActionResult(info,result); 
} 
}
Agile Expert Asked on March 10, 2015 in Software Development Kit (API).
Add Comment
1 Answer(s)
Best answer

Use sendNotification instead of setNotifiers. and create a Notification to send the mail to respective group.

Agile Talent Answered on March 24, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.