You are on page 1of 32

Mobile Collision Inspection Sample

Sybase Unwired Platform

Windows

DOCUMENT ID: DC00971-01-0100-01 LAST REVISED: November, 2008 Copyright 2008 by Sybase, Inc. This publication pertains to Sybase software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement. To order additional documents, U.S. and Canadian customers should call Customer Fulfillment at (800) 685-8225, fax (617) 229-9845. Customers in other countries with a U.S. license agreement may contact Customer Fulfillment via the above fax number. All other international customers should contact their Sybase subsidiary or local distributor. Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Sybase, Inc. Sybase trademarks can be viewed at the Sybase trademarks page. Sybase and the marks listed are trademarks of Sybase, Inc. indicates registration in the United States of America. Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. All other company and product names used herein may be trademarks or registered trademarks of their respective companies. Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies. Sybase, Inc., One Sybase Drive, Dublin, CA 94568

Contents
Context Summary...................................................................................................4 Usage Scenario.......................................................................................................5 Get Started..............................................................................................................6
Prerequisites............................................................................................................................6 Configuring your Environment for the Device Application Designer..............................6 Setting Up the Sample.............................................................................................................6 Starting the Sample Project.....................................................................................................7 Exploring the Database............................................................................................................9 Exploring MBOs.....................................................................................................................10 Mobile Business Objects.............................................................................................10 The Mobile Application Diagram..................................................................................11 Exploring the BlackBerry Application Interface Design..........................................................12 The Device Application Designer................................................................................12

Try It Out................................................................................................................14
Deploying the Sample MBOs to Unwired Server...................................................................14 Provisioning the Device with a Device Application.................................................................15 Running the BlackBerry Application.......................................................................................17 Starting the MobileInspec Application.........................................................................17 Working with Claims....................................................................................................18 Working with Customers..............................................................................................20 Working with Policies...................................................................................................22 Working with Payments...............................................................................................22 Synchronizing Data.....................................................................................................23

Learn More............................................................................................................27
Related Reference.................................................................................................................27 Project Artifact Reference............................................................................................27 Data Access Layer Reference.....................................................................................27 Device Application Architecture...................................................................................28 Coordinating Samples and Tutorials.......................................................................................29 Additional Information.............................................................................................................29 Getting Help...........................................................................................................................30

Mobile Collision Inspection Sample

iii

Context Summary

Context Summary
The SybInsure Mobile Collision Inspection sample application contains everything you need to explore Unwired Platform features. The Mobile Collision Inspection (MCI) sample is based on this development environment: Unwired WorkSpace for Eclipse BlackBerry device development

Use SybInsure Mobile Collision Inspection (MCI) to explore possible artifacts and their resulting applications, the development environment, the underlying components, and transactions that can occur between the underlying components. By using this sample, you will have a comprehensive preview of the benefits Unwired Platform can offer, without having to program an application yourself first. If you would like to learn how to use Unwired WorkSpace to create an application, please review the available tutorials created expressly for this purpose. Next Steps 1. Review the Usage Scenario on page 5. The scenario explores the business context and use case for the sample. 2. Follow the setup process in Get Started to install and prepare artifacts in the Eclipse edition of Unwired WorkSpace. 3. Test functionality and features as described in Try It Out on page 14.

Sybase Unwired Platform

Usage Scenario

Usage Scenario
SybInsure is an insurance company that supports collision inspectors by giving them a BlackBerry application that allows them to process collision reports remotely and therefore in a more timely fashion. Business requirements for SybInsure include: Reduced claim turnaround time by supporting remote reporting, SybInsure can decrease claim wait times and thereby offer superior customer support. Reduced response times offer a competitive advantage over to other insurance companies with bigger paper trails and use more formalized bureaucracies. Reduced maintenance and simplicity the BlackBerry application must easily deploy with little inspector intervention. The inspector user base is not tech-savvy and does not like to spend time troubleshooting or self-supporting. Bidirectional updates to enterprise data the information on the remote database must be current, and changes to the corporate repository must be seamless Secure transactions care must be taken to authenticate not only the inspector (via credentials stored on an LDAP server), but also to secure the transmission of confidential customer data across the wireless network. Dual mode operation inspectors travel to remote areas to evaluate accident sites. Consequently, mobile network access can be unreliable. Inspectors should be able to adjust claim information offine and then have the claim propagated back to the corporate servers when online access becomes available using the built-in Unwired Platform synchronization technology. Comprehensive set of workflow operations inspectors use mobile devices to view, create, or edit, the claim, customer, payment and policy information while conducting the inspection. A mobile claim inspection form is used to enter customer feedback, customer signature, and photos of the accident; as well as to update claim and inspection status. Inspectors can view the inspection report for each claim; the generated report includes complete information about the claim and the customer. Inspection data is uploaded to the main office database server using the built-in Unwired Platform synchronization technology.

Next: Get Started on page 6 tells you how to set up this sample on your computer.

