Workflow Send button behavior

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

Workflow Send button behavior

Arlo White
Using: Orbeon Forms 3.8.0.201005141841 PE

I've configured Orbeon to use a REST persistence layer. I've been doing
some testing with a servlet, which responds with a bit of HTML to PUTs
and POSTs.

At my REST interface I want to be able to differentiate Saves from
Submits/Sends and know the AppName/FormName of the form. I also want the
user to see my HTML response. I'm having a lot of trouble configuring
Orbeon to fulfill these requirements.

After filling out the form and clicking Review I get to the view page.
The first click of the Workflow Send button does a PUT to
/persist/data/crud/Foo/Bar2/data/4dbdfe569cbffb96dc39b713ca2b22e3/data.xml
However, I don't see the HTML being returned from the PUT request in the
browser. Orbeon doesn't show any kind of confirmation of submission. All
the browser displays is a swirl while the ajax call is in progress. It
lets the user click send again, which they shouldn't be able to do. The
2nd (and later clicks) PUT to
/persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml, which is
what I wanted originally. (To differentiate a Save from a Send) If I
click Edit and then Review again, the Workflow send button PUT goes to
/persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml

When I specify an absolute send.uri
<property as="xs:anyURI" name="oxf.fr.detail.send.uri.*.*"
value="http://path/to/my/servlet"/>
It does a POST and I see the HTML response in the browser. However, now
I have no way of know what app/form did the submit, so it's pretty useless.

If I use the submit button there's no way of differentiating save clicks
from submit clicks since they both go to the same PUT url.

If I'm editing a form: /orbeon/fr/Foo/Bar2/edit/1234
First Send: PUT /persist/data/crud/Foo/Bar2/data/1234/data.xml
Second Send: PUT
/persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
The second send loses the document id (1234), so I know it's a final
submission but I no longer know the user was editing a particular document.

How do I configure the workflow send button to accomplish this?

--
Arlo White
Application Management / ITS
CalPoly, San Luis Obispo
[hidden email]


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Workflow Send button behavior

Alessandro  Vernet
Administrator
Arlo,

The idea of the workflow-send is that when you have a difference
between save and submit:

1. Save just calls the persistence layer.
2. The persistence layer always does just a save; it doesn't implement
any submit/send logic.
3. Submit or send (using workflow-send) saves, and posts the data to a
page you implement.
4. You implement the submit/send logic in the page users get sent to
when they do a a submit/send. You receive the whole document there,
including the UUID, so you can update in the database if you want to
mark it somehow as submitted. In that page, you can also generate HTML
as appropriate to give some feedback to users, or redirect them to
another page.

Does this make sense? Does it fit your use case?

Alex

On Thu, Nov 18, 2010 at 4:59 PM, Arlo White <[hidden email]> wrote:

> Using: Orbeon Forms 3.8.0.201005141841 PE
>
> I've configured Orbeon to use a REST persistence layer. I've been doing some
> testing with a servlet, which responds with a bit of HTML to PUTs and POSTs.
>
> At my REST interface I want to be able to differentiate Saves from
> Submits/Sends and know the AppName/FormName of the form. I also want the
> user to see my HTML response. I'm having a lot of trouble configuring Orbeon
> to fulfill these requirements.
>
> After filling out the form and clicking Review I get to the view page.
> The first click of the Workflow Send button does a PUT to
> /persist/data/crud/Foo/Bar2/data/4dbdfe569cbffb96dc39b713ca2b22e3/data.xml
> However, I don't see the HTML being returned from the PUT request in the
> browser. Orbeon doesn't show any kind of confirmation of submission. All the
> browser displays is a swirl while the ajax call is in progress. It lets the
> user click send again, which they shouldn't be able to do. The 2nd (and
> later clicks) PUT to
> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml, which is
> what I wanted originally. (To differentiate a Save from a Send) If I click
> Edit and then Review again, the Workflow send button PUT goes to
> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
>
> When I specify an absolute send.uri
> <property as="xs:anyURI" name="oxf.fr.detail.send.uri.*.*"
> value="http://path/to/my/servlet"/>
> It does a POST and I see the HTML response in the browser. However, now I
> have no way of know what app/form did the submit, so it's pretty useless.
>
> If I use the submit button there's no way of differentiating save clicks
> from submit clicks since they both go to the same PUT url.
>
> If I'm editing a form: /orbeon/fr/Foo/Bar2/edit/1234
> First Send: PUT /persist/data/crud/Foo/Bar2/data/1234/data.xml
> Second Send: PUT
> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
> The second send loses the document id (1234), so I know it's a final
> submission but I no longer know the user was editing a particular document.
>
> How do I configure the workflow send button to accomplish this?
>
> --
> Arlo White
> Application Management / ITS
> CalPoly, San Luis Obispo
> [hidden email]
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Re: Workflow Send button behavior

