Hi As a means of integrating Orbeon with other systems that need to feed Orbeon forms with initial form instance data, we have developed a mechanism to instantiate new forms via API that we build, that relies on the CRUD REST API of Orbeon
4.1.0.201304182144 PE to HTTP PUT the XML for the XForm instance. This means we can pre-populate forms without involving the user’s browser, which is important to us. Once we have instantiated a form this way we send the user’s browser to the corresponding
edit form URL. It works great besides from one issue: Form Builder actions that are set “Run on creation only” never run. Obviously this relates to the fact that we send the user to the edit form URL, not the new form URL. For the moment we have to set
such actions to “Run always”. Unfortunately this causes other issues for us. I have a suspicion that we may be able to resolve this by using the new “drafts” feature of Orbeon 4, but I’m open to suggestions! Assistance would be really appreciated. -Stian 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]. |
Administrator
|
Hi Stian,
The question is: how could Orbeon Forms know that when a user goes to /app/form/123/edit, this is the first time the form is being edited? From the perspective of Orbeon Forms, it's just loading data from the database and editing it. You could imagine that a "flag" is stored with the data to remember whether actions already ran on this data. But this isn't implemented right now. Or maybe you had something else in mind? Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Hi Alex,
Thanks for taking the time to help me with this. I was hoping there was some way I could leverage the drafts/autosave feature described by your blog here: http://blog.orbeon.com/2013/10/autosave.html . It sounds like more or less the same problem. Essentially we would autosave a form ahead of the user seeing it for the first time. Your blog says "you can access drafts from the summary page", so does this mean that these are loaded with a URL different to new/edit? I unfortunately don't have a Orbeon 4.3+ server available to easily check this myself :( I was considering a form data based solution like you described, and maybe we need to employ this (using manually entered XForms markup), but it would be good if we can achieve a solution that doesn't involve the form authors because we want to keep it simple for them. -Stian -----Original Message----- From: Alessandro Vernet [mailto:[hidden email]] Sent: 27 August 2014 00:52 To: [hidden email] Subject: [orbeon] Re: Form Builder - HTTP Action "Run on creation only" Hi Stian, The question is: how could Orbeon Forms know that when a user goes to /app/form/123/edit, this is the first time the form is being edited? From the perspective of Orbeon Forms, it's just loading data from the database and editing it. You could imagine that a "flag" is stored with the data to remember whether actions already ran on this data. But this isn't implemented right now. Or maybe you had something else in mind? Alex ----- -- Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet -- View this message in context: http://discuss.orbeon.com/Form-Builder-HTTP-Action-Run-on-creation-only-tp4658739p4658742.html Sent from the Orbeon Forms community mailing list mailing list archive at Nabble.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]. -- 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]. |
Hi Alex,
I think I was being silly... The "auto-save" feature probably only kicks in after the "Run on creation only" actions are run! So it probably cannot provide a solution to my problem. Is there a way to ensure that all forms call some kind of XForms instance initialisation service without relying on the form author to add this to each form manually? Maybe through a custom servlet filter which manipulates the XForms markup for the XForms processor? I think all the documented solutions require the author to take actions: http://wiki.orbeon.com/forms/how-to/logic/load-initial-form-data -Stian -- 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]. |
Administrator
|
Hi Stian,
Correct: I don't think that the auto-save feature can help here as whether users load a draft (auto-saved) or non-draft (typically saved with the "save" button), they are not in the "on creation" case anymore. Since 4.4, you can put custom XForms code in a file and instruct Form Runner to "inject" it into forms. You'll find more about this on the page linked below. Would this allow you to put the logic you need to run your initialization of the form data? https://github.com/orbeon/orbeon-forms/wiki/Form-Runner-~-Custom-Model-Logic Alex
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Thanks Alex, this is the best lead I've had to date.
Do you know if it would cause issues to Form Runner if I were to use a <xf:setvalue/> actions to change the instance('fr-parameters-model')/mode from "new" to "edit" and instance('fr-parameters-model')/document to a generated documentUUID after loading the XForm instance? My expectation would be that when the form is submitted by the user it would then consider the submission an edit of the submission identified by the documentUUID. I leave the current code to generate this submission XML behind the scenes ahead of the user involvement, as we do at present. -Stian -- 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]. |
Free forum by Nabble | Edit this page |