Mobile Collision Inspection Sample

Get Started

Get Started
To get started with the SybInsure MCI sample, review the prerequisites, then follow this task sequence: 1. Bring all artifacts into the Unwired WorkSpace development environment for Eclipse. See Setting Up the Sample on page 6. 2. Open connections to the servers that this sample depends upon. See Starting the Sample Project on page 7. 3. Navigate the consolidated database (ServerDB) that is used to coordinate changes between the enterprise database and the remote database on the BlackBerry.This allows you to explore the tables and relationships that exist, and are the foundation for the Blackberry application. See Exploring the Database on page 9. 4. Explore the Mobile Business Objects (MBOs) that use the database for the device application's attributes as well as perform operations against tables in ServerDB. See Exploring MBOs on page 10. 5. Review the BlackBerry interface design in the Device Application Designer. The design of the interface correlates to the MBOs that perform database operations. See The Device Application Designer on page 12.

Prerequisites
Before you begin importing and setting up the sample, review and complete the prerequisites. Install Unwired Platform and choosing Eclipse as your development platform. Install the BlackBerry simulator or have access to an actual BlackBerry device. Install and start the BlackBerry MDS Simulator. Start Unwired Server. Ensure that the OpenDS LDAP server and Unified Agent have started by checking the running services in the Windows Control Panel.

Configuring your Environment for the Device Application Designer


To generate and distribute device applications built with the Unwired WorkSpace Device Application Designer, download the MDS simulator, and the BlackBerry JDE 4.2.1 from the BlackBerry developers' Web site. 1. Go to the BlackBerry Web site at http://blackberry.com and download and install the BlackBerry JDE 4.2.1. 2. Download and install the MDS simulator (BlackBerry_Email_MDS_4.1.2.17.exe).

Setting Up the Sample


Import the sample project archived in mobileInspec.zip into your Unwired WorkSpace environment. Prerequisites Do not get started with this sample until completed the prerequisites. See Prerequisites on page 6. 1. Launch Unwired WorkSpace and choose your workspace by clicking Start > Programs > Sybase > Unwired Platform > Sybase Unwired WorkSpace (eclipse edition). 2. Import mobileInspec.zip. a) Click File > Import.

Sybase Unwired Platform

Get Started b) In the Import wizard, select General > Existing Projects into Workspace and click Next. c) Choose Select archive file and browse to the location that you saved mobileInspec.zip to. d) Click Finish to import the artifacts in the archive as a project. 3. Edit the file that starts the SybInsure back-end database used by this sample. a) In WorkSpace Navigator, right click the run.bat file in the DB folder and select Edit file. b) Modify the values for the variables in this file as required, so the command line uses appropriate values for your environment. Variable
set ASA_DIR=C:\Program Files\SQL Anywhere 10

Description
Sets the root directory location of the server that hosts the sample SybInsure database. For example, the default location is:

C:\Sybase\UnwiredPlatform\Servers\UnwiredServer\ SQLAnywhere10
set PROJECT_DIR=C:\UEP\UseCase Sets the project directory. For example, the default location is:

C:\Documents and Settings\LoginID\workspace


Change LoginID an appropriate string, for example, jsmith. set PROJECT_NAME=MobileInspec Sets the path to the database file (ServerDB.db).

c) Save the changes. 4. Double-click run.bat. If a second SQLAnywhere icon appears in your system tray (the first should automatically appear because the Unified Agent has already loaded the UADB consolidated database for Unwired Platform), the new database server instance has started successfully. When you hover your cursor over that icon, it should correctly identify the database that is running as ServerDB.

Starting the Sample Project


Once you have imported the sample and started the ServerDB server, you can browse artifacts and open required server connections. 1. In the WorkSpace Navigator, expand the MobileInspec folder to view the project artifacts. When you import the project, errors are generated, as indicated by the red "x" beside the root folder and the Deployment folder. These errors are resolved as you set up your project for your environment. Project artifacts are contained in these folders: Mobile Business Objects, DB, and Deployment. For a description of all artifacts contained in this project, see Project Artifact Reference on page 27.

Mobile Collision Inspection Sample

Get Started

2. Create a connection profile and connect to the ServerDB database. a) In Enterprise Explorer, right-click the Databases folder and select New. b) Choose Sybase ASA as the connection profile type, and click Next. c) Type MobileInspecDB as the Name, select Auto-connect at startup, and click Next. d) Configure these properties: Property
Driver Host Port Database name User name and password Save password

Value
ASA v 10.x for Unwired Server Default The name of your host computer 2648 ServerDB.db Keep defaults of dba and sql respectively Selected

When you are finished, click Test Connection and ensure that the ping to the server is successful. Click Finish to exit the wizard. A MobileInspec database is added. When you connect to the server, a complete set of database elements appear below the ServerDB icon.

This new profile should resolve any connection profiles errors you received when you imported this project. If it does not, you may need to ping the server to see whether or not the server is available. 3. Connect to the Unwired Server. a) In Enterprise Explorer, expand the Unwired Server folder.