Arlo White
On 11/24/2010 06:52 PM, Alessandro Vernet wrote:

> Arlo,
>
> The idea of the workflow-send is that when you have a difference
> between save and submit:
>
> 1. Save just calls the persistence layer.
> 2. The persistence layer always does just a save; it doesn't implement
> any submit/send logic.
> 3. Submit or send (using workflow-send) saves, and posts the data to a
> page you implement.
> 4. You implement the submit/send logic in the page users get sent to
> when they do a a submit/send. You receive the whole document there,
> including the UUID, so you can update in the database if you want to
> mark it somehow as submitted. In that page, you can also generate HTML
> as appropriate to give some feedback to users, or redirect them to
> another page.
I didn't see the App name, Form name, or document id in the POST body.

I ended up unzipping orbeon-form-runner.jar, modifying
persistence-model.xml and adding app/form/document to the resource url:

<xforms:submission id="fr-workflow-confirmation-submission"
         
resource="{xxforms:property(string-join(('oxf.fr.detail.send.uri', $app,
$form), '.'))}/{$app}/{$form}/{$document}"
         method="post" ref="if
(instance('fr-workflow-confirmation-instance') != '') then
instance('fr-workflow-confirmation-instance') else
xxforms:instance('fr-form-instance')"
         replace="all" xxforms:ensure-uploads="false"/>

This should work for me, I just wish it was configurable instead of
having to go modify the code.

> Does this make sense? Does it fit your use case?
>
> Alex
>
> On Thu, Nov 18, 2010 at 4:59 PM, Arlo White<[hidden email]>  wrote:
>> Using: Orbeon Forms 3.8.0.201005141841 PE
>>
>> I've configured Orbeon to use a REST persistence layer. I've been doing some
>> testing with a servlet, which responds with a bit of HTML to PUTs and POSTs.
>>
>> At my REST interface I want to be able to differentiate Saves from
>> Submits/Sends and know the AppName/FormName of the form. I also want the
>> user to see my HTML response. I'm having a lot of trouble configuring Orbeon
>> to fulfill these requirements.
>>
>> After filling out the form and clicking Review I get to the view page.
>> The first click of the Workflow Send button does a PUT to
>> /persist/data/crud/Foo/Bar2/data/4dbdfe569cbffb96dc39b713ca2b22e3/data.xml
>> However, I don't see the HTML being returned from the PUT request in the
>> browser. Orbeon doesn't show any kind of confirmation of submission. All the
>> browser displays is a swirl while the ajax call is in progress. It lets the
>> user click send again, which they shouldn't be able to do. The 2nd (and
>> later clicks) PUT to
>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml, which is
>> what I wanted originally. (To differentiate a Save from a Send) If I click
>> Edit and then Review again, the Workflow send button PUT goes to
>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
>>
>> When I specify an absolute send.uri
>> <property as="xs:anyURI" name="oxf.fr.detail.send.uri.*.*"
>> value="http://path/to/my/servlet"/>
>> It does a POST and I see the HTML response in the browser. However, now I
>> have no way of know what app/form did the submit, so it's pretty useless.
>>
>> If I use the submit button there's no way of differentiating save clicks
>> from submit clicks since they both go to the same PUT url.
>>
>> If I'm editing a form: /orbeon/fr/Foo/Bar2/edit/1234
>> First Send: PUT /persist/data/crud/Foo/Bar2/data/1234/data.xml
>> Second Send: PUT
>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
>> The second send loses the document id (1234), so I know it's a final
>> submission but I no longer know the user was editing a particular document.
>>
>> How do I configure the workflow send button to accomplish this?
>>
>> --
>> Arlo White
>> Application Management / ITS
>> CalPoly, San Luis Obispo
>> [hidden email]
>>
>>
>> --
>> You receive this message as a subscriber of the [hidden email] mailing
>> list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>
>>
>
>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Workflow Send button behavior

Alessandro  Vernet
Administrator
Arlo,

Good point, and what you did seems reasonable. I can't include this
change on our code as it might break existing applications, but we
might pass those as request parameters. For now, I added an RFE:

http://forge.ow2.org/tracker/index.php?func=detail&aid=315659&group_id=168&atid=350207

Alex

On Tue, Nov 30, 2010 at 9:06 AM, Arlo White <[hidden email]> wrote:

