Highlighted

How to insert form back into a process

kc

15-05-2008

Hi all,



I have a question which deals with reinserting a form into a process invocation.



I have a process where I need to send a form to a user by email. My problem is then to get the form back into my workflow by using the process fields (Submit button). I know I could use a "Receive Mail" service - however I believe that I have once seen a solution where the form could be directly injected back into the process (at the right step), I just can't remember where I have seen it.



So my question is, how can I "reinsert" or submit a form in the middle of a process.



Thanks in advance



Kim Christensen

Replies

Highlighted

Jasmin_Charbonn

15-05-2008

You need to set up an email endpoint to the CompleteTask operation from Process Management.



The complete task will complete the task associated to your task id and therefore will move the item to the next step in your workflow.



Jasmin
Highlighted

kc

16-05-2008

Hi Jasmin,



Thanks for the advice - this seems to be a good solution. I am just wondering how I can distinguish between different instances of the process. I mean - there will come a lot of emails (from the individual instances) to this email endpoint and I need the process only to continue when a mail with the right/correct form is sent back. Is there a mechanism for handling this or do I need to create some kind of unique id for the form/email myself?



If the latter is the case, do you have any hints to how this can be done in a clever manner?



Sincerely

Kim Christensen
Highlighted

Jasmin_Charbonn

16-05-2008

You obviously need the task id somehow to complete the right task. You could have it stored in a hidden field.



If you use the process field, I believe there is one for TaskID. Then you can use ExportFormData to extract the data and see if the TaskIDfield is populated. If it is, then complete, otherwise don't.



Jasmin
Highlighted

kc

16-05-2008

Yes it was something like this I thought of. However it seems a little bit unclever that I need to check the mailbox, fetch the mail, get the attachment and check whether the TaskID is set. I mean - in the most cases I will only find that it is the wrong TaskI and then I should leave the email on the server to be checked again later.



Is is at all possible to remove emails from a server with an email endpoint setup?



Sincerely

Kim Christensen
Highlighted

Jasmin_Charbonn

16-05-2008

The process where you define your email endpoint will grad the emails from that Inbox.



Whether your complete the task or not is up to you. As far as LiveCycle is concerned, it picked up the mail from the mailbox and initiated the process.



So the emails will be removed from the mailbox as soon as the process initiates. It doesn't really matter what you do in your process.



Jasmin
Highlighted

kc

18-05-2008

OK - I think I get it know - but I guess that I need to add the form/or the xml from the form as output to the Complete Task service (to make sure I caqn handle the submitted data from the person that have sent the email.



By the way how can I check out the processes ProcessEmailMapSubmit (the first one in Complete Task), StartProcess, and Complete Task?



Sincerely

Kim Christensen
Highlighted

kc

18-05-2008

And then again - now I am not sop sure I understand it anyways.



Let me sketch what I have understood:



I have my process which at a certain point sends out an email with the form to be filled. Now I am not sure which service should follow this sendEmail? The form to be filled will not be viewed in Workspace before I send the email, so I am also a little bit uncertain which TaskID I should put in my hidden field in the form? In other words I see that the Complete Task service takes the value of the process fields (taskID, processName and so on), however I am not sure how my own process should be built to make use of the Complete Task service.



Sincerely

Kim Christensen
Highlighted

Jasmin_Charbonn

20-05-2008

How about if you create a new process that gets started when you receive a new email?



You could create an email endpoint to that process and the first step would be a user step.



You can't call the Complete Task service if there is no task (user step) to complete.



Could that be a workaround?



Jasmin
Highlighted

kc

20-05-2008

Yes - that is an excellent idea. Thanks alot 🐵



Just out of curiosity - if I were to use the Complete Task - what are my options to get the form sent to the user?



I mean - I can understand how it works if you click the "Take form offline" button (and then later submits it to the Complete Task Email endpoint), but how could I automatically have sent the form by email (with TaskID) and still got it back in the workflow?



Once again, thanks for your help.



Sincerely

Kim Christensen