Skip navigation
Currently Being Moderated

Script use of patExecContext()

Feb 16, 2006 7:03 AM

I'm attempting to use patExecContext.getProcessDataDocumentValue() in a script. The input argument I'm using is simply the root node of the init_form. This method is returning null, so I assume I have the argument wrong.

What should the input arg look like to return the entire input Document?
 
Replies
  • Currently Being Moderated
    Feb 16, 2006 8:12 PM   in reply to (Bill_Mulert)
    Hi
    Can you post the exact code you're using - it's a little hard to visualize your code from your description.

    Howard
    http://www.avoka.com
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 19, 2006 1:25 PM   in reply to (Bill_Mulert)
    Hi Bill
    getProcessDataDocumentValue only works on a Document type of variable. It looks like your "inputform" variable is of type "form", so this is never going work. Also, you need to prefix all process variables with "/process_data/" i.e. "/process_data/inputform/form-data/..." Non XML variables require an additional ampersand i.e. "/process_data/@myint".

    I'm pretty sure that if you call getProcessDataValue(/process_data/inputform/form-data/data/xdp/datase ts/data/purchaseOrder") you'll get a DOM node, and from there you should be able to navigate through the rest of the document. (I don't have the environment set up on my current machine to validate this - let me know if you have problems.)

    Good luck...

    Howard Treisman
    http://www.avoka.com
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 6, 2006 11:23 PM   in reply to (Bill_Mulert)
    Hi all,

    I have add these code in script component ,and when I test the code ,it can't print anything out.Could someone tell me why?

    String teststr = patExecContext.getProcessDataStringValue("/process_data/@status");
    print("aa");

    Thanks a lot!
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 6, 2006 11:26 PM   in reply to (Bill_Mulert)
    print() isn't a valid java command. Try System.out.println(...);

    One of the advantages of building a custom QPAC rather than using the Script QPAC is you get to compile it, which finds errors like this :-)

    Howard
    http://www.avoka.com
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 7, 2006 6:08 PM   in reply to (Bill_Mulert)
    Hi Howard,

    Thanks for your answer.But I have tested that "print" can work and I found that the method "getProcessDataStringValue" in my code can not work.If I add the first line ,nothing printed out and If I commented it, "aa" was printed.

    So ,Could anyone tell me how to make "getProcessDataStringValue" work?
     
    |
    Mark as:
  • Currently Being Moderated
    Mar 7, 2006 7:21 PM   in reply to (Bill_Mulert)
    Woops, sorry. I wasn't aware of print(). As you can see, I'm not an expert on the Script qpac :-)
    One problem you might have is that @status is an integer, and you're trying to get it as a string. I would hope that the script qpac would cast it for you, but maybe not. Perhaps try getProcessIntValue()?

    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 19, 2006 1:40 PM   in reply to (Bill_Mulert)
    Is it possible to use patExecContext.getProcessDataStringValue() in a script QPAC to read the value from a form field? My form has a schema, so the call would look similar to this:

    import com.adobe.workflow.pat.service.*;
    import com.adobe.idp.Document;

    System.out.println("Begin");
    System.out.println("MyField: " +
    patExecContext.getProcessDataStringValue("/process_data/formvar/form-d ata/data/xdp/datasets/data/root/UserInfo/txtName"));
    System.out.println("End");

    I have tried many combinations but cannot get it to work. Do I have to get the org.w3c.doc.Element and traverse the DOM to get my value?

    Thanks
    Tom
     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2006 2:54 PM   in reply to (Bill_Mulert)
    That looks like it should work.
    Try the same expression in the SetValue QPAC, making sure that the expression is correct and that the element has a value. You can use the VariableLogger QPAC (http://www.avoka.com/avoka/qpac_library.shtml) to verify that you're getting the value you expect.
    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2007 7:38 AM   in reply to (Bill_Mulert)
    What about
    void setProcessDataListValue(java.lang.String aPathLocation, java.util.List aVal) method ?

    Can I set a repeating section value in the form by using that method. I thought to give the path location of the repeating field like :

    /process_data/form/form-data/data/xdp/datasets/data/SATalepFormu/Detay liAciklama/UrunBilgileri

    and created an example List object like

    ArrayList alist=new ArrayList();
    alist.add("first");
    alist.add("second");
    etc..

    but I get ClassCastException error. List is an interface and extended by the ArrayList class. Why do I get this ? Isn't it possible to set repeating section values ?
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 9, 2007 6:24 PM   in reply to (Bill_Mulert)
    Hi Guvenc

    LiveCycle 7.2 introduced the concept of Lists and Maps. These are separate types of variables to repeating sections within the XML of a form. It would be nice if you could use them interchangably, but you can't.

    Setting repeating sections in a Form is quite difficult, requiring quite detailed knowledge of the internals of Form Variables. What is it that you're trying to achieve, there might be an easier way to do it?

    Setting a repeating section in an XML variable is a little easier, but you still basically need to get an org.w3c.Document object, and manipulate it using the Document apis. Fiddly.

    Let me know what you're tyring to achieve, I let you know if I can think of a simple way of doing it.

    Regards,
    Howard
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 11, 2007 11:04 PM   in reply to (Bill_Mulert)
    I am just trying to set the repeating fields in my form. Acrobat Reader does not let using web services(requires reader extensions) so I try to find alternative ways of importing data into my form. I can set some fields by using setProcessDataStringValue method. I just wonder is there a method in the api to set repeating fields in the form.
     
    |
    Mark as:
  • Currently Being Moderated
    Feb 12, 2007 10:13 PM   in reply to (Bill_Mulert)
    Hi
    Where is the data coming from that you're trying to insert into the form? If it's coming from a SQL query, our SQLPlus qpac will correctly do this. If it's just some data you want to set, a special QPAC would probably be the best solution. We can talk about this separately if you want: htreisman-at-avoka.com

    Regards,
    Howard
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)