Unable to Promote change through SDK– com.agile.util.exception.CMAppException: Unknown Number: Object does not exist.
I am getting the below exception while trying to promote my change using the SDK code:
While I do not face any issue while trying to promote the change manually from Web Cient. Can anyone help me here?
Error code : 393
Error message : Unknown Number: Object does not exist.
Root Cause exception : com.agile.util.exception.CMAppException: Unknown Number: Object does not exist.
at com.agile.api.pc.APIObject.createError(APIObject.java:118)
at com.agile.api.pc.RouteObject$ChangeStatusExAction.doSdkAction(RouteObject.java:2479)
at com.agile.api.common.SDKAction.run(SDKAction.java:23)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.security.Security.runAs(Security.java:61)
at com.agile.api.common.WebLogicAuthenticator.doAs(WebLogicAuthenticator.java:111)
at com.agile.api.common.Security.doAs(Security.java:54)
at com.agile.api.common.Security.doAs(Security.java:109)
at com.agile.api.pc.RouteObject.doChangeStatusEx(RouteObject.java:897)
at com.agile.api.pc.RouteObject.changeStatus(RouteObject.java:886)
at com.agile.change.AutoApproveChangeOrders.main(AutoApproveChangeOrders.java:104)
Hi Tapan,
At times we have faced the issue due to method in use being deprecated. Can you change your change status code as below and re-try.
yourclass.changeStatus(next_status, true,”Some comments “, true, true,null, new Object[]{},null, false);
Template for this method is as below :
public void changeStatus(IStatus newStatus,boolean auditRelease,String comment,boolean notifyOriginator,boolean notifyCCB,Object[] notifyList,Object[] approvers,Object[] observers,
boolean urgent)
Regards,
Arif
I checked all the changeStatus(…) methods in the API and looks like all are deprecated. In that case how can I get rid of this exception.
The current signature of my method with which I achieved the above exception is:
change.changeStatus(nextStatus, false, “”, false, false, notifyList,defaultApprovers, defaultObservers, false);
This the code Currently i am using the below code for changing status to Complete, you can change this with any other status constants. OR if you want to move it to m_change.getDefaultNextStatus() instead o what i have mentioned.:
IChange m_change = (IChange) m_session.getObject(ChangeConstants.CLASS_CHANGE_BASE_CLASS,CHANGE_NUMBER); // Load the change
m_session.disableAllWarnings();
m_change.changeStatus(m_change.getWorkflow().getStates(StatusConstants.TYPE_COMPLETE)[0], false, “”, false, false, null, null, null, null, false);
m_session.enableAllWarnings();
I think your method signature has one parameter less than mine.
Thanks a lot Arif. It worked out for me. I used the changeStatus(..) method with 10 parameters now.
But the thing which is still confusing me is why changeStatus(..) method with 10 parameters do not come in the list suggestions. Methods with 9 parameters only appears under suggestions and that too with a warning of this being depricated.