Trigger After Update does not run when records got updated f

Posted by Wave Kasipat on 13-Mar-2016 09:59

I have one trigger "After Update" that Type "Update Field Value", It work perfectly when I update record via UI in rollbase.

 

But this trigger does not run when I update records by Rollbase Rest API updateArr.

I call rest from java like this.

uri = UriBuilder.fromUri(readConfig.getRBServUrl())

.path("updateArr")

.queryParam("sessionId", loginFSCT.getSessionId())

.queryParam("output", "json")

.queryParam("objName", "ATM_ApfP")

.build();

target = client.target(uri);

response = target.request().post(Entity.entity(xmlStr, MediaType.APPLICATION_ATOM_XML_TYPE),Response.class);

 

with this xml.

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

<data id='1295009' useIds='false'><Field name='status'>DN</Field></data>

<data id='1295010' useIds='false'><Field name='status'>DN</Field></data>

<data id='1327669' useIds='false'><Field name='status'>DN</Field></data>

<data id='1327670' useIds='false'><Field name='status'>DN</Field></data>

<data id='1327668' useIds='false'><Field name='status'>DN</Field></data>

</request>"

 

and response is {"status":"ok" } also all records updated correctly, but only trigger that didn't run.

 

Am I missing some parameter in xml or there Is other way I can do to run this trigger?

Thanks.

PS. I use Rollbase 4.0.3.1

Posted by Shiva Duriseati on 14-Mar-2016 05:58

Hi Wave,

With Apache common Http Client I am able to update the values succesfully using Update Field Value trigger.

I have used the following code and its working fine.

String postResponse = null;
File file=new File("D:/recordlist.xml");
try {
HttpClient httpClient=new HttpClient();
PostMethod post = new PostMethod("www.rollbase.com/.../updateArr
post.addRequestHeader("Accept", "application/xml");
RequestEntity entity = new FileRequestEntity(file, "application/xml");
post.setRequestEntity(entity);
httpClient.executeMethod(post);
postResponse = post.getResponseBodyAsString();
System.out.println(postResponse);
} catch (Exception e) {
System.out.println(e);
}

My Xml File is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<request>
<data id="228382024" useIds="false">
<Field name="name">one</Field>
</data>
<data id="228382025" useIds="false">
<Field name="name">two</Field>
</data>
<data id="228382026" useIds="false">
<Field name="name">three</Field>
</data>
<data id="228382027" useIds="false">
<Field name="name">four</Field>
</data>
</request>

Output:

<?xml version="1.0" encoding="UTF-8" ?>
<resp status="ok">
<Msg>4 records have been updated.</Msg>
</resp>

Please revert back if you need any assistance.

Regards,
Shiva

All Replies

Posted by Shiva Duriseati on 14-Mar-2016 05:58

Hi Wave,

With Apache common Http Client I am able to update the values succesfully using Update Field Value trigger.

I have used the following code and its working fine.

String postResponse = null;
File file=new File("D:/recordlist.xml");
try {
HttpClient httpClient=new HttpClient();
PostMethod post = new PostMethod("www.rollbase.com/.../updateArr
post.addRequestHeader("Accept", "application/xml");
RequestEntity entity = new FileRequestEntity(file, "application/xml");
post.setRequestEntity(entity);
httpClient.executeMethod(post);
postResponse = post.getResponseBodyAsString();
System.out.println(postResponse);
} catch (Exception e) {
System.out.println(e);
}

My Xml File is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<request>
<data id="228382024" useIds="false">
<Field name="name">one</Field>
</data>
<data id="228382025" useIds="false">
<Field name="name">two</Field>
</data>
<data id="228382026" useIds="false">
<Field name="name">three</Field>
</data>
<data id="228382027" useIds="false">
<Field name="name">four</Field>
</data>
</request>

Output:

<?xml version="1.0" encoding="UTF-8" ?>
<resp status="ok">
<Msg>4 records have been updated.</Msg>
</resp>

Please revert back if you need any assistance.

Regards,
Shiva

This thread is closed