Expand my Community achievements bar.

Issues with Setting up an Email Endpoint

Avatar

Level 2

Hi,

I am trying to setup an email endpoint for a process that I have tested successfully using Workspace. I have added a button to the PDF form that would send an email that would trigger the process using the email endpoint. I have reviewed the other relevant discussions in the forums but still there are few things that arent clear in my head.

1.      While testing the form and process using Workspace, I had created an xfaForm variable that would be the input from the first activity that invokes the process using Workspace. Now when I am trying to acheive the same with email enpoint the input is no longer an xfaForm right?

2.      I noticed in previous discussions that there was a reference to creating a document variable and assigning that to the document input. While submitting the form to the email address used by the endpoint, should I configure it to send the attachment as PDF or as XDP? i.e. should the document variable be set to a PDF or a XDP file?

3.     The Input Parameter Mappings have two entries:
     a. MyFormDocument - What should this be set to depending o
n if I have to attach a PDF or a XDP file as an input as it seems to be a required field?. Curently I have it set to Variable - "*'*"
     b. document - How is it different from the MyFormDocument input parameter and what should it be set to?


I am running out of ideas, so any help would be appreciated.

Thanks,
Varma

7 Replies

Avatar

Level 10

"1.      While testing the form and process using Workspace, I had created an xfaForm variable that would be the input from the first activity that invokes the process using Workspace. Now when I am trying to acheive the same with email enpoint the input is no longer an xfaForm right?"

Right.

"2.      I noticed in previous discussions that there was a reference to creating a document variable and assigning that to the document input. While submitting the form to the email address used by the endpoint, should I configure it to send the attachment as PDF or as XDP? i.e. should the document variable be set to a PDF or a XDP file?"

I doesn't really matter. The document variable can contain pretty much anything. It depends what you want to do. If  you're just interested in the data, then just send the XDP. It easier to inspect the data and manipulate it since it' just XML.

If you submit the entire PDF, the email will be bigger, but you won't have to recreate the PDF server side. You will have to extract the data if you want to get to it. You also need the entire PDF if you're planning on using digital signature.

"3.     The Input Parameter Mappings have two entries:
     a. MyFormDocument - What should this be set to depending on if I have to attach a PDF or a XDP file as an input as it seems to be a required field?. Curently I have it set to Variable - "*'*"

     b. document - How is it different from the MyFormDocument input parameter and what should it be set to?"

Is MyFormDocument an input DocumentForm variable so you can use Workspace to initiate? I wouldn't suggest to use a Task Manager (Workspace) and email endpoint on the same process for that very reason. You can't set the Document Form variable properly from an email endpoint.

What you can do is create a separate process that has only one input document variable. Create the email endpoint on that process. Set the input document to variable -> *.*

Then call your Workspace process as a subprocess from that new process. That way you can use a setValue and set the Document Form input  variable expected by your Workspace process.

Jasmin

Avatar

Level 2

Jasmin,

Thanks for your response. Yes, MyFormDocument is the variable (xfaform) that I have set as the input for the process when I was using workspace to test my process. I have updated the MyFormDocument variable to no longer have it as an input and now have a document variable that holds the input passed in by the email endpoint. When I try to submit the filled out PDF form to the email endpoint, the process is invoked but the form data that was filled while submitting the form to the email endpoint is not carried to the assigned user task. I am guessing it is because the xfaform variable is still bound by the form template that I had configured it for and therefore starts of with that empty form template rather than with the data that was submitted to the email end point. How do we get the data from the PDF that was submitted to the email endpoint into the xfaform variable that would get set if we use Workspace?

Since trying to pass the data to the xfaform wasnt working when I was doing it within the same process, I tried your suggestion to create a separate process that would have the email endpoint and would take the PDF as an input and assign it to the document variable. And I am also invoking my orginial process from within this new process and setting the MyFormDocument (xfaform) input variable to the document variable that was set earlier from the email endpoint. Now did I follow your suggestion correctly? because I sitll get the "Cannot coerce object" error in the server log when I try to set the document variable as an input to invoking the process that expects an xfaform variable. Let me know if I did anything wrong here?

I was under the assumption that it was required to have an xfaform variable within the process to bind it against the form. Is my assumption correct or can we use store the data within the document variable and retrieve from it? What is the typical approach for storing the form data within a process?

Thanks,
Varma

Avatar

Level 10

"I am guessing it is because the xfaform variable is still bound by the form template that I had configured it for and therefore starts of with that empty form template rather than with the data that was submitted to the email end point"

That's correct. The form referenced in the xfaForm variable is going to be loaded and it will call the render service to render it. Now if you look at the properties of the render service, one of the parameter that is passes is Form Data. You can set that parameter to the variable that contains the data, which would be your input variable.

"How do we get the data from the PDF that was submitted to the email endpoint into the xfaform variable that would get set if we use Workspace?"

You can change the Form Data parameter of the render service, but then all the users step will populate with the same data. If you have multiple users what you can do instead is set the data node of the xfaForm variable using xPath. Something like

