14 Replies Latest reply on Apr 3, 2008 5:02 AM by HowardTreisman

    Custom Render service question

      This is kind of related to the post at "http://www.adobeforums.com/webx/.3bc480d1/9".

      Would like to find out how to use a custom Render service to populate some fields on the form, at the "Initiator" step of a workflow app.

      In the Form Augumenter, there's "Get Field Value" service, but there's no "Set Field Value".

      There's a "Insert Workflow XFO" service, but it seems that it can only set those "AWS_xxxx" fields.

      How do I set a field value (to non AWS_ field) in a custom Render?
      (at the "Initiator" step of a workflow application of course)

      I know that I can make a WebService call from the Form to populate fields on the form, but it seems neater to do the field population in the custom Render (if it's feasible).

      thanks
      James
        • 1. Re: Custom Render service question
          Jasmin Charbonneau Level 4
          You get your information from where ever it's located. Then add it to the XML that gets merged with the form template on the RenderPDFForm and let Forms merge the data with the template before it's being served up.

          Jasmin
          • 2. Re: Custom Render service question
            Level 1
            Yes. It's the part "add it to the XML" I need help with.

            the XML, is it the "inDocData" variable in the RenderPDFForm?
            how do I add my data to it?

            thanks
            • 3. Re: Custom Render service question
              Jasmin Charbonneau Level 4
              Use a setValue to put the document variable into a XML variable, then use xPath to manipulate the XML and put it back into the document variable.

              Jasmin
              • 4. Re: Custom Render service question
                Level 1
                Works! Thanks Jasmin!
                • 5. Re: Custom Render service question
                  hi
                  i was trying to do something similar but found out something weird.

                  Objective too is to prepopulate the PDF form with information at the Initiator stage.

                  However I found out that under the workspace tracking section, the submitted data wasn't displayed/loaded inside the loaded initiator stage PDF form. Only the prepopulated data is displayed.

                  Does this happen on your side?
                  Any idea why?

                  Actually how does the tracking section's loading of PDF work?

                  Thanks
                  • 6. Re: Custom Render service question
                    Leia, we also encountered the same issue with Workspace Tracking section when we use our custom PDF render service (customised from Default Render service) to prepopulate PDF form. The prepopulated data is displayed instead of the submitted data

                    We realized a few things which cause this issue:
                    1. Our custom PDF render service will be invoked when we view the submitted PDF form in Workspace Tracking section.
                    2. In our custom PDF render service, we use a SetValue component which always replace the 'dataDoc' input variable with a new constructed xml document which contains prepopulated data.

                    Anyone can advice on how to solve this issue?
                    • 7. Re: Custom Render service question
                      Level 1
                      may be you can put a flag in the render service to indicate if the form is being opened from the tracking section of the workspace or not. I think when a form is opened from the tracking section, the taskID is null. you can then check for this taskID in render operation and render accordingly. I have not tried doing this,but well worth a try
                      • 8. Re: Custom Render service question
                        Level 1
                        Instead of using the TaskID as the 'flag', I'd like to use the data in a field on the form as the flag...

                        the form data is in the "inDoc..." input variable of the Render Service, is it not?

                        I tried to check the inDoc, but can't get it to work. Could you shed some lights on this?

                        thanks
                        • 9. Re: Custom Render service question
                          Jasmin Charbonneau Level 4
                          When you configure the variable to use a render service you can pass it the Task->Form Data, which would contains the data from the sumitted form.

                          You could use xPath within the render service to check for your flag.

                          Jasmin
                          • 10. Re: Custom Render service question
                            Level 1
                            What variable type should I use for that input parameter? "Document" or "xml" or? I am not able to use XPath to drill down to my field in a Document...

                            I must be doing something wrong, can I send you my LCA to check?

                            thanks
                            • 11. Re: Custom Render service question
                              Jasmin Charbonneau Level 4
                              It gives you a document. In your render service you can put the document content into an xml variable with a SetValue (process_data\myXML = process_data\myDoc) and then use xPath.

                              Jasmin
                              • 12. Re: Custom Render service question
                                Level 1
                                it's still not working (using the above SetValue operation)...

                                do you or anyone has a Render Service that does similar type of things? if you do, could you please send your LCA file to jdee66888@gmail.com ? maybe by looking at your LCA I could figure out what have I done wrong... TIA.

                                ---
                                on a related subject:
                                I don't quite understand how the "SetValue" in the previous post works? I mean myDoc and myXML are of different variable types, how does SetValue handle the assignment of two different types of things? Is it documented somewhere?

                                I have tried the SetValue in the reverse direction, i.e. myDoc = myXML and that seemed to put the data in the xml into myDoc alright, although I don't understand how does it do that and why it works either.
                                • 13. Re: Custom Render service question
                                  Level 1
                                  WorkflowUser found the solution for fadly's question, and I have verified it:

                                  use "Task Status ID" as the Flag,
                                  when it's not 1, don't do that setValue/PrePopulation; and it will be fine in the Tracking.

                                  Thanks WorkflowUser.
                                  • 14. Re: Custom Render service question
                                    HowardTreisman Level 1
                                    Answering James's question about converting types...
                                    Livecycle has a concept of coercion. This is similar to the way javascript and many other interpretive languages work with different types of data. Basically, if you assign a variable of one type to a variable of another type, LiveCycle will do it's best to coerce the variable to the new form.

                                    So, for example, if you assign an int to a long, it will just work. And if you assign an int to a string, you'll get a string containing a representation of the int.

                                    If you assign a Document to an XML variable, if the document actually contained valid XML, then you'll end up with an XML document. If it doesn't contain valid XML, then I think you'll get an exception.

                                    Some coercions just don't work - for example, a list to a doc just doesn't make sense.

                                    Hope this helps...
                                    Howard
                                    http://www.avoka.com