Sybase Unwired Platform

Get Started b) Right-click the My Unwired Server icon and choose Connect. When you connect to the server, a complete set of administrable elements appear below the server icon.

Exploring the Database


If you have started and connected to the SQL Anywhere database that acts as the sample's back-end repository, you can explore the structure and design of the database. No user intervention or modification is required: the schema, the tables, and relationships have already been explicitly design for this use case. However, by understanding the structure of the database, you can better understand how the business logic programmed into the application works in tandem with the database. 1. In the Enterprise Explorer, expand Databases > MobileInspecDB > ServerDB. 2. Right-click ServerDB, and ensure both Show Schemas and Show Owner are selected.

These options allow you to explore the database more intuitively. 3. To browse the tables used by the mobile application, expand ServerDB > Schema > DBA > Tables. The ServerDB has four tables listed alphabetically: claim, customer, payment, and policy. Expand each table to review the table design for each (that is, columns, keys, constraints, and so on). Table names mostly have a 1-to-1 relationship with the mobile business objects (MBOs) that create the business logic for the BlackBerry device application. The report MBO uses information from multiple databases. To explore the relationship between tables and MBOs more closely, open the mobile application diagram. For information on MBOs and diagrams, see Mobile Business Objects on page 10 and The Mobile Application Diagram on page 11. For more information on the database structure, see Data Access Layer Reference on page 27. 4. To review the views, stored procedures, and user-defined functions, expand DBO owner.

Mobile Collision Inspection Sample

Get Started

Exploring MBOs
Review the existing attributes and operations for mobile business objects, see what relationships among various mobile business objects are, and explore how MBOs are bound to ServerDB as their back-end data source. 1. In WorkSpace Navigator, expand the MBOs folder to view the MBOs created for this sample: claim, customer, payment, policy, and report. Except for the report MBO, all others match the table names of ServerDB. 2. To see the relationships among these MBOs, and to gather insights on the business logic behind them, right-click any MBO and select Open in Diagram editor.

Mobile Business Objects


Mobile business objects, grouped in a project, form the business logic for mobile applications. A mobile business object (MBO) is derived from a data source (database server, Web Service, SAP server, and so on). When grouped in projects, MBOs form the business logic for mobile applications that can be deployed to an Unwired Server and referenced in mobile devices (clients). MBOs include: Implementation-level details read-only metadata columns that include information about the data in the implementation. Implementation details also include arguments, which are read-only parameters that are passed to the back-end data source. Abstract-level details attributes correspond to class-level properties on the mobile client and map to columns. Parameters correspond to synchronization parameters on the mobile client and map to arguments. MBOs can also contain operations, which themselves contain parameters and arguments, and can be used to update, create, or delete data. Relationships defined between MBOs, link attributes, and parameters in one MBO to attributes and parameters in another MBO.

10

Sybase Unwired Platform

Get Started You can define MBOs using either a top-down approachdesigning attributes and parameters first, and later binding them to a data source, or a bottom-up approachspecifying a data source, and automatically generating attributes and parameters from it. A mobile application includes MBOs, as well as role and server mappings, and other artifacts that are delivered to the Unwired Server during deployment.

The Mobile Application Diagram


Each mobile application project has an associated mobile application diagram that provides a graphical representation of all mobile business objects (MBOs) within the project. The mobile application diagram is not only a static graphical representation of MBOs.You can copy and paste existing objects, create a new object, or even define data sources for MBOs that are not yet bound to a backend repository. However, the application diagram used in this sample is complete. If the sample project were larger, you could optionally create a filter to view only MBOs of interesteither by explicitly selecting the MBOs, or by creating a logical group. To explore this functionality, open the Unwired Workspace online documentation and click Sybase Unwired WorkSpace > Develop > Developing a Mobile Business Object > Working with Mobile Business Objects > Managing Mobile Application Diagram Filters.

What the MCI diagram shows The diagram shows the functionality an inspector has after authentication has occurred. Each of these MBOs are represented in the device application interface as distinct menu items. These menu items perform distinct actions. As the diagram shows, only the report MBO does not allow operations to be performed on the ServerDB data: claim MBO the Claim menu item displays a claim form to input values with which the ServedDB is queried. The query returns actual user data to the inspector. customer MBO the Customer menu item displays the same customer information used in the report the inspector can generate.

Mobile Collision Inspection Sample

11

Get Started policy MBO the Policy menu item downloads policy information for the customer, based on the policy number (policy_ID). payment MBO the Payment menu item allows the inspector to verify the status of the claim, namely whether the customer has made a current insurance payment prior to the accident. report MBO the Report menu item generates the inspection report based on the on-site inspection data by using the attributes defined, for example claim number (claim_id), customer information (first_name, last_name, email, policy_ID and msm_ID), and so on.

Exploring the BlackBerry Application Interface Design


