Oracle Mobile Supply Chain Applications - baixardoc

10
Page 1 of 35 Oracle Mobile Supply Chain Applications Developers Guide Version 1.0 January 8, 2012

Transcript of Oracle Mobile Supply Chain Applications - baixardoc

Page 1 of 35

Oracle Mobile Supply Chain Applications

Developers Guide

Version 1.0

January 8, 2012

Page 2 of 35

Table of Contents

Table of Contents _____________________________________________________________ 2

Table of Figures ______________________________________________________________ 3

Purpose _____________________________________________________________________ 5

Oracle MSCA Overview ________________________________________________________ 5

MSCA User Interface __________________________________________________________ 6

MSCA Application Framework ___________________________________________________ 7

MSCA Object Beans ________________________________________________________________ 7

MSCA Java Event-Listener Model _____________________________________________________ 8

MSCA Bean APIs ___________________________________________________________________ 9

Bean APIs ________________________________________________________________________________ 9

Sub classes associated with the MWA Bean _____________________________________________________ 9

Menu Item Bean ________________________________________________________________________ 9

Commonly Used Menu Item Bean APIs ______________________________________________________ 9

Page Bean _____________________________________________________________________________ 10

Commonly Used Page Bean APIs ___________________________________________________________ 10

Flexfield Bean __________________________________________________________________________ 10

Commonly Used Flexfield APIs ____________________________________________________________ 10

Field Bean _____________________________________________________________________________ 10

Commonly used Field Bean APIs ___________________________________________________________ 11

Field Bean Types and Commonly Used APIs ____________________________________________ 11

Field Bean Sub-class Diagram _______________________________________________________________ 11

InputableFieldBean _____________________________________________________________________ 11

The Commonly used APIs ________________________________________________________________ 11

LOVFieldBean __________________________________________________________________________ 12

Commonly Used APIs ____________________________________________________________________ 12

TextFieldBean__________________________________________________________________________ 13

Commonly Used APIs ____________________________________________________________________ 13

HeadingFieldBean ______________________________________________________________________ 13

Commonly used APIs ____________________________________________________________________ 14

ListFieldBean __________________________________________________________________________ 14

Commonly used APIs ____________________________________________________________________ 14

ButtonFieldBean _______________________________________________________________________ 14

Commonly used APIs ____________________________________________________________________ 14

Form Functions in MSCA ______________________________________________________ 14

MSCA and the AK Repository ___________________________________________________ 15

Defining Labels in the AK Repository _________________________________________________ 15

AK Repository Data Field Identifier (DFI) ______________________________________________ 15

Steps to Create Labels in AK Repository _______________________________________________ 15

Page 3 of 35

Customizing MSCA – Oracle Recommended Best Practices ___________________________ 18

Setting Up a Development Environment __________________________________________ 18

Download and Install the Required JDK _______________________________________________ 19

Select and Install a Java IDE _________________________________________________________ 19

NetBeans Installations Special Instructions ____________________________________________________ 19

NetBeans Post Installation Instructions _______________________________________________________ 19

Starting and Stopping the MWA Telnet Server _____________________________________ 21

Start MWA Telnet Server ___________________________________________________________ 21

Stop MWA Telnet Server ___________________________________________________________ 21

Miscellaneous Topics on Customizing MSCA _______________________________________ 21

Identifying Java Class Files for a Menu Item ____________________________________________ 21

Display MSCA Character Mode Form Information _______________________________________ 22

Display MSCA Function and Hot Keys _________________________________________________ 22

About MSCA Fields and Buttons _____________________________________________________ 23

MSCA/MWA Class Types and Locations _______________________________________________ 23

MSCA Customizations Case Studies ______________________________________________ 23

Case 1: XXXXX CR to Add Part Serialization to XXXXX Quick Pick ___________________________ 24

Understand the Functional Requirement ______________________________________________________ 24

Create Test Data Sets ______________________________________________________________________ 24

Identify the XXXXX Quick Pick Current State ____________________________________________________ 25

Identify the XXXXX Quick Pick “To Be” State ____________________________________________________ 27

Document and Build the Required Changes ____________________________________________________ 27

Case 2: Addition of extra fields on Quick Ship Page to collect FOB terms, freight terms, and

document shipset _________________________________________________________________ 28

Understand the Functional Requirement ______________________________________________________ 28

Identify the Quick Ship Current State _________________________________________________________ 28

Identify the Quick Ship “To Be” State _________________________________________________________ 28

Code Changes and Additions ________________________________________________________________ 29

Create DocumentShipSetLOV Java Class _____________________________________________________ 29

Create CustomEZShipFunction Java Class ____________________________________________________ 31

Create CustomEZShipPage Java Class _______________________________________________________ 31

Index ______________________________________________________________________ 34

Table of Figures

FIGURE 1 ORACLE MSCA INFORMATION FLOW ........................................................................................................................ 5

Page 4 of 35

FIGURE 2 MSCA APPLICATION COMPONENTS ......................................................................................................................... 6

