Archive for August, 2008

Execution contexts and LiveCycle ES processes

Recently, I’ve learned more about execution contexts for process services and thought it might be important enough to post here.

Execution contexts determine which user’s account credentials are used to execute a service. Recall that a service is created for all processes that are activated, and each operation in a process is also provided by a service. So, all processes and operations have an execution context.

A few changes were implemented in LiveCycle ES Update 1 (that’s version 8.2.1) that changed the way execution contexts work for processes. For both versions, the user that invokes the process is used as the invocation context for executing the process. The difference is in what invocation context is used for executing the operations in the process.

In LiveCycle ES (that’s version 8.0.x), the context that is used for process operations depends on whether the process is long-lived or short-lived:
• In short-lived processes, the context of the user who invoked the process is used to execute each operation in the process.
• In long-lived processes, the System user (similar to a super administrator) is used to execute each operation in the process.

In LiveCycle ES Update 1, you can use Adobe Administration Console to specify a user account to use for executing process operations. Also, the behavior is the same for long-lived and short-lived processes. There are three options for configuring this feature:
• Run-As Invoker (the default): The context of the user account that invoked the process is used to invoke the operations in the process.
• Run-As system: The System user executes the operations.
• Run-as named user: A user account that you specify is used to execute the operations.

To learn more about configuring this feature, read Modifying security settings in Applications and Services Administration Help.

Note that for both releases of LiveCycle ES, render and submit services that are used with xfaForm, Document Form, and Form variables are always executed using the System user account.

Why is this important?

For some services, the user account that executes the operation affects the results. For example, in Content Services ES, the user that stores content is made the owner of the content, which affects who can later access the content. If you are using a process to store content, you need to think about what user is used to execute the Document Management service, because that user will own the stored content.

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

Recent Tech Notes

A few new Tech Notes (or Knowledge Base articles) have been published lately for LiveCycle ES, Acrobat, and Adobe Reader. We thought we’d highlight them for you here:

Using the Web Services service to invoke LiveCycle ES services with document input and output values
Indirect submit buttons require static references to submit buttons in LiveCycle Workspace ES
Rendering a form as a static PDF does not produce the expected output for read-only buttons
Conflicting variable/property scenario causes incorrect behavior in Acrobat 7.x targeted forms
Navigating through form fields that are disabled generates a warning message
The selection mark that appears in a check box differs in interactive forms that are viewed in Acrobat 7.x and 8.1 (or later)
Data entered in the fields located on a master page is lost when the form is saved
Dynamic form scripts cannot reference PDF form objects in Acrobat 8.x
Data selected from a drop-down list is not saved when the clearItems method is used in the script
Cannot modify border color through a script in 3D buttons
Automatic validation not performed on all clicked form fields
Differences in events-order triggering by the xfa.host.openList method cause changes in form’s layout and behavior

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)

How to generate an XML schema for an existing form

Until recently, when I’ve been using LiveCycle ES to learn about developing processes I often found myself creating a form using Designer ES and manually creating an XML schema to embed in it. I want to embed the schema so that I can see the data model of the form in Workbench ES. Seeing the data model is useful when you are creating XPath expressions using XPath Builder to access a value from the form data.

My limited knowledge of XML schema enables me to create only the simplest of schemas, and consequently, the simplest of forms. However, I’ve now learned how to generate an XML schema for an existing form. This frees me from having to learn the intricacies of XML schema, and enables me to use more complex forms in my processes:

1. Create the form in Designer ES. If you are creating an XDP file, save it as a different file in PDF format.
2. Open the form in Acrobat Professional.
3. Save the form data to an XML file.
4. Use the file with a tool that derives XML schemas from XML documents.
5. Embed the schema in the form. (see Displaying the form data model in XPath Builder in LiveCycle Workbench ES Help.)

Here is a blog article that lists a few free tools that derive schemas from XML: http://blog.dotkam.com/2008/05/28/generate-xsd-from-xml/. I like using Trang, a command-line tool written in Java (you need to have a Java runtime environment (JRE) installed to run it). The blog also lists some GUI-based tools if you prefer those.

Further Considerations

You may be tempted to use the XML schema that you generate as the schema for a database to use to store form data. This would work, however this solution doesn’t scale well. If you develop several LiveCycle ES applications you will likely use many different forms to gather different sets of data. In this case, you should use a common schema for all forms.

It’s also important to realize that the process doesn’t need the XML schema to execute correctly. XPath expressions that locate form field data items are evaluated correctly regardless of whether the schema is present. You also don’t need to see the data model of the form in XPath builder to create XPath expressions. Seeing the data model makes it much easier.

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 3.7/10 (3 votes cast)