Service and Actions on Repeatable Sections

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Service and Actions on Repeatable Sections

bruno.buzzi
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bruno,

What triggers the service to run? If something inside a "row" (e.g. a button
inside that row, or value change for a control in that row), then the value
of the control on the "current row" should be sent to the service.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557270017208-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

bruno.buzzi
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bruno,

Is this a GET request you're doing to that URL? If so, I'd recommend you
have the action pass the values to the service, instead of putting them on
the URL manually as part of the service declaration. This way, the action
will automatically take care of passing the value of the control on the
"current row". Also see the "Passing URL parameters to GET and DELETE
methods" section on the page linked below. You'll let me know if this works
for you.

https://doc.orbeon.com/form-builder/advanced/services-and-actions/actions

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1557858011931-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

bruno.buzzi
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Perfect Bruno, I'm glad it worked and you were able to pass the values of the
"current iteration". And thank you for the update.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1558464080953-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex, I'm trying to do something similar and it does not work for me. I cannot do the POST method as my rest service do not accept it. 

Tried using an action to set the URL parameters for a GET request. 

Steps I did - 

1.Create http service
* enter the resource url
* Method - GET
* Serialisation - HTML form
* URL parameters - employeeid in first column first row and left blank in second column first row (the value of this emplyee id is set from the control in the repeated grid)
2. Create action
* run action when 'employeeId' control changes its value
* call created http service
* set service request values - control 'employeeId' and xpath - '/request/employeeid '
* and response to the respective controls in the same iteration

It does not give any response. Also tested the http service using the test button in HTTP service editor by entering a sample employeeid in the url parameters section -> receives a resource error. It works when I pass the same value in the url and test it it works and returns a response.

Need help in setting the get request parameter from the repeated grid control?

On Wednesday, May 22, 2019 at 2:41:22 AM UTC+8, Alessandro Vernet wrote:
Perfect Bruno, I'm glad it worked and you were able to pass the values of the
"current iteration". And thank you for the update.

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/7c90b3d6-bef7-4580-b5f0-29311d5f9edc%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bojja,

Those issues are always a bit tricky to debug for us here if we can't access
your service, as we can't reproduce the issue locally. Could you:

1. Provide screenshots of your HTTP Service dialog, Action dialog, and the
section of the form where the control is?
2. So we have more information in the log, could you please try to set your
logging as described in the Development configuration section of the XForms
Logging page, stop your server, remove the `orbeon.log`, restart the server,
reproduce the error you're getting when you press the test button and attach
the `orbeon.log` you get?

https://doc.orbeon.com/configuration/advanced/xforms-logging.html


‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1568244314629-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bojja, did you get your service and action to work? If not, and if this is
still on your front-burner, would you be able to share with us the
screenshots and `orbeon.log` per my previous message?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1568829710628-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex - attached as requested. This is still a bummer!

On Thursday, September 19, 2019 at 2:01:52 AM UTC+8, Alessandro Vernet wrote:
Hi Bojja, did you get your service and action to work? If not, and if this is
still on your front-burner, would you be able to share with us the
screenshots and `orbeon.log` per my previous message?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/2d366770-aa0b-4afb-8b5a-9a825de2ad80%40googlegroups.com.