/process_data/myXmlData = /process_data/@myinputDoc (You might have to put the document content into xml))

/process_data/myXFAForm/object/data/ = /process_data/myXmlData (Assign that XMl to the data node of the xfaForm variable)

"...and setting the MyFormDocument (xfaform) input variable to the document variable that was set earlier from the email endpoint"

If your process expects an xfaForm variable, you need to provide it a xfaForm variable. You can't just give it a document varibale with data because you'll get the coercion error. That's why I was suggesting to have a setValue before calling the subprocess to set that xfaForm variable properly.

If you're not planning to initiate from WorkSpace, then I would stick with the first technique which is to have only one input variable of type document.

Jasmin

Avatar

Level 2

Jasmin,

Based on your response I tried to do the following as you had suggested

"Set the data node of the xfaForm variable using xPath. Something like

          /process_data/myXmlData = /process_data/@myinputDoc (You might have to put the document content into xml))

          /process_data/myXFAForm/object/data/ = /process_data/myXmlData (Assign that XMl to the data node of the xfaForm variable)"

       By doing this I am able to acheive the initial objective to send the form information that was filled in during the first step to send the PDF to the email attachment to trigger the process. But the information being fed by the subsequent users in the process is not being updated in the PDF. It looks like xfaform is still using the data that is being set during the serValue operation.

Here is a breakdown of the operational scenario

1. A user fills in some part of the PDF form and clicks submit, which triggers the email endpoint and starts the process

2. Assigned user 1 recieves the PDF in his email and has the information that was filled in step 1 (because we had used XPath to set the data into the xfaform variable). User 1 adds more information to the form and completes the task via email.

3. Assigned user 2 the process gets the PDF in his email but the form only has data that was filled in step 1 and doesnt contain the data that was filled in step 2. How do I udpate the xfaform variable so that it gets updated with the data from step 1 and continues to add data that will be filled by assigned users in steps 2 & 3.

I am kinda stuck here so any help would be appreciated.

Thanks,
Varma

Avatar

Level 10

OK. I think we need to take a step back. I though you want to send the email in to kick a process, but it looks like you want to create a full email based process.

Do you know you can use the built-in email notifications  to send an email to the user that the task is going to. Then you can setup an email endpoint to the CompleteTask service, and it'll take care of completing the task and push the item to the second user step. This might simplify the user case. You can have all you user step in a sequence and not worry about starting your process from the beginning (from the email endpoint).

Maybe it would be worthwile spending some time talking about the use case you're trying to acheive to see if we're going down the right direction.

Going back to your implementation.

Does user 1 sends the email back to the same process. How do you define who's user 2? Does you process just contain a setValue and a user step and you always call it and dynamically assign who performs the user step?

I'm just a bit confuse on how your process is implemented.

Let me know.

Jasmin

Avatar

Level 2

Jasmin,

Sorry that I ended up confusing you with my process description, Yes I am trying to setup a LiveCycle process where user's will be using email to access and complete their tasks and are not expected to be logging in to Workspace. Here are the steps that would describe the process that I am trying to setup

  1. Users can initiate the business process by accessing the form PDF that is available on a shared network drive accesible to all the users. I have a "Send Email" button on the form that would mail the form as an attachment to a separate email address that I am using for the email endpoint for the process that would get triggered once an end user fills out certain fields in the form and submits it to the preset email address.
  2. Once the process is invoked, the first operation is a setValue where I get the data from the PDF that was submitted and set it to the variables and this was the step where I updated the xfaform variable as you had suggested.
  3. The next step is to route the updated PDF to the first assigned user (User 1) in the process and since the notifications are already configured, the task is sent to User 1's email address. User 1 opens the PDF attachment and adds more data into the form and clicks on the Submit button (part of the Process Fields) that would open up an email with the XDP attachment to the email address configured for the Complete Task service.
  4. The CompleteTask service endpoint would complete the task for User1 and route it to the next assigned user in the process (User 2)
  5. User 2 would open the PDF similar to the User 1 from his email and would add more data in the form and complete the task by clicking on Submit button in the PDF and using the CompleteTask service endpoint.

Hope this makes sense now. I am using two email endpoints - one to invoke the process from an end user who send an email by clicking on the "Send Email" button and one endpoint for the CompleteTask service so that users can complete the tasks from their inbox.

As I mentioned earlier the issue I am facing with now is by setting the value of xfaform as you have suggested, the form data that gets routed to User 1 has the information filled in by the end user, but the data filled in by User 1 and User 2 is not being set into the xfaform.

Let me konw if I am appoaching this the right way or if I am mising the plot here.

Thanks,
Varma

Avatar

Level 2

Jasmin,

I have resolved the issue by doing the following

  1. I am sending the PDF as an E-Mail attachment to initiate the process and assigning it to a document variable using the email endpoint.
  2. Within my process, the first operation is an export data operation that takes the document variable from step 1 as an input and outputs the data into an xml variable.
  3. I am setting the xfaform fields for the data filled in using the xml document variable created in step 2.

Thanks for your help.

Varma