cancel
Showing results for 
Search instead for 
Did you mean: 

retrieving data in MI Client

Former Member
0 Kudos

Hi,

I have created syncBo's in the MIddleware(MI Client). In the middleware the data from the backend is displaying in the worklist monitor(merep_mon) but i cant get the data in the mobile client.

I have just one table in the backend ZPATIENT with some fields.

this is the code function i have writen to retrieve the data from the MI Server.

public Vector getData(){

Vector res=new Vector();

SyncBoCollection syncBOS=null;

try {

syncBOS = dataFacade.getSyncBos(patientsyncBoDescriptor);

} catch (PersistenceException e) {

System.out.println("Exception in data");

// TODO Auto-generated catch block

e.printStackTrace();

}

System.out.println("Syncbos size: " + syncBOS.size());

MeIterator it = syncBOS.iterator();

System.out.println("Size of the Iterator: " + it.elementCount());

for (MeIterator i = syncBOS.iterator(); i.hasNext();) {

System.out.println("Inside fro loop!");

SyncBo mySyncBo = (SyncBo) i.next();

Row headRow = mySyncBo.getTopRow();

String fName=(String)headRow.getFieldValue(firstNAME);

System.out.println("Name: " + fName);

res.add(fName);

}

return res;

}

Please can someone tell me where i am going wrong in this code ?

because everything seems to be right in the MI server

> The sync BOs are activated and enabled

> merep_mon is also displaying the data.

thanks .....

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Sen,

Once you replicate the syncbo the data should be present in the middleware check table MEREP_207 if your Syncbo is T01/T51 type, Check MEREP_10100 if S01 type.

If data exists in the middleware then once you sync the MI client all the data should be downloaded to the client (as its only one syncbo).

Initially before you develop code for create, modify, delete of records from the client, you would got a default code which just displays the no. of header and child records.

Cheers,

Karthick

Former Member
0 Kudos

Hi Sougata,

Can you confirm that the 'System.out.println("Syncbos size: " + syncBOS.size());' is displaying 0 and in the MEREP_MON shows that it is sending syncbos in the Outbound Worklist.

With this we are sure that the problem is with the MI Client code.

Thanks,

Karthik

Former Member
0 Kudos

ya the 'System.out.println("Syncbos size: " + syncBOS.size()); is displaying 0

and in the merep_mon it shows that it is sending syncbos in the outbound worklist

it show the details of the table in the backend.

Former Member
0 Kudos

Sougata,

If you install db2e you can check the database directly to see if the table is populated with data. If you are sure that the middleware is sending data then this data should be in the tables.

Another place you can look at is how you got the value "patientsyncBoDescriptor".

You can also reset the data in the client, and change your trace settings to 'ALL', and when you sync again the database updates are logged, you can verify to see if the data gets saved.

Best Regards,

Karthik

Former Member
0 Kudos

Hi Karthik,

thnks for your reply.

patientsyncBoDescriptor=descriptorFacade.getSyncBoDescriptor("ZPATIENT");

this is how i got the sync BO descriptor.

ZPATIENT is the name of the synch Bo in the meRepMeta.xml file.

I am developing an AWT application and have kept the meRepMeta.xml file under

app-root folder. the file looks like this.....

-


<?xml version="1.0" encoding="utf-8" ?>

- <MeRepApplication schemaVersion="1.1" id="ZPATIENT_SOL" version="1.0">

<Property name="CLIENT.BUILDNUMBER" />

<Property name="C_APPLRESOLVE" />

<Property name="DATA_VISIBLE_SHARED" />

<Property name="EN">LANGUAGE</Property>

<Property name="E_APPLRESOLVE" />

<Property name="FACADE_C_CLIENT">X</Property>

<Property name="FACADE_E_CLIENT">X</Property>

<Property name="HOMEPAGE.INVISIBLE" />

<Property name="INITVALUE" />

<Property name="RUNTIME" />

<Property name="TYPE">APPLICATION</Property>

- <SyncBO id="ZPATIENT" version="1" type="timedTwoWay" allowCreate="true" allowModify="true" allowDelete="true" reqDirectSync="false" downloadOrder="1">

- <TopStructure name="TOP">

- <Field name="SYNC_KEY" type="N" length="10" decimalLength="0" signed="false" isKey="true" isIndex="true">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="PATIENTID" type="P" length="11" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="FIRSTNAME" type="C" length="50" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="LASTNAME" type="C" length="50" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="GENDER" type="C" length="1" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

- <Field name="DOB" type="D" length="8" decimalLength="0" signed="false" isKey="false" isIndex="false">

<Input type="create">false</Input>

<Input type="modify">false</Input>

</Field>

</TopStructure>

</SyncBO>

</MeRepApplication>

-


regards,

Former Member
0 Kudos

Hi Sougata,

Thanks for sharing the meRepMeta.xml file.

I feel you are not getting an data because of the following parameter.

<Property name="DATA_VISIBLE_SHARED" />

When you do a SmartSynRuntime.getDataFacade(), you get user data and not the shared data, but the data is stored in the shared space because of the above parameter.

You can rectify this by unchecking the 'Data visible to all' checkbox in the MI_MCD transaction in the middleware for this component. After you perform this operation generate the meRepMeta.xml file again and redeploy the war file with the new xml file.

Please let me know if this works.

UPDATE: Sougata, can you first tell me if the checkbox is already unchecked?

Thanks,

Karthik

Message was edited by:

Karthik V Setty