FIGURE 3 MSCA GRAPHICAL INTERFACE ................................................................................................................................. 6

FIGURE 4 MSCA CHARACTER MODE INTERFACE ...................................................................................................................... 6

FIGURE 5 MSCA APPLICATIONS FLOW ................................................................................................................................... 7

FIGURE 6 MSCA OBJECT INTER-RELATION MODEL ................................................................................................................... 7

FIGURE 7 MSCA JAVA BEAN HIERARCHIES ............................................................................................................................. 9

FIGURE 8 MSCA FIELD BEAN HIERARCHIES ........................................................................................................................... 11

FIGURE 9 UPDATING A FORM FUNCTION ............................................................................................................................... 15

FIGURE 10 CREATING AK REPOSITORY ATTRIBUTE .................................................................................................................. 16

FIGURE 11 DEFINING A REGION IN THE AK REPOSITORY ........................................................................................................... 17

FIGURE 12 LINKING A REGION IN THE AK REPOSITORY ............................................................................................................. 17

FIGURE 13 DEFINE THE DFI ATTRIBUTES ............................................................................................................................... 18

FIGURE 14 SELECTING PROJECT PROPERTIES IN NETBEANS ....................................................................................................... 20

FIGURE 15 NETBEANS ADD JAR/FOLDER .............................................................................................................................. 21

FIGURE 16 GET MSCA FORM INFORMATION ........................................................................................................................ 22

FIGURE 17 DISPLAYING FUNCTION/HOT KEYS ........................................................................................................................ 22

FIGURE 18 CURRENT XXXXX QUICK PICK FORM.................................................................................................................... 24

FIGURE 19 CLASS HIERARCHY DIAGRAM ............................................................................................................................... 26

FIGURE 20 "TO BE" STATE SCREEN FLOW ............................................................................................................................. 27

FIGURE 21 QUICK SHIP CURRENT STATE ............................................................................................................................... 28

FIGURE 22 QUICK SHIP FIELD ADDITIONS .............................................................................................................................. 28

FIGURE 23 QUICK SHIP CLASS EXTENSIONS............................................................................................................................ 29

Page 5 of 35

Purpose This developers’ guide is intended to provide all of the information necessary to understand and

customized the Oracle Mobile Supply Chain Applications (MSCA) within XXXXX’s implementation architecture. The content is a compilation (hopefully in an orderly fashion) of Oracle White Papers,

worldwide web blogs, independent articles, presentations on the topic, and personal experience

obtained while reverse engineering previous customizations to XXXXX’s MSCA implementation.

Oracle MSCA Overview

The Oracle Mobile Supply Chain Applications (MSCA) enables automated mobile user operations. This is

performed using hand held radio frequency (RF) devices, PDA’s, and lift truck mounted RF scanners. It is

part of the Oracle Supply Chain Management solution, the integrated suite that streamlines design,

planning, manufacturing and fulfillment.

With MSCA, Oracle has leveraged standard Internet technologies such as Java, XML, TCP/IP and Telnet

to create a device independent technology platform to support these types of applications. In general,

these mobile devices will be connected to the network using the radio frequency (RF) standard of

802.11b and will communicate using TCP/IP. The figure below illustrates the communication flow using

Mobile Devices.

Figure 1 Oracle MSCA Information Flow

From an application component perspective, MSCA’s layered architecture includes (see below):

1. presentation layer consisting handheld devices such as RF Barcode Scanners, laptops, etc,

2. application access via Telnet,

3. application logic comprised of managers and services, and

4. data access through PL/SQL packages, SQL scripts, and EJBs.

Page 6 of 35

Figure 2 MSCA Application Components

MSCA User Interface The MSCA application provides two user interfaces (UI): GUI and Character Mode (see below).

Figure 3 MSCA Graphical Interface

Figure 4 MSCA Character Mode Interface

The choice of a user interface type is usually driven by the capabilities of the handheld devices being

used. At XXXXX, the handheld devices limit the user interface to Character Mode.

Page 7 of 35

MSCA Application Framework

MSCA Object Beans

Oracle has built MSCA/MWA framework in order to develop Mobile Applications. A mobile application,

as defined by MSCA, is built using the following Java Beans:

1. A MenuItemBean is needed to attach the mobile application to the Oracle Desktop ERP. It

contains no page layout information on its own, but is a necessary conduit to connect the

Desktop ERP to mobile transactions. At the leaf node of the FND menu structure lays an FND

Form Function that points to the MenuItemBean. The MenuItemBean in itself points to the first

page in the application, which is represented by a Page Bean.

2. A PageBean represents the unit of display (i.e. a single screen on a mobile client). To define a

new page, the developer must extend the PageBean, and make a new page bean class. Within

this new class, the developer must use the new PageBean's constructor to instantiate FieldBeans

(graphical components), and add them to the page.

3. The FieldBean is a super class for all data collection/display graphical components that the

developer can use in their pages. When the mobile server loads a new page, it calls the user

