on 12-09-2009 4:28 PM
Hi:
I am developing an application in 7.1 Mobile for PDA (OCA).
When sending data to the DOE with a synchronization have two scriptwriter:
1. The data is correct and data synchronization is correct.
2. The data is not correct and data synchronization is correct. On the monitor I get the error but data synchronization is correct, the user is not aware that there was an error, until I return to synchronize not return the correct data to the PDA.
Scenario 1 is correct, but in Scenario 2 need to know that something has gone wrong.
Any ideas?
Best regards
Maria Elena
Hi,
Could you explain the problem scenario 2 in more details. I am still confused as to whats the exact issue.
Regards,
Nipun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I have the following code:
String messages = "";
String msg;
Descargos_srvModel model = (Descargos_srvModel) OcaRoot.getInstance().getModel(Descargos_srvModel.class);
SyncManager syncMgr = OcaRoot.getInstance().getSyncManager();
RejectionRepository rejrep = syncMgr.getRejectionRepository();
Collection rejections = rejrep.getRejections( (OcaModel) model ) ;
System.out.println("rejections : " + rejections.size());
logger.debug( this.getClass(), "AGE: getRejections count: " + rejections.size());
Iterator rejIter = rejections.iterator();
while (rejIter.hasNext())
{
msg = "";
Rejection rej = (Rejection) rejIter.next();
System.out.println("Estado: " + rej.getRejectionState());
logger.debug( this.getClass(), "AGE: getRejections State: " + rej.getRejectionState());
Iterator rejInfoIter = rej.getRejectionInfos();
while (rejInfoIter.hasNext())
{
RejectionInfo rejInfo = (RejectionInfo) rejInfoIter.next();
logger.debug( this.getClass(), "AGE: getRejections getMessageText: " + rejInfo.getMessageText());
logger.debug( this.getClass(), "AGE: getRejections getErrorId: " + rejInfo.getErrorId());
logger.debug( this.getClass(), "AGE: getRejections getMessageNumber: " + rejInfo.getMessageNumber());
logger.debug( this.getClass(), "AGE: getRejections getMessageType: " + rejInfo.getMessageType());
logger.debug( this.getClass(), "AGE: getRejections getMessageVariable1: " + rejInfo.getMessageVariable1());
logger.debug( this.getClass(), "AGE: getRejections getParameterName: " + rejInfo.getParameterName());
msg = msg.concat( rejInfo.getMessageText() + ": ");
}
Iterator rejNodesIter = rej.getRejectedNodes();
while (rejNodesIter.hasNext())
{
RejectedNode rejNode = (RejectedNode) rejNodesIter.next();
logger.debug( this.getClass(), "AGE: getRejections Node: " + rejNode.getClass());
logger.debug( this.getClass(), "AGE: getRejections ClientVersion: " + rejNode.getClientVersion().getClass());
}
if( rej.getRejectionState().equals( RejectionState.INITIAL) )
{
// we always take the client version, so that the user can fix it //
rej.acceptClientVersion();
}
logger.debug( this.getClass(), "AGE: getRejections msg: " + msg);
messages = messages.concat( "\n" + msg );
logger.debug( this.getClass(), "AGE: getRejections messages: " + messages);
}
Hi;
I have the following code in the componente controller and the rejections.size() always is 0.
in the console of administracion I can see the error.
My model has the nodes 'Conflicts Resolution' of type 'Manual'.
Any Idea????
Best Regards.
String messages = "";
String msg;
Descargos_srvModel model = (Descargos_srvModel) OcaRoot.getInstance().getModel(Descargos_srvModel.class);
SyncManager syncMgr = OcaRoot.getInstance().getSyncManager();
RejectionRepository rejrep = syncMgr.getRejectionRepository();
Collection rejections = rejrep.getRejections( (OcaModel) model ) ;
System.out.println("rejections : " + rejections.size());
logger.debug( this.getClass(), "AGE: getRejections count: " + rejections.size());
Iterator rejIter = rejections.iterator();
while (rejIter.hasNext())
{
msg = ""; Rejection rej = (Rejection) rejIter.next();
System.out.println("Estado: " + rej.getRejectionState());
}
Hi
Please use the 'mbosync' apis in order to retrieve rejections.
You can get the details of the same at the following location
<http://help.sap.com/javadocs/nwmobile/SP1/com/sap/tc/mobile/cfs/mbosync/api/package-summary.html>
Here is a code snippet which i used in my application to retrieve the rejections
=============================
MBOSyncManager msm = MBOSyncManager.getInstance(MWDSessionManager.getSession());
RejectionRepository rr = msm.getRejectionRepository();
Rejection r;
com.sap.tc.mobile.test.component.wdp.IPrivateRejectionRepositoryView.IRejectionElement re;
for(ManagedIterator i = rr.getRejections(mdesc); i.hasNext(); re.setRejectionObject(r))
{
r = (Rejection)i.next();
re = node.createRejectionElement();
node.addElement(re);
}
=============================
Now if you want to accept the client version, you can try the following
=============================
com.sap.tc.mobile.test.component.wdp.IPrivateRejectionRepositoryView.IRejectionElement re = wdContext.currentRejectionElement();
if(re != null)
try
{
re.getRejectionObject().acceptClientVersion();
}
catch(Exception e)
{
e.printStackTrace();
wdComponentAPI.getMessageManager().reportException("Rejection is already resolved");
}
=============================
Hope this helps
Best Regards
vaidehi
Hi:
Ok, thanks. This is correct.
I have the rejection on the PDA, but if I modify again the data I get an exception:
java.lang.IllegalStateException: Cannot update parent during create of child
at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)
Any idea to modify the register again?
Best regards.
Maria Elena
Hi:
The log I get the following exception:
<r id="1260897165906" t="18:12:45" d="2009-12-15" s="E" c="000" u="E011154" g="es" m="Internal Error. Please check the log file. --> java.lang.IllegalStateException: Cannot update parent during create of child
at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)
at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:162)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:278)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:232)
at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.doUpdate(ModelClassCache.java:108)
at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.flush(ModelClassCache.java:64)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.flushCache(PersistenceManager.java:845)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.executeQuery(PersistenceManager.java:209)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:548)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:493)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:487)
at com.sap.tc.mobile.cfs.deploy.DeploymentManager.getArchiveInfo(DeploymentManager.java:1596)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.getApplicationClassloader(Application.java:194)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)
at com.sap.tc.mobile.wdlite.framework.Start.notifySyncAction(Start.java:439)
at com.sap.tc.mobile.wdlite.framework.Start$3.doHandleEvent(Start.java:298)
at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem.notifyOnAction(MenuBar.java:390)
at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem$1.widgetSelected(MenuBar.java:377)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:175)
at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:233)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:250)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:503)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)
at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:585)
at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:609)
at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:646)
at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:259)
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)
Thanks and best regards.
Maria Elena
HI:
I get the folloging exception:
<r id="1260897165906" t="18:12:45" d="2009-12-15" s="E" c="000" u="E011154" g="es" m="Internal Error. Please check the log file. --> java.lang.IllegalStateException: Cannot update parent during create of child
at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:210)
at com.sap.tc.mobile.cfs.sync.ChangeListenerImpl.beforeUpdate(ChangeListenerImpl.java:162)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:278)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.update(PersistenceManager.java:232)
at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.doUpdate(ModelClassCache.java:108)
at com.sap.tc.mobile.cfs.model.impl.ModelClassCache.flush(ModelClassCache.java:64)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.flushCache(PersistenceManager.java:845)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.executeQuery(PersistenceManager.java:209)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:548)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:493)
at com.sap.tc.mobile.cfs.pers.PersistenceManager.read(PersistenceManager.java:487)
at com.sap.tc.mobile.cfs.deploy.DeploymentManager.getArchiveInfo(DeploymentManager.java:1596)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.getApplicationClassloader(Application.java:194)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)
at com.sap.tc.mobile.wdlite.framework.Start.notifySyncAction(Start.java:439)
at com.sap.tc.mobile.wdlite.framework.Start$3.doHandleEvent(Start.java:298)
at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem.notifyOnAction(MenuBar.java:390)
at com.sap.tc.mobile.wdlite.renderer.swt.container.MenuItem$1.widgetSelected(MenuBar.java:377)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:928)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3348)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2968)
at com.sap.tc.mobile.wdlite.renderer.swt.container.WorkingArea.refresh(WorkingArea.java:175)
at com.sap.tc.mobile.wdlite.renderer.api.RenderingManager.refresh(RenderingManager.java:233)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.refresh(Application.java:250)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.navigate(Application.java:503)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.enter(Application.java:243)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.setCurrent(Application.java:119)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:143)
at com.sap.tc.mobile.wdlite.progmodel.core.Application.launch(Application.java:175)
at com.sap.tc.mobile.wdlite.progmodel.core.WDLite.launchApplication(WDLite.java:365)
at com.sap.tc.mobile.wdlite.framework.Start.runOnContext(Start.java:585)
at com.sap.tc.mobile.wdlite.framework.Start.startApplication(Start.java:609)
at com.sap.tc.mobile.wdlite.framework.Start.startContainer(Start.java:646)
at com.sap.tc.mobile.cfs.framework.spi.FrameworkManager.startContainer(FrameworkManager.java:259)
at com.sap.tc.mobile.cfs.init.FrameworkInitializer.init(FrameworkInitializer.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sap.tc.mobile.cfs.startup.pda.Startup.main(Unknown Source)
">
Thanks and best regards.
MAria Elena
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.