cancel
Showing results for 
Search instead for 
Did you mean: 

Create Order Error

Former Member
0 Kudos

Hi,

I been trying to recreate an order that was send to the backend with an error in the mobile device. My basic idea is that from the error log on the device the user will be able to click on the event log and review the order details. I enter an order with both equipment and material to force a backend error. On the device I have enhanced the error list with the following code:

ErrorConflictInbox errorConflictInbox= SmartSyncRuntime.getInstance().getInboxNotifier().getErrorConflictInbox();

MeIterator iter;

syncBoResponse resp;

try {

iter= errorConflictInbox.getAllSyncBoResponses();

while(iter.hasNext()){

resp= (SyncBoResponse)iter.next();

resp.getSyncBoDescriptor().getSyncBoName();//SyncBo Name

resp.getSyncBoResponseState().toString();

resp.getResponseType().toString();//Get the SyncBo response type (conflict or ERROR)

resp.getText();// This will return the exact message from the server

}

The problem is that the code never executes the code inside the while loop. Please advise me on how to proceed to recreate the order on the mobile device.

Thanks,

Miguel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Miguel,

With the current settings this will not work for you.

By default Error and Conflicts are resolved by the client framework. Which means that whenever an error or conflict is returned from the middleware the client will replace the server version in the client.

In your case since it is a new order created in the client the server will send an error response with a delete request.

Error Conflict Handling by default works in the following way, during synchronization the client will create SyncBoResponse objects, at the end of sync the framework will resolve all the SyncBoResponses and delete them. By resolve I mean replace the client version of the "Error SyncBo" with the server version. By the time the handle comes back to the application code the ErrorConflictInbox is null.

There is an option provided in the MI_MCD transaction in the middleware to make Error Handling as 'Application Resolve' instead of 'Framework resolve'. When this is done, the framework will just create SyncBoResponses and put them in the ErrorConflictInbox and let the application handle it. Remember when you change the setting to Application Resolve you have to recreate the merep_meta.xml and redeploy the application on the client.

I have assumed that you have not done the above. Let me know if I am right.

Let me know if you have any further queries, ill be glad to help.

Best Regards,

Karthik Setty

Former Member
0 Kudos

Hi,

Thanks, that solved the problem. I have couple of related follow up questions:

1) What the difference between the middleware setting for handling errors in the framework or the application (in mi_cmd) and the backend error-pool option for order confirmation (under spro, IMG)?

2) Can you point me to additional information regarding application error handling. I will review the MDK documentation, but let me know if there an additional reference.

Thanks again,

Miguel

Former Member
0 Kudos

Hi Miguel,

I am not a backend expert so I am not 100% sure what spro and IMG do. But let me try to explain. All functional errors are checked in the backend, so if there are problems with the values entered the error checking is done in the backend. The middleware will handle only technical errors, something like "backend not reachable" is a technical error.

Unfortunately ErrorConflict Handling is only documented in MDK there is no additional documentation. Please also check the ErrorConflictInbox API, it has some sample code.

Answers (0)