Use the Device Application Designer to explore the flow of the BlackBerry application. The business logic is not held in the application. Instead, the application relies on the MBOs that are deployed to the Unwired Server. The separation of the application interface from the processing and logic components keeps the application compact and makes more efficient use of the BlackBerry's battery use. 1. In WorkSpace Navigator, double-click MobileInspec.bob. 2. Click the Flow Design tab to explore the flow of all existing BlackBerry screens. You can also see the screens themselves by clicking the Screen Design tab.

The Device Application Designer


The Device Application Designer consists of views and pages that allow you to model the interface of the device interface screens.

12

Sybase Unwired Platform

Get Started You can two views to visualize the application in two ways: Outline shows all the objects in the designer, for all pages but the Introduction or Source page. The outline includes context menus that match the context menu selection for the objects on the page. If you selecting a node on the tree outline, the corresponding node in the editor is highlighted, and vice versa. The outline view is related to the object model, so delete and command stack actions appear in this view. For example, if you delete an item, undo and redo commands appear; the same as in the editor. Thumbnail (image) shows the Flow Design page as a thumbnail. Therefore, when you design a screen and attach actions to buttons on the Screen Design page, the flow changes, and you can see the change in the thumbnail view. The thumbnail also gives context for the screen you are working on with respect to the entire application design. This view includes the standard viewable region locator for scrolling the image.

The Device Application Designer has drag-and-drop functionality, which allows you to drag and drop mobile business objects of certain types and settings onto controls that have the Mobile Business Object Search option on the Properties tab. You can also drag and drop mobile business object operations on to controls that accept actions. The Device Application Designer contains several pages: Introduction Creating a new custom device application or double-clicking an existing one, opens the Introduction section of the Device Application Designer. This page is the starting point for designing your custom device application. You can access help and launch tutorials from this page. Flow Design Use this page to specify the manner in which screens link together. You can then link specific screens and actions to a mobile business object on a server. The Palette view shows available screens, alerts, and connections. The Flow Design page displays an empty canvas with the Start icon, and the Palette to the right, which shows the available stock screens, alerts, and connections. You can drag and drop items from the Palette to the canvas. Screens that you drag to the Flow Design canvas display as icons and show the connection lines between them. Dragging a new screen into this page starts a new screen. Double-clicking a screen open the Screen Design page. Right-clicking anywhere in the Flow Design page displays a context menu. Screen Design Use this page to design the screen of your custom device application. The Palette view shows the menu, controls, containers, header and footer, and actions you can use to design a new screen. Drag controls to design the user interface on the device screen. The Device Application toolbar includes a list of existing screens.

You can open an different screen by selecting the corresponding screen name from the list. Source This page appears only if you have configured it in the Device Application Designer Appearance preferences. This page shows the XML code of the custom device application. You can edit the XML code directly in the Source page, and changes are immediately reflected in the Screen Design and Flow Design pages.

Mobile Collision Inspection Sample

13

Try It Out

Try It Out
Use the sample to explore the requirements of an inspector so that you can better understand the features of Unwired Platform. An inspector relies on this mobile solution to accomplish tasks associated with inspection on the road without having to stop into the office to update information between site visits. Before you can try out the features of this sample that are described in the table below, you must: 1. Deploy the sample MBOs to Unwired Server. 2. Provision the simulator or device with the device application. 3. Start the sample on the simulator or device and log in to Unwired Server. Feature Use case See
The Mobile Application Diagram on page 11 and The Device Application Designer on page 12 Deploying the Sample MBOs to Unwired Server on page 14 and Provisioning the Device with a Device Application on page 15 Working with Claims on page 18, Working with Customers on page 20, Working with Payments on page 22, and Working with Policies on page 22

BlackBerry development and design in Reviewing application diagrams and the WorkSpace environment design flows. Application provisioning and maintenance support for BlackBerry devices Back-end data integration with user-initiated pull synchronization Deploying the sample MBOs to Unwired Server as a package, and provisioning the device or simulator with the corresponding user interface. Opening any of the four MBOs automatically refreshes data in the device database.

Security features (authentication and role support)

Inspector authentication with the login Running the BlackBerry Application on screen. Without the correct page 17 credentials, the inspector cannot access the deployed MBOs. Changes to claim details are tracked in the device database until they are submitted to the back-end database. Synchronizing Data on page 23

Back-end database integration with user-initiated data updates

Deploying the Sample MBOs to Unwired Server


Deploy the sample to the Unwired Server and thereby make the MBO logic available to the user interface (MobileInsepc.bob). Prerequisites Ensure you are connected to an Unwired Server. There are multiple techniques you can use to deploy the mobile application. This sample documents how to deploy the sample from the project. For information on the other options, open the Unwired WorkSpace online help and click Sybase Unwired WorkSpace > Develop > Developing a Mobile Business Object > Packaging and Deploying Mobile Business Objects. 1. 2. 3. 4. 5. Right-click the MobileInspec project and select Deploy Project. Enter the deploy mode, target version, package namespace, and click Next. Select all boxes to deploy all MBOs and click Next. Select the Unwired Server you are connected to and click Next. Map the connection profile for MobileInspecDB to the Server connection profile of the same name.