defined PageBean's constructor, which in turn creates all of the graphical components on that

page. Examples of FieldBeans are TextFieldBean, ButtonFieldBean, LOVFieldBean,

MultiListFieldBean, ListFieldBean, HeadingFieldBean, and SeparatorFieldBean.

Within this framework, the MSCA Applications flow follows a consistent pattern as shown in Figure 5

below.

Figure 5 MSCA Applications Flow

Because each of these beans is written in Java, each one can consequently be extended with additional

functionality. Customers should have a strong grasp of what a bean is, how the three types of mobile

beans relate to each other, and finally how they connect to Oracle Applications Desktop ERP. When

constructing a page, it is important to note that ERP forms connect to a MenuItemBean, which in turn

links to a PageBean, which in turn contains many FieldBeans, as shown below.

Figure 6 MSCA Object Inter-Relation Model

Page 8 of 35

This model adapts nicely to customization. As indicated in Figure 7 and will be seen in the MSCA

customizations examples, MSCA was designed to be customized by extending the base (or seeded) Java

classes. The approach capitalizes on the characteristics of object oriented languages; in particular, Java.

MSCA Java Event-Listener Model

As implied in Figure 5 above, the MSCA/MWA Framework is based on the Java Event-Listener

Model.

An application's runtime logic is specified through the mobile applications event model, a set of

interfaces that provide an infrastructure for handling events in an organized and modularized fashion. A

listener can be added to any field, page, or application of your mobile transaction. The following is a list

of listeners available:

1. FieldEntered – this is called when a particular field is entered. For example, prior to entering a

particular field, there may be a need to reinitialize some variables.

2. FieldExited – this is called when a particular field is exited. The most common of the listeners,

this is used for validation of user input.

3. PageEntered – called when the page is entered, this can be used to initialize values on the page.

4. PageExited – called when the page is exited, this can perform page level validation logic.

5. AppEntered – called when the entire transaction is entered, this can be used to initialize

transaction level variables.

6. AppExited – called when the entire application is exit, an example use can be to close resources.

7. SpecialKeyPressed – this is called when the user presses any special character, such as a Control

character. Pressing CTRL-G to generate LPNs or Lots is one example of when this gets called.

Page 9 of 35

MSCA Bean APIs

This is the base class for all the beans used in Mobile Applications. It is derived from Java.lang.Object

class. It has four main sub classes. They are:

Field Bean

FlexField Bean

Menu Item Bean

Page Bean

Figure 7 MSCA Java Bean Hierarchies

Note: Throughout this document MWA (Mobile Web Applications) and MSCA are used

interchangeably.

Bean APIs

public void addListener(MWAListener) Add a listener to event listener list

public void removeListener(MWAListener) Remove a listener from event listener list.

Note: oracle.apps.mwa.eventmodel.MWAListener is an Interface which handles the event and

is derived from java.util.EventListener.

Sub classes associated with the MWA Bean

Menu Item Bean

MenuItemBean is the base class for all user developed menu item level beans

Commonly Used Menu Item Bean APIs

public java.lang.String getFirstPageName() Get name of the first page within the menu item.

public void setFirstPageName(java.lang.String) Set name of the first page within the menu item.

public java.lang.String getMenuConfirmMessage() get the menu confirmation message

Page 10 of 35

public void setMenuConfirmMessage(java.lang.String) set the menu confirmation message

When the user tries to go to main menu, it asks for

confirmation something like, “Go to Menu?" This

message can be changed using this method

Page Bean

The PageBean is the base class for all user developed page level beans.

Commonly Used Page Bean APIs

public void addFieldBean(FieldBean) Add the bean at end of page

public void addFieldBean(int index,FieldBean) Add the bean at specified index

public void removeFieldBean(FieldBean) Removes the field bean from the page

public String getName() Get fully qualified class path of the page

public Session getSession() Get the session of page bean.

The return type

session(oracle.apps.mwa.container.Session) is

derived from the class

oracle.apps.mwa.container.BaseSession

public void setSession(Session) Sets the session for the page.

public String getPrompt() Get the Page Title

public void setPrompt(java.lang.String) Set the Page Title

Flexfield Bean

The FlexFieldBean is used to handle the Flex Field beans in Mobile Applications. This implements the

following interfaces:

java.util.EventListener

oracle.apps.fnd.flexj.event.FlexfieldListener

java.io.Serializable

Commonly Used Flexfield APIs

public oracle.apps.fnd.flexj.Flexfield getFlexfield() Returns the underlying FlexField

or returns null on error

protected Boolean addSegmentBean(oracle.apps.fnd.flexj.Segment

Seg)

add a segment to Flex field

protected void removeSegmentBean(oracle.apps.fnd.flexj.Segment

Seg)

removes a segment

Field Bean

The FieldBean is the base class for all user developed field level beans. Examples of FieldBeans are

TextFieldBean, ButtonFieldBean, LOVFieldBean, MultiListFieldBean, ListFieldBean, HeadingFieldBean,

and SeparatorFieldBean.