Orbeon log.rar (169K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bojja,

Thank you for the screenshots and the log.

The service that seems to be causing a problem is `getCancellationDetails`.
In the `orbeon.log` you attached, I am not seeing the service being called.
If you look at the logs on the service side, does it look like Orbeon Forms
calls it when the value of "Employee ID" is changed?

Also, does the service call work when you trigger it from Form Builder with
the Test button in the "HTTP Service Editor" dialog? What is the result in
the Test Results tab?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1569025549082-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex- that's the service which is failing. I do not see it being called when testing the form by changing the values.

Testing using the dialog returns a resource error if the service is called using the GET parameters (Image attached)

Thanks

On Saturday, September 21, 2019 at 8:25:50 AM UTC+8, Alessandro Vernet wrote:
Hi Bojja,

Thank you for the screenshots and the log.

The service that seems to be causing a problem is `getCancellationDetails`.
In the `orbeon.log` you attached, I am not seeing the service being called.
If you look at the logs on the service side, does it look like Orbeon Forms
calls it when the value of "Employee ID" is changed?

Also, does the service call work when you trigger it from Form Builder with
the Test button in the "HTTP Service Editor" dialog? What is the result in
the Test Results tab?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/c28aec0e-924c-475f-9a0a-2777c8be60cb%40googlegroups.com.

Test.PNG (36K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Bojja,

From that screenshot, it doesn't seem that your service is returning XML or
JSON, which is expected by Orbeon Forms and would explain the error you are
getting when running this service, or am I reading this incorrectly?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1569277131079-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex - the service returns a JSON payload. It returns a response when I use the parameters in the resource url instead of passing them through the URL parameters section in the HTTP service editor.

If it is not a repeat section I could have used  fr:control-string-value('control') which returns a response with no issue. So, I would say the service only fails when adding the parameters under URL parameters section.

Thanks
Manish

On Tuesday, September 24, 2019 at 6:18:52 AM UTC+8, Alessandro Vernet wrote:
Hi Bojja,

From that screenshot, it doesn't seem that your service is returning XML or
JSON, which is expected by Orbeon Forms and would explain the error you are
getting when running this service, or am I reading this incorrectly?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/93eb1ffa-366e-4e5c-8c6d-93db810d06ad%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Manish,

In your screenshot, it seems that the service call failed, as the tab is
red. Is the the symptom of a problem, or were the correct parameters just
not passed in this case? If the latter, we would need to have some code the
reproduces the problem you're seeing to be able to help; would you Would you
be able to create a minimal example that reproduces the problem, that we can
run here, and attach it a response so we can look into it?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1569818174873-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Manish, did you get a chance to check if the tab showing in red was a
symptom of a problem with the service call?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1570210757892-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex - Tried passing the value manually by using the URL parameters and clicked on test. It shows the results tab in green but the response is null. Tried to test it in the form and when entered an employee id in the repeat field this error message is shown "There was an error communicating with a backend service. Please contact the application administrator."

On Saturday, October 5, 2019 at 1:39:19 AM UTC+8, Alessandro Vernet wrote:
Hi Manish, did you get a chance to check if the tab showing in red was a
symptom of a problem with the service call?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/4e22fbc4-a00c-4727-800d-7b3f757df316%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Manish,

So we have more information in the log, could you please try to set your
logging as described in the Development configuration section of the XForms
Logging page, stop your server, remove the `orbeon.log`, restart the server,
reproduce that second situation where you get a the message "There was an
error communicating with a backend service. Please contact the application
administrator.", and attach the `orbeon.log` you get?

https://doc.orbeon.com/configuration/advanced/xforms-logging.html


‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1578529009890-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

mbojja
Hi Alex - using the same form as before, reproduced and the log attached.

On Thursday, January 9, 2020 at 8:16:08 AM UTC+8, Alessandro Vernet wrote:
Hi Manish,

So we have more information in the log, could you please try to set your
logging as described in the Development configuration section of the XForms
Logging page, stop your server, remove the `orbeon.log`, restart the server,
reproduce that second situation where you get a the message "There was an
error communicating with a backend service. Please contact the application
administrator.", and attach the `orbeon.log` you get?

<a href="https://doc.orbeon.com/configuration/advanced/xforms-logging.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdoc.orbeon.com%2Fconfiguration%2Fadvanced%2Fxforms-logging.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEK0Z2SHcCE_8wt7zB5OqJ3fET_PQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fdoc.orbeon.com%2Fconfiguration%2Fadvanced%2Fxforms-logging.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEK0Z2SHcCE_8wt7zB5OqJ3fET_PQ&#39;;return true;">https://doc.orbeon.com/configuration/advanced/xforms-logging.html


‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: <a href="http://discuss.orbeon.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fdiscuss.orbeon.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF5V5zfD-87RVoalaG4cqO_RzdDcA&#39;;return true;">http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/da9d1943-c142-41dc-baab-60181abdc27e%40googlegroups.com.

orbeon.log (1M) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Service and Actions on Repeatable Sections

Alessandro  Vernet
Administrator
Hi Manish,

Thank you for the `orbeon.log`. On line 9455, I see the following error:

    xforms-submit-error - Body received with non-XML media type
    for `replace="instance"`: application/x-www-form-urlencoded

So it seems that the service you're calling with `getCancellationDetails`
isn't returning a correct `Content-Type` header. Does this help?

‑Alex

-----
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
--
Sent from: http://discuss.orbeon.com/

--
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/orbeon/1578701374583-0.post%40n4.nabble.com.
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
12