14

Sybase Unwired Platform

Try It Out This mapping process creates a named endpoint to the correct server that give you access to the systems you require. 6. Since you do not need to map roles or create a deployment profile for this sample, click Finish to deploy the package to the server you selected.

Provisioning the Device with a Device Application


Use the Generate Device Application wizard to generate a device application for development and testing on a simulator or actual BlackBerry device. Prerequisites You must have an existing mobile application project and JDE 4.2.1 installed, as well as have the BlackBerry MDS server simulator started. 1. Resolve references in the application to point to your instance of Unwired Server. a) in the Device Application Designer, open MobileInspec.bob. b) Click the Flow Design tab.

c) Right-click any node in the flow design, and select Unwired Platform Profile References. d) Select the defined reference and click Edit. e) Choose the connection profile for your Unwired Server and click OK.

Mobile Collision Inspection Sample

15

Try It Out

The name listed in the Sybase Unwired Platform profile column changes to the name you selected. f) Close the Sybase Unwired Platform Profile References dialog. All references in the device application are updated accordingly. g) Save MobileInspec.bob. 2. To provision the simulator: a) Right-click MobileInspec.bob and select Generate Device Application. b) In the Generate Device Application wizard: Expand Favorite Configurations and choose JDE 4.2.1. Simulator Deployment. Expand Locations and select Copy to Simulator Location. If the default location is incorrect, click Browse and choose the correct simulator location. Also click Start the BlackBerry Simulator After Copying to immediately load the application on the simulator.

c) Click Finish. A progress bar appears, displaying status messages as the application code is generated and compiled. After a few minutes, the BlackBerry simulator appears with the application loaded onto it. 3. To provision a device: a) Ensure that your BlackBerry device is registered. Unregistered devices cannot connect to the BES server without an assigned key. Visit blackberry.com for information on how to register your devicea nominal fee may be required if you have not purchased your device from a wireless carrier. b) Ensure that the Unwired Server you deployed the package to is running on a demilitarized zone (DMZ). BlackBerry devices cannot connect to servers behind the firewall.To redeploy the sample, see Deploying the Sample MBOs to Unwired Server on page 14. c) Using the BlackBerry Desktop Manager, copy the *.BOB files to the device from the computer the device is connected to. *.BOB files that you must transfer include UltraLiteJ, BodFramework, and MobileInspec.

16

Sybase Unwired Platform

Try It Out

Running the BlackBerry Application


Use the BlackBerry application to demonstrate some of the important features of Unwired Platform. Running the application on the device requires that you: 1. Start the MobileInspec application. 2. Open one of the MBOs: claims, customer, policies, or payments.

Starting the MobileInspec Application


Load the application and log in to begin exploring the features of this application. 1. Press the Menu button to display the Home screen, then select the MobileInspec icon.

2. On the Login Information screen, enter the user name and password to authenticate with the Unwired Server. You can use the administration defaults of supAdmin and s3pAdmin.

If you supply an invalid set of credentials, you cannot proceed. Only authenticated users can access the Mobile Inspection Center screen that displays the main menu.

Mobile Collision Inspection Sample

17

Try It Out

Working with Claims


Use the sample application to add, modify, delete, view, and sort a claim. Adding and Deleting a Claim Use the Claim MBO to insert an new claim or delete one that is no longer required. Changes are written to the compact database installed with the device application. They are not written to the consolidated database on Unwired Server until you synchronize your changes. 1. From the Mobile Inspections Center main menu, click Claim. Progress messages appear indicating whether or not the MBO is being retrieved from the Unwired Server. Upon retrieval, the MBO then begins the upload and download operations, which populates the claim data with two claims: claim_ID 22 and claim_ID 33:

2. To add a new claim: a) Click the Menu key and select Create claim. b) In the form that appears, create a claim with these values: Option
claim ID policy ID claim status inspector name inspector status

Value
11 100 New Your name New

c) When you are finished, click Submit to save the information in the compact database on the device.

18

Sybase Unwired Platform

Try It Out The information you supplied now appears as a row in the claim table. 3. To delete a claim: a) Choose the claim you want to delete by selecting the row with a claim ID of 22 (the one with a claim status of Done). b) Click the Menu key and select Delete Claim. c) Click Submit. The claim is removed from the claim table. When you are finished adding and deleting these rows, the only claims remaining should be claim_ID 11 (new) and claim_ID 33 (previously existing from the back-end database). Updating a Claim Update an existing claim by changing any of the defined values. 1. With the Claim MBO open, select the row with the claim_ID of 11. 2. Click the Menu key and select Update Claim. 3. In the form that appears make these changes:
Option claim status inspector name inspector status Change to Reassigned Maya Nandi Under review