> On 11/24/2010 06:52 PM, Alessandro Vernet wrote:
>>
>> Arlo,
>>
>> The idea of the workflow-send is that when you have a difference
>> between save and submit:
>>
>> 1. Save just calls the persistence layer.
>> 2. The persistence layer always does just a save; it doesn't implement
>> any submit/send logic.
>> 3. Submit or send (using workflow-send) saves, and posts the data to a
>> page you implement.
>> 4. You implement the submit/send logic in the page users get sent to
>> when they do a a submit/send. You receive the whole document there,
>> including the UUID, so you can update in the database if you want to
>> mark it somehow as submitted. In that page, you can also generate HTML
>> as appropriate to give some feedback to users, or redirect them to
>> another page.
>
> I didn't see the App name, Form name, or document id in the POST body.
>
> I ended up unzipping orbeon-form-runner.jar, modifying persistence-model.xml
> and adding app/form/document to the resource url:
>
> <xforms:submission id="fr-workflow-confirmation-submission"
>        resource="{xxforms:property(string-join(('oxf.fr.detail.send.uri',
> $app, $form), '.'))}/{$app}/{$form}/{$document}"
>        method="post" ref="if (instance('fr-workflow-confirmation-instance')
> != '') then instance('fr-workflow-confirmation-instance') else
> xxforms:instance('fr-form-instance')"
>        replace="all" xxforms:ensure-uploads="false"/>
>
> This should work for me, I just wish it was configurable instead of having
> to go modify the code.
>>
>> Does this make sense? Does it fit your use case?
>>
>> Alex
>>
>> On Thu, Nov 18, 2010 at 4:59 PM, Arlo White<[hidden email]>  wrote:
>>>
>>> Using: Orbeon Forms 3.8.0.201005141841 PE
>>>
>>> I've configured Orbeon to use a REST persistence layer. I've been doing
>>> some
>>> testing with a servlet, which responds with a bit of HTML to PUTs and
>>> POSTs.
>>>
>>> At my REST interface I want to be able to differentiate Saves from
>>> Submits/Sends and know the AppName/FormName of the form. I also want the
>>> user to see my HTML response. I'm having a lot of trouble configuring
>>> Orbeon
>>> to fulfill these requirements.
>>>
>>> After filling out the form and clicking Review I get to the view page.
>>> The first click of the Workflow Send button does a PUT to
>>>
>>> /persist/data/crud/Foo/Bar2/data/4dbdfe569cbffb96dc39b713ca2b22e3/data.xml
>>> However, I don't see the HTML being returned from the PUT request in the
>>> browser. Orbeon doesn't show any kind of confirmation of submission. All
>>> the
>>> browser displays is a swirl while the ajax call is in progress. It lets
>>> the
>>> user click send again, which they shouldn't be able to do. The 2nd (and
>>> later clicks) PUT to
>>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml, which is
>>> what I wanted originally. (To differentiate a Save from a Send) If I
>>> click
>>> Edit and then Review again, the Workflow send button PUT goes to
>>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
>>>
>>> When I specify an absolute send.uri
>>> <property as="xs:anyURI" name="oxf.fr.detail.send.uri.*.*"
>>> value="http://path/to/my/servlet"/>
>>> It does a POST and I see the HTML response in the browser. However, now I
>>> have no way of know what app/form did the submit, so it's pretty useless.
>>>
>>> If I use the submit button there's no way of differentiating save clicks
>>> from submit clicks since they both go to the same PUT url.
>>>
>>> If I'm editing a form: /orbeon/fr/Foo/Bar2/edit/1234
>>> First Send: PUT /persist/data/crud/Foo/Bar2/data/1234/data.xml
>>> Second Send: PUT
>>> /persist/data/crud/Foo/Bar2/data/My-Confirmation-Page/data.xml
>>> The second send loses the document id (1234), so I know it's a final
>>> submission but I no longer know the user was editing a particular
>>> document.
>>>
>>> How do I configure the workflow send button to accomplish this?
>>>
>>> --
>>> Arlo White
>>> Application Management / ITS
>>> CalPoly, San Luis Obispo
>>> [hidden email]
>>>
>>>
>>> --
>>> You receive this message as a subscriber of the [hidden email] mailing
>>> list.
>>> To unsubscribe: mailto:[hidden email]
>>> For general help: mailto:[hidden email]?subject=help
>>> OW2 mailing lists service home page: http://www.ow2.org/wws
>>>
>>>
>>
>>
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing
> list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
Orbeon Forms - Web forms, open-source, for the Enterprise -
http://www.orbeon.com/
My Twitter: http://twitter.com/avernet


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
OW2 mailing lists service home page: http://www.ow2.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet