Purchase Order

LiveCycle ES2 Product Sample

Overview of the sample
Prerequisites for the sample
Files needed for the sample
Deploying the sample

Configuring the sample
Running the sample
Next steps
Legal disclaimer

Overview of the sample

 

This sample is a simple purchase order application simulating the process of putting an order. The focus of this sample is to demonstrate the development experience with the new developing tools with LiveCycle ES2. These developing tools intend to provide typical approach of model-driven development.  The sample shows how to use model-driven development by using Data Model, Guide, and Forms. By creating the Data Model, developers can easily generate Guides and Forms as input and output to collect and present data.

The process starts by creating a data model to map the purchase order and customer entities. The sample then walks through building a Guide based on the model for collecting data with vivid user experience. Next, create a form and process based on that model for showing and processing the data of the model. Hence user can get a general idea of how these tools can work together to ease the development work.

The following modules are used in this sample:

Prerequisites for the sample

Deploy and run the Sample Setup Utility.

Files needed for the sample

Filename
Description
Adobe-Samples-Application-PurchaseOrder.lca The LiveCycle ES2 archive used for deploying the sample

Deploying the sample

Tip: To deploy multiple samples, use the Samples Deploy Utility.

  1. Log in to LiveCycle Administration Console (http://hostname:port/adminui).
  2. Click Services > Applications and Services > Application Management.
  3. Click the LiveCycle Applications(9.x) tab and click Import.
  4. Click Browse to locate the sample LiveCycle ES2 archive (LCA) file Adobe-Samples-Application-PurchaseOrder.lca, and then click Preview.
  5. Select Deploy assets to runtime when import is complete and click Import.

Configuring the sample

Note: Before configuring and running this sample, it is necessary to deploy and run the Sample Setup Utility.

Configure Email Service

  1. Log in to Workbench ES2.
  2. Select Window > Show View > Components to open Components View.
  3. In the Components View, select Components > Email > Active Services > EmailService:1.0. Right-click EmailService:1.0 and select Edit Service Configuration.
  4. Set following fields according to your actual email SMTP server and POP server.

    SMTP Host
    : The hostname or IP address of the SMTP server
    SMTP Port Number: SMTP server port number, 25 by default
    SMTP Authenticate: Whether your SMTP server requires authentication
    SMTP User: User name used for sending email
    SMTP Password: Password of above user
    SMTP Transport Security: default is None (also depends on the setting of your email server)
    POP3/IMAP Host: the URL or IP address of the POP3 server
    POP3/IMAP Port Number: 110 (also depends on the setting of your email server)
    POP3/IMAP User: the email address of the sender
    POP3/IMAP Password: the sender's password
    POP3/IMAP: default is pop3 (also depends on the setting of your email server)
    Receive Transport Security: default is None (also depends on the setting of your email server)  

  5. Click OK.

Configure the service

One process in this sample is referenced by the data model via web service interface; therefore the next step is to configure that service after deployment.

  1. Log in to Workbench ES2.
  2. If Samples - Purchase Order does not show in the Applications view, click File > Get Application.... Choose Samples - Purchase Order > Samples - Purchase Order /1.0 from the application list to import the application to the Workbench.
  3. In the Applications View, click Samples - Purchase Order > Samples - Purchase Order /1.0 > DataModels > OrderDataModel.
  4. To check out the data model, right-click OrderDataModel and select Check Out and, to edit the process, right-click OrderDataModel again and select Open. Workbench switches to Data Model perspective. Alternatively, select Window > Open Perspective > Data Model to open it.
  5. Select Window > Show View > Services to open Services View.
  6. Select Window > Show View > Properties to open Properties View.
  7. In the Services view, there is a service named Products. Click the Products service, and the properties of this service shows in the Properties view.
  8. In the Properties view select the Annotations tab and select ActionScriptGeneration in the annotation group. Double-click the value of item WSDL to edit it, change the placeholder [lcserverhost:8080] to the actual hostname and port number where the sample is deployed.
  9. To save the changes, select File > Save.
  10. For the updated data model to take effect in form, double-click the Samples - Purchase Order > Samples - Purchase Order /1.0 > Forms > ShoppingForm. LiveCycle Designer prompts that the data model has changed and requires update. Select Yes to update it and then save the form.
  11. To make the updated data model take effect in Guide, double-click the Samples - Purchase Order > Samples - Purchase Order /1.0 > Guides > ShoppingGuide. In the DataModel view, right-click and in the pop-up menu select Refresh Model and then save the guide. If the perspective is not automatically switched to Guide Perspective in Workbench, click main menu Window > Open Perspective... Select Guide Design to open Guide Design perspective.

    Refresh Model menu graphic


    Troubleshooting: If starting this process in Workspace failed:

  12. In the Applications View, click Samples - Purchase Order > Samples - Purchase Order /1.0, right-click Purchase Order/1.0 and select Check In. Right-click Purchase Order /1.0 and select Deploy.

Running the sample

Place an Order

  1. Log in to Workspace ES2 (http://hostname:port/workspace/) using the following credentials: [User = atanaka, Password = password].
  2. Click Start Process > Samples > PurchaseOrder-startpoint. The Flex style Guide form loads.
  3. Select product from the drop-down list and change the quantity, notice the description, unit price, and amount have changed accordingly. Click Next.
  4. In the second section, fill in the customer information. Those fields with marked with "*" marks are required fields. Provide a valid email address in this form.
  5. To use a different address for delivery, check the checkbox Shipping Address is different and select Next and a new section shows. Otherwise click Complete button.
  6. If you chose to use a different address, fill out the deliver information which is similar with the customer information. Then click the Complete button to submit.

Confirm the Purchase Order

  1. Wait for a To Do task to appear in Workspace. Click To Do to open the To Do list.
  2. There is a task assigned with name Order Confirmation. Click to open it. A PDF form shows the purchase order information for confirmation.
  3. Ensure that the information is correct and click Confirm Order button.

Shipment Notice

  1. After confirming the purchase order, check email against the email account completed in step 4 in the Configure Email Server. There is a shipment notice email indicating that the items ordered have been delivered.
  2. Open the attachment in the email. It is a PDF file containing both the order information and the shipment information to notice that the product ordered is delivered.

Troubleshooting: If no email is received:

Next steps

After running this sample, open the application and learn about how the Data Model, the Guide, and the process are developed and how they work together. Try modifying the model to bind with database or change the service to call remote web service.

The development process of this sample is as following:

Create the Data Model

The Data Model, DataModels [OrderDataModel], is the domain model to hold the data structure for the application. It was created at the very beginning. You can create entities and their properties by drag-and-drop using an intuitive GUI interface. The Data Model reflects the relationship between the entities used in the application. You can see that PurchaseOrder is the root object and it has Product, Customer and Order aggregated to it.

Purchase order sample

This Data Model is the base of other steps in this sample, it maps to the 'Model' of well-known MVC pattern. Data Model in LiveCycle ES2 intends to be used with back-end database to abstract the access to database data. See the Data Model document for more information.

Create the process

The process 'Processes\Products' is the one that aims to simulate the web service to get product information from back-end database or some other data source. It takes product name and quantity as input parameter, and returns the result with the product description and unit price of the product. For example, when user selects "Adobe Acrobat 9 Classroom in a Book", the service queries the database and returns the description and the unit price.

This process then was mapped to a service in the Data Model created above. To create a service "Product", import the process 'Processes\Products' in DataModel perspective, service view. This service is used in The Guide below uses this service.

Service Product

Create the Guide and Form

The Guide and Form act as Views in the MVC pattern. They are the interface for collecting and presenting data of the model. In ES2, it is easy to bind Guide/Form with Data Model. When creating a Guide or form, specify the Data Model to bind with it. Then the entities in the model are available to be put in the Guide/Form as fields. A benefit of using Data Model with Guide is the ability to define constraints and value expression in model rather than the Guide. Resulting in less repeating of the constraint or value calculation when using multiple Guides.

Legal disclaimer

Any references to company names, company logos and user names in sample material or sample forms included in this documentation and/or software are for demonstration purposes only and are not intended to refer to any actual organization or persons.

LiveCycle ES2 Product Sample - Purchase Order - 02/11/2011 4:46 PM
LiveCycle ES2 (9.0.0.2) - September 2010

[an error occurred while processing this directive]