4. Click the Menu key and select Submit. The values of the claim appear in red in the claims list table. Viewing Claim Details View claim details to see the properties of a claim in form view rather than table view. Because there are multiple properties, this table view may truncate data. 1. Use the trackball to select the claim with an ID of 11. 2. To view the claim as a form, select Claim Details. Sorting Claims Reorder the list of claims by sorting columns. 1. In the table of listed claims, click the Menu key and scroll with the trackball to display the Sort on Column options.

Mobile Collision Inspection Sample

19

Try It Out 2. Select one of the columns to sort the claims on. Depending on the datatype of the column, claims are sorted alphabetically or numerically. Creating a Report A report combines all records from both claim and customer details into a single view. 1. With the claim MBO open, select the row. 2. Click the Menu key and click Report Details. The report view for the selected row appears. As shown, the inspector information, photo and signature would normally be fields in a claim MBO, and first and last names would normally be fields in a customer MBO, but instead are integrated into a report view:

Working with Customers


Use the Customer MBO to search, add, delete, or update customer information. Adding and Deleting a Customer Use the Customer MBO to insert a new customer or delete one that is no longer required. Changes are written to the compact database but not written to the consolidated database on Unwired Server until you synchronize your changes. 1. From the Mobile Inspections Center main menu, click Customer. Progress messages appear indicating whether or not the MBO is being retrieved. 2. To add a new customer: a) Click the Menu key and select Create Customer. This menu item may not be available if you have not yet viewed a customer profile. b) In the form that appears, create a customer with these values: Option
policy ID first name last name email msm ID

Value
200 Doris McFarlane dmcfar@myco.com 400-1

c) When you are finished, click Submit to save the information in the compact database on the device. The information you supplied now appears as a red row in the customer table. 3. To delete a customer:

20

Sybase Unwired Platform

Try It Out a) Choose the customer to delete by selecting the row with a policy ID of 400. b) Click the Menu key and select Delete customer. c) Click Submit. The test customer you created has been removed from the local database on the BlackBerry device. Once you submit the change as a pending operation, the information is synchronized back to ServerDB. Updating a Customer Update an existing customer by changing any of its defined values. 1. With the Customer MBO open, enter 400 as the policy ID and click Submit. The customer record for this policy appears. 2. Click the Menu key and select Update Customer. 3. In the form that appears make these changes:
Option last name email Change to Schulz dschulz@myco.com

4. Click the Menu key and select Submit. Viewing Customer Details Open the Customer MBO to search for a customer record using policy_ID as the search criteria. 1. From the Mobile Inspections Center main menu, click Customer. Progress messages appear indicating whether or not the MBO is being retrieved from the Unwired Server, then the upload and download operation begins. 2. Use the trackball to move the cursor to the policy_ID field and type the policy number you want to search on. 3. Click the Submit button. The results are listed a table. For example, searching for policy 300 returns the following result:

Sorting Customers Reorder the list of displayed customers by sorting columns. 1. In the table of listed customers, press the Menu button and scroll with the trackball to display the Sort on Column segment.

Mobile Collision Inspection Sample

21

Try It Out

2. Select one of the columns to sort the customers on. Depending on the datatype of the column, customers are sorted alphabetically or numerically.

Working with Policies


Use the Policy MBO to view policy information. Viewing Policy Details Open the Policy MBO to search for a policy record using policy_ID as the search criteria. 1. From the Mobile Inspections Center main menu, click Policy. Progress messages appear indicating whether or not the MBO is being retrieved from the Unwired Server, then the upload and download operation begins. 2. Use the trackball to move the cursor to the policy_ID field and type the policy number you want to search on. 3. Click the Submit button. The results are listed a table. For example, searching for policy 300 returns the following result:

Working with Payments


Use the payment MBO to view payment details.

Viewing Payment Details Open the Payment MBO to search for a payment record using policy_ID as the search criteria.

22

Sybase Unwired Platform

Try It Out 1. From the Mobile Inspections Center main menu, click Payment. Progress messages appear indicating whether or not the MBO is being retrieved from the Unwired Server, then the upload and download operation begins. 2. Use the trackball to move the cursor to the policy_ID field and type the policy number you want to search on. 3. Click the Submit button. The results are listed a table. For example, searching for policy 300 returns the following result:

Synchronizing Data
Synchronization is the term used to refers to the information that is uploaded and downloaded between the Unwired Server and a remote database located on a mobile device. Data is updated in two ways: When you load an MBO, Unwired Server downloads data to the device for the back-end database (that is, serverDB.db), depending on the request you submit with the MBO. For example, when you use the Policy MBO to get information on a policy ID, the most current information is passed into the device's version of the database. When you submit pending operations, all recorded transactions are written to the back-end database. Until then, they are aggregated until all pending operations can be performed in as a group transaction. This aggregation process allows inspectors to still work offline if network access is unavailable.

Checklist of Changes During the sample walkthrough these changes were made. If you did not follow all steps and examples, use this list of changes make the necessary data updates now. If you did follow all steps in this sample, you can then validate updates both in the pending operations list, and in the serverDB.db database. Operation
Add new claim (11)

Details
claim ID=11 policy ID=100 claim status=new inspector name=yours inspector status=new

Delete claim (22)

cliam ID=22

Mobile Collision Inspection Sample

23

Try It Out Operation


Modify new claim (11)

Details
claim status=reassignmed inspector name=Maya Nandi inspector status=under review

Add new customer

policy ID=200 first name=Doris last name=McFarlane dmcfar@myco.com msm ID=400-1

Delete a customer Modify new customer (200)

policy ID=300 last name=Schulz dschulz@myco.com

Reviewing and Synchronizing Pending Operations Pending operations are the add, delete, update operations you performed from an MBO that have been committed to the database on the device, but have not yet been synchronized back to the serverDB.db file that acts as the back-end insurance repository. 1. From any MBO, press the Menu key and select Pending Operations. The Pending Operations screen appears, sorting all transactions first by MBO name, then by transaction type. If you followed all the changes performed in previous tasks, your screen appears like this:

2. To collapse and expand the view of these operations, press the Menu key and select either Collapse or Expand as needed. 3. To see the details of a single operation, select it, press the Menu key, and select Info. The information displayed shows details on the pending operation.

24

Sybase Unwired Platform

Try It Out

4. After reviewing the list of pending operations to be performed on information in the back-end repository, press the Menu key and select Submit All Operations. 5. When prompted to confirm, click OK. All operations you submit are synchronized with the back-end repository. Those changes that were once displayed in red (which indicated an uncommitted change) now appear in black because they have been committed to serverDB.db via the synchronization process. Other options you could choose to perform include: Delete operation or delete all operations, which removes the transactions from the device's database completely and therefore are never synchronized. Disable operation, which holds the selected operation back from the group currently being submitted. However, any operations you disable are maintained, until you decide to enable them for future submission, or entirely delete them from the device database.

Validating Synchronization Transactions Validate synchronization transactions on the back-end consolidated database by browsing tables in Unwired WorkSpace. 1. In the Enterprise Explorer, expand Databases > MobileInspecDB > ServerDB > Schema > DBA > Tables. 2. Right-click the claim table and select Edit Data. 3. In the Table Filter Data dialog, click OK, as you do not need to filter data for this sample. If Unwired Server successfully synchronized the changes listed in Checklist of Changes on page 23, the table data opens displaying two claims: 11 and 33.

4. Use the checklist of changes and repeat the previous steps for each table, thereby ensuring that updates have occurred as expected. 5. (Optional) Display the customer table and add a new customer to it. Save your changes. For example, the graphic below shows that row 4 is new and unsaved, because it has an asterisk (*) beside it.

Mobile Collision Inspection Sample

25

Try It Out

6. On the BlackBerry, open the Customer MBO and validate that this update has been reflected on the device.

26

Sybase Unwired Platform

Learn More

Learn More
For more information about this sample, or to get additional help on using Unwired Platform in your enterprise environment, review these section as required by your business needs. For information about project artifacts, database schemas, and other detailed information on this sample, see Related Reference on page 27. For information on how to coordinate your self-directed exploration of Unwired Platform Samples and Tutorials, see Coordinating Samples and Tutorials on page 29. To get help or more information, see Getting Help on page 30 and Additional Information on page 29.

Related Reference
Review reference information to understand the implementational and architectural details of this sample.

Project Artifact Reference


Familiarize yourself with artifacts of this sample. All project artifacts are imported into WorkSpace from the MobileInspec.zip file. To explore the project's contents, expand the project in WorkSpace Navigator. The top-level folder structure of this sample is: Folder Mobile Business Objects Contents
The source files for the MBOs used in this sample, as well as their required attributes (for example, the tables and columns the MBOs access), and the operations they perform if any. The pointers to the data source used by the MBOs in the sample. In this case, there is only one: MobileInspecDB. The roles defined for the project. The sample project has no roles defined. The personalization keys defined for the project. The sample project has no personalization keys defined. The database files used as the back-end repository for the sample. These files include the .BAT file that starts the database with all required properties, the database file itself, and its corresponding log file. The folder where all applicable deployment files are saved. The project contain some sample/test deployment files. You can add your own deployment files if you choose. The folder where generated code is saved.The project contains no generated code files. However, you can create your own as part of trying out this sample.

Data Source References Roles Personalization Keys DB

Deployment

Generated Code

Data Access Layer Reference


Because the device database holds a subset of corporate data, the schemas for the consolidated database acting as the back-end repository for the sample and the remote device database are the same. The entity relationship is described in the consolidated database model (serverDB.db). To transfer the subset of data, a download cursor is defined, so that only the data related to the inspector's immediate work assignments are loaded onto the device.

Mobile Collision Inspection Sample

27

Learn More This table summarizes the schema for both databases: Table
policy

Column
policy_id policy_type policy_status_code policy_category policy_category_description

Data type
int varchar (50) varchar (20) varchar (50) varchar (200) int varchar (50) varchar (50) varchar (50) vachar (50) in int date vachar (50) vachar (50) vachar (50) image varchar (1000) image int decimal decimal varchar (50)

Primary key
Y

customer

policy_id first_name last_name email messaging_id

claim

claim_id policy_id date_of_claim claim_status insptector_name inspection_status photo customer_feedback signature

payment

policy_id payment_due payment_made payment_status

Device Application Architecture


The device application for this sample consists of three layers (and their corresponding Web pages or objects) and a listener. In the presentation layer, the user interface is developed as a series of Web pages that display on the BlackBerry device. In the business logic layer, business logic is developed independent of the underlying database and operating system. In the data access layer, simplified access to local data stored in the compact device database allows the business layer to access and manipulate data. The notification listener waits for incoming events that notify the listener when data has been updated in the consolidated back-end database. However, this version of this sample does not yet demonstrate this capability.

28

Sybase Unwired Platform

Learn More

Coordinating Samples and Tutorials


Unwired Platform includes both samples and tutorials that you can download. This sample demonstrates the synchronization behavior of Unwired Platform, as well as allows you to explore the sample artifacts, and deploy them as a functional mobile application. No programming or subsequent Unwired WorkSpace development is required. You can also download interactive tutorials and cheat sheets that further demonstrate how to use Unwired Platform to develop, deploy, and administer Unwired Platform and mobile applications.

Additional Information
Use the Sybase Getting Started CD, the SyBooks CD, and the Sybase Product Manuals Web site to learn more about Unwired Platform.

Mobile Collision Inspection Sample

29

Learn More The Getting Started CD contains release bulletins, installation guides, and other documents or updated information not included on the Sybooks CD. It is included with your software. To read or print documents on the Getting Started CD, you need Adobe Acrobat Reader, which you can download at no charge from the Adobe Web site using the link provided on the CD. The SyBooks CD contains product manuals and is included with your software.The Eclipse-based SyBooks browser allows you to access the manuals in HTML-based format. Some documentation, however, may be provided in PDF format as well. The Sybase Product Manuals Web site is an online version of the SyBooks CD that you can access using a standard Web browser. In addition to product manuals, you can find links to EBFs/Maintenance releases, Technical Documents, Case Management, Solved Cases, and newsgroups.To access the Product Manuals Web site, go to http://sybase.com/support/manuals.

In addition, you may also want to access these Web resources: Sybase Unwired Platform Tech Corner BlackBerry Developers Network Ant Script Documentation on Apache.org

Getting Help
Each Sybase installation that has purchased a support contract has one or more designated people who are authorized to contact Sybase Technical Support. If you cannot resolve a problem with the online help or other technical documents, please have the designated person contact Sybase Technical Support or the Sybase subsidiary in your area.

30

Sybase Unwired Platform

Index

Index
A
additional information 30 artifacts importing 6 reference 27

F
features, Unwired Platform 14 Flow Design 13

H
help, getting 30

B
BlackBerry application architecture 28 application, starting 17 JDE download 6 prerequisites 15 business requirements 5

I
importing projects 6 interface design 12

L
layers, architectural 28 listener, notification 28 logging in 17

C
changes checklist of 23 synchronizing 23 uncommitted 25 claims adding 18 creating reports 20 deleting 19 details, viewing 19 sorting 19 updating 19 connection profiles, creating 7 consolidated database exploring 9 schema 27 context summary 4 customers adding 20 deleting 20 details, viewing 21 sorting 21 updating 21

M
MBOs 10, 14 deploying 14 overview 10 viewing diagrams of 10 mobile application diagram 11 mobile business objects, See MBOs

N
notification listener 28

O
operations, pending 24

P
payments details, viewing 23 pending operations deleting and disabling 25 submitting 24 policies details, viewing 22 prerequisites 6 projects artifact reference 27 importing 6

D
databases consolidated, exploring 9 schema 27 Deploy wizard, using 14 Device Application Designer 12, 13

E
emulator, See simulator entity relationships 27

Mobile Collision Inspection Sample

31

Index

R
reference data access layer 27 project artifacts 27 reports, creating 20 requirements 5, 6

synchronizing (continued) transactions, validating 25 system requirements 6

T
Technical Support, contacting 30 transactions, validating 25 tutorials, learing more with 29

S
sample downloading 6 overview 4 setting up 6 starting up 6, 7 schema 27 Screen Design 13 ServerDB, exploring 9 simulator, starting 15 synchronizing pending operations 24 summary of 23

U
Unwired Platform features demonstrated 14 getting help 30 learning more 30 profile references 15 Unwired Server connection profile 15 deploying to 14 logging in 17 usage scenario 5

32

Sybase Unwired Platform

You might also like