D93509GC10 Ag

Download as pdf or txt
Download as pdf or txt
You are on page 1of 180

Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Oracle SOA Suite 12c: New
Features and Capabilities
Activity Guide
D93509GC10
Edition 1.0 | March 2016 | D95084

Learn more from Oracle University at oracle.com/education/


Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Disclaimer

This document contains proprietary information and is protected by copyright and other intellectual property laws. You may copy and
print this document solely for your own use in an Oracle training course. The document may not be modified or altered in any way.
Except where your use constitutes "fair use" under copyright law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express authorization
of Oracle.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The information contained in this document is subject to change without notice. If you find any problems in the document, please
report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This document is not
warranted to be error-free.

Restricted Rights Notice

If this documentation is delivered to the United States Government or anyone using the documentation on behalf of the United
States Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS


The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are restricted
by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
a
Trademark Notice
) has
c o mrespective

n ideฺ
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their
owners.
o
t i
t e lla t Gu
Author
o n s den
@ c Stu
David Mills
i
Technical Contributors and Reviewers ulk
arn e this
Jeff Picchione, Takyiu Liu, Bill Albertakฺ
k o us
e p e t
de iOracle e n s
This book was published i
n le ( using: l c Tutor
a r
K ulk ferab
p a k ans
e tr
De non-
Table of Contents
Practices for Lesson 1: Overview ...................................................................................................................1-1
Practices for Lesson 1....................................................................................................................................1-2
Practices for Lesson 2: Quick Start for Developers......................................................................................2-1
Practices for Lesson 2: Quick Start for Developers ........................................................................................2-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practice 2-1: Starting JDeveloper and Configuring the Integrated WebLogic Server (35 minutes) ................2-3
Practice 2-2: Installing and Configuring a Stand-Alone Domain (Optional) (25 minutes) ...............................2-8
Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c ...........................................................3-1
Practices for Lesson 3: Getting Familiar with Oracle SOA Suite 12c .............................................................3-2
Practice 3-1: Deploying and Testing a SOA Composite (Review) (15 minutes) .............................................3-3
Practice 3-2: Migrating a SOA 11g Composite to 12c with JDeveloper (15 minutes) .....................................3-9
Practice 3-3: Migrating a SOA 11g Composite to 12c with EM FMWC (10 minutes) .....................................3-12
Practice 3-4: Viewing and Testing the New Features in EM FMWC (25 minutes).........................................3-13
a
has
Practices for Lesson 4: JDeveloper: New Features ......................................................................................4-1
Practices for Lesson 4: New JDeveloper Features ........................................................................................4-2
)
Practice 4-1: Exploring Changes in the Composite Folder Structure and Windows Lists, and Refactoring
ฺ c om theฺ
t i o n ide
Composite (15 minutes) .................................................................................................................................4-3
Practice 4-2: Creating TODO Tasks and Using the Find Capability (15 minutes) .........................................4-7
e G u
lla..................................4-10
Practice 4-3: Managing Shared Artifacts Using Design-Time SOA-MDS (25 minutes)
n t
s den t
o
c Stu
Practice 4-4: Exploring Dependencies (10 minutes) ......................................................................................4-18
i @
arn e this
Practices for Lesson 5: Testing and Debugging ...........................................................................................5-1

l k
Practices for Lesson 5: Testing and Debugging .............................................................................................5-2
Practice 5-1: Setting Up and Deploying the CCValidate
k ฺ ku Project o us(10(15minutes) ..............................................5-3

e a in t
p se(20 minutes) ...................................................................5-10
Practice 5-2: Debugging a Composite Application JDeveloper minutes) ............................................5-5
Practice 5-3: Creating Test Suitese
i ( d icen
and Test Cases

a r
Practices for Lesson 6: BPELn Editor: l e l Features ....................................................................................6-1
New

Practice k
ulk 6: BPEL
Practices for Lesson
6-1:K f
ExploringstheeNew
b New Features ......................................................................................6-2
raEditor:
Features in the BPEL Editor (20 minutes) ..................................................6-3
a
ep 6-2: n
ePractice n - tra a Correlation Set (15 minutes) ....................................................................................6-9
Creating
DPractices
nofor Lesson 7: Transformations ......................................................................................................7-1
Practice 7-1: Transforming XML Data with XQuery and XSLT (25 minutes) .................................................7-2
Practices for Lesson 8: Protecting PII Data ...................................................................................................8-1
Practice 8-1: Setting Up and Deploying the CCValidate Project (5 minutes) ................................................8-2
Practice 8-2: Encrypting and Decrypting Specific Message Fields (20 minutes) ...........................................8-4
Practices for Lesson 9: Fault Policy Wizard ..................................................................................................9-1
Practice 9-1: Using the Fault Policy Wizard (20 minutes) ..............................................................................9-2
Practices for Lesson 10: REST Binding Wizard ............................................................................................10-1
Practices for Lesson 10: Overview .................................................................................................................10-2
Practice 10-1: Creating a REST Service Interface (HTTP Post) (15 minutes) ..............................................10-3
Practice 10-2: Creating and Configuring a REST Reference Interface (15 minutes)......................................10-10
Practice 10-3: Deploying and Testing the Composite Application (10 minutes) ............................................10-16
Practice 10-4: Creating a REST Service Interface (HTTP Get) (15 minutes) ................................................10-18
Practices for Lesson 11: New Adapters and MFT .........................................................................................11-1
Practices for Lesson 11..................................................................................................................................11-2
Practices for Lesson 12: Templates and BPEL Subprocesses ....................................................................12-1
Practices for Lesson 12: Templates and Subprocesses ................................................................................12-2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Oracle SOA Suite 12c: New Features and Capabilities Table of Contents
iii
Practice 12-1: Creating and Using SOA Composite Templates (10 minutes) ...............................................12-3
Practice 12-2: Creating and Using Service Component Templates (15 minutes) .........................................12-5
Practice 12-3: Creating and Using BPEL Scope Templates (25 minutes) .....................................................12-8
Practice 12-4: Creating and Using BPEL Stand-Alone and Inline Subprocesses (30 minutes) ......................12-14
Additional Practices: Sharing Functionality in Oracle SOA Suite ...............................................................13-1
Overview ........................................................................................................................................................13-2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Practice A-1: Setting Up Dependencies for the New OrderFlow Project ........................................................13-3
Practice A-2: Using a BPEL Component Template and a Subprocess ..........................................................13-8
Practice A-3: Deploying and Testing the OrderFlow Composite ....................................................................13-17

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Oracle SOA Suite 12c: New Features and Capabilities Table of Contents
iv
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
t
Practices nfor
s Lesson e t
n 1:
Overview o
c Stu d
i @
l k arn e1 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Overview


Chapter 1 - Page 1
Practices for Lesson 1

There are no practices for this lesson.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 1: Overview


Chapter 1 - Page 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfort
s Lesson e t
n 2: Quick
Start@ foro
c Developers
tu d
i S
l k arn e2 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 1
Practices for Lesson 2: Quick Start for Developers

Practices Overview
The Oracle SOA Suite Quick Start distribution allows you to quickly install a development or an
evaluation environment on a single-host computer. Quick Starts are installations for
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

development or evaluation only. If you want a production environment, start with “Planning the
Oracle SOA Suite and Business Process Management Installation” in Installing and Configuring
Oracle SOA Suite and Business Process Management to install a full-scale development
environment that can be scaled to a production environment.
In these practices, you are guided through the launching of JDeveloper, automatically
registering the IDE plug-ins for Oracle SOA Suite.
The SOA Suite and BPM Suite 12c Developer installation contains the following:
• JDeveloper
• WebLogic Server a
• SOA Suite and BPM Suite runtime components
) has
− BPM, BPEL, Human Workflow, Rules, and Mediator
ฺ c om ฺ
− Service Bus
t i o n ide
t e lla t Gu
• JDeveloper IDE plug-ins for the preceding components
o n s den
All software has been installed in a single middleware home directory.
@ c Stu
i
In JDeveloper, the WebLogic Integrated Server is preconfigured with the preceding SOA Suite

l k arn e this
runtime components and JavaDB. JavaDB is a development database that allows you to start

k ฺ ku o us
development with SOA Suite without the need to run the repository creation utility (RCU).

p a et
Your environment looks like the following on the hosted server when you have finished:
e
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 2
Practice 2-1: Starting JDeveloper and Configuring the Integrated
WebLogic Server (35 minutes)
Tasks
1. Start JDeveloper.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: You may use the desktop shortcut or follow the manual process below if you prefer.
a. For the Quick Start distribution, all software is installed in the single middleware home
directory: /u01/app/oracle/fmw
• Create an environment variable and set it to this directory:
export FMW_HOME=/u01/app/oracle/fmw
To verify that you have set it correctly, enter the following command:
echo $FMW_HOME
(You should see the above home directory in the output.)
a
has
b. In the terminal window, issue the following command to start JDeveloper:
$FMW_HOME/jdeveloper/jdev/bin/jdev )
JDeveloper is started. The Select Role dialog box opens. ฺ c om ฺ
t i o n ide
lla t Gu
2. To configure JDeveloper defaults, perform the following steps:
t e
s den
a. Deselect the Always prompt for role selection on startup check box.
o n
c Stu
b. To accept the Studio Developer (default) role, click OK.
i @
arn e this
The Confirm Import Preferences dialog box is displayed.
l k
ku o us
c. Click No.
k ฺ
a et
The Oracle Usage Tracking dialog box is displayed.
e p
i ( de icens
d. Deselect the Allow automated usage reporting to Oracle check box.
e. Click OK.
a r n le l
ulk ferab
JDeveloper opens and displays the Start Page tab.
K
p a k ans
f. Deselect the Show on Startup check box and close the Start page.
e tr
Note: In 12c, JDeveloper automatically scans the middleware directory and registers all the
De non-
IDE plug-ins. Unlike earlier releases, you do not have to download them separately. When
JDeveloper comes up, it is ready for SOA Suite development.

3. Set JDeveloper preferences.


a. In the JDeveloper menu, select Tools > Preferences.
The Preferences dialog box is displayed.
b. Navigate to Code Editor > Line Gutter.
c. Select the Show Line Numbers check box.
d. Click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 3
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
4. Update the /etc/hosts file.
ฺ c om ฺ
a. Open a new Terminal and su as root. (The password is oracle.)
t i o n ide
>su – t e lla t Gu
Password: o n s den
@ c Stu
i
arn with hisinstructor if you need help.)
#
l k
b. Use vi to edit the /etc/hosts file. (Consult
e t
your
# vi /etc/hosts k ฺ ku o us
e p a e t 127.0.0.1), insert an additional host name
c. At the end of the first line
i (
used for this course: c e ns
(which contains
desoa12c.example.com
r n e
and exitlthe
i
lTerminal.
a
ulk ferab
d. Save the file
K
kthe Integrated
s WebLogic Server and configure a domain.
p a
5. Start
e nLaunchingr a n
De Note:
o -t the Integrated WebLogic Server from JDeveloper generates a domain,
n is designated
which as the default domain. However, you also have the option of launching
a JDeveloper-independent version of the WebLogic Server to configure a stand-alone
domain. For more information, see “Configuring a Domain” in Installing SOA Suite and
Business Process Management Suite Quick Start for Developers.
a. In the JDeveloper main menu, select Run > Start Server Instance.
The Create Default Domain dialog box opens.
b. Provide and confirm the password: welcome1
c. Click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
den be patient.) You
ons tu(Please
Domain creation begins. This takes about 12-15cminutes.

bottom center of the JDeveloper screen.a r ni@ this S


can monitor the progress in the Running: IntegratedWebLogicServer pane at the

k u lk se
p a kฺ to u
( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D no

6. Verify your domain.


a. Open a web browser and access Enterprise Manager Fusion Middleware Control,
which is located at http://localhost:7101/em.
Note: The browser shortcuts on the menu bar are using 7001 (not 7101) as the listen
port. You will need to change these shortcuts to reflect 7101 if you want to use them.
b. Log in by using the username weblogic and password welcome1.
You are logged in to DefaultDomain. The server status is shown as Up.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 5
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
c. Log out of Enterprise Manager.
l a t io uid
s t el nt G
7. Disable Secure Sockets Layer (SSL).
c on tude
a
design-time requirements, and some laterkpractices h is SWe do not have stringent
rni@aretServer.
SSL is enabled by default in the Integrated WebLogic

ul steps:
simplified by not using it. Therefore,
ฺ k
we disable SSL by performing the following u s e
p
a. Go to the Administrator Console
e ak atehttp://localhost:7101/console.
to
e eonnthe
dshortcuts s menu bar are using 7001 (not 7101) as the listen
Note: The browser
port. You willrn i ( c
li these shortcuts to reflect 7101 if you want to use them.
a
lkusing the l e
need to change
b. Log inuby
K f e rabusername weblogic and password welcome1.
p k the Domain
c. aIn
a n s Structure pane, click Environment > Servers.
e Innthe r
-t main pane, click DefaultServer(admin).
De d.e.noDeselect SSL Listen Port Enabled.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 6
f. Click Save.
g. Log out of the WebLogic Server Administration Console.
h. From the JDeveloper main menu, stop and restart the Integrated WebLogic Server.
• Select Run > Terminate > IntegratedWebLogicServer.
• Select Run > Start Server Instance (IntegratedWebLogicServer).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note: Do not restart the server instance if you plan to move directly to Practice 2-2.

Summary
In this practice, you have completed the one-time task of setting up the development
environment for Oracle SOA Suite. You have also been introduced to several tasks that you
execute repeatedly in this course, including:
• Accessing Enterprise Manager Fusion Middleware Console
• Accessing WebLogic Server Console
• Starting and stopping the Integrated WebLogic Server a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 7
Practice 2-2: Installing and Configuring a Stand-Alone Domain
(Optional) (25 minutes)
Overview
In this practice, you set up a stand-alone version of the WebLogic Server and domain, and
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

create a connection to it in JDeveloper.

Tasks
Note: Because this is an optional exercise, it is imperative that before configuring and
starting another WebLogic server domain on this machine, you first shut down the
Integrated WebLogic Server [Default domain] if it is running.
• In JDeveloper, go to the Application Servers tab, right-click the
IntegratedWebLogicServer node and select Terminate Server Instance.
Note: If the Applications Servers tab is not visible, from the menu bar, select Windows >
Application Servers. s a
)h a
m
co to:eฺ
1. Open a terminal window (Applications > System Tools > Terminal) and navigate
n ฺ
cd /u01/app/oracle/fmw/soa/common/bin
l a t io uid
s t el nt G
Execute the following commands: c on tude
a. First, set and export the Quick Start Templates
r ni@environment
i s S variable:
Caution: Copy and Paste from PDF lcan a
k cause e h
t to not work correctly. If you want to
k u s this
u first, remove the extra line feed, and
copy and paste, copy and paste
then copy and paste from p a ktextฺtoeditor.
a text editor
t o
ee ense
the

i
export QS_TEMPLATES= ( d ic
r n l e l
lka r<return>
"/u01/app/oracle/fmw/soa/common/templates/wls/oracle.soa_template
K u
_12.1.3.jar"
f e ab
p a k $QS_TEMPLATES
echo
a n s
e n-t r
De b.noLaunch the Quick Start Configuration Wizard:
./qs_config.sh <return>

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
The installer begins. ฺ c om ฺ
t i o n ideand
lla t Gu
2. Enter the password welcome1 and confirm it. Leave the other settings as they are
click Create. t e
sto create n
Note the default ports. This configuration wizard allows o
c n
you d ea stand-alone domain
and choose your own directories for the files andi@ tu This domain uses a
ports for theSservers.
Derby database that is already preconfigured.
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 9
3. When the domain is created successfully, click Next.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

4. Select the Start Domain check box to start base_domain. Click Finish.

5. Test the WebLogic Server.


a. The stand-alone WebLogic Server starts to run.
It will take a few minutes to start, because the SOA infrastructure applications start
up as part of the Admin server. When the terminal prompt has returned, the server
startup is complete (running in the background).

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 10
b. Open a web browser and access Enterprise Manager Fusion Middleware Control,
which is located at http://localhost:7001/em.
c. Log in by using the username weblogic and password welcome1.
You are logged in to base_domain. The server status is shown as Up.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

6. Create a connection to this server in JDeveloper.


a. In JDeveloper, select Window > Application Servers from the main menu.
Right-click Application Servers and select New Application Server to start the wizard.

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
b. To complete the wizard, use the following settings, c n Next
oclickingt u deto advance:
r
Usage: Standalone Server (selected by default)
a ni@thclickis S Next
Connection Name: standalone uclick l k Nextse
Password: welcome1  click a k ฺk
Next to
u
p
ee Defaults se  click Next
d
Accept all the Configuration
( e n
r n
c. Test the connection.
e ic see all successes. Then click Finish.
i You lshould
Now, u lkstand-alone l
a ab server would be running even if you terminated JDeveloper.
erAdministration Server window, expand standalone and the SOA
the
k K still insthe
f
aWhile
ep hierarchy
r anuntil you get to the default. Right-click default and select Refresh. If you were
e - t
n this server for development, you would need to refresh after deployments,
D nousing
because JDeveloper does not automatically refresh connections.

7. Shut down the stand-alone domain server.


a. Because you will not be using this server for your practice exercises, shut down the
server instance using the WebLogic Administration console
http://localhost:7001/console. Click Force Shutdown Now as shown in the following:

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
b. Close all browser windows. t e lla t Gu
o n s minutes
two fulld e n to ensure that
c Stu
Note: Before proceeding to the next step, wait for
@
the server is fully shut down. i
arn e (that
c. Check to see whether the Java DerbykDatabase
l t hiswas started on port 1527 for this
kuwill oneed
domain) was shut down. If not, ฺyou
k usto terminate that process as well.
a t
eep ense
Open a terminal and execute:
ps –ef | grep(d derby
If you see aar ni (as
process l e lic in the following screenshot), kill that process ID, for
shown
ulk ferab
example:
K
p a k -9
kill
a n s
19887
e t r
De non-

d. You should now also restart the Integrated WebLogic Server that you shut down at the
start of this practice.
In JDeveloper, go to the Application Servers tab, right-click the IntegratedWebLogicServer
node and select Start Server Instance.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 2: Quick Start for Developers


Chapter 2 - Page 12
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfor t
s Lesson e t
n 3:
Getting o
cStarted d
tu with Oracle
i @ S
l k arn Suite
SOA
e t his12c
k ฺ ku Chapter
o us3
e a
p se t
( e
d icen
r i
n le l
a
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 1
Practices for Lesson 3: Getting Familiar with Oracle SOA Suite 12c
Practices Overview
In these practices, you deploy a SOA composite application to the integrated server, and then
use Oracle Enterprise Manager 12c Fusion Middleware Control console to initiate the deployed
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

SOA composite and inspect the composite’s instance.


You continue with converting an 11g composite to 12c, and then deploying and testing the
composite.
Finally, you navigate the new GUI of the Fusion Middleware Control.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 2
Practice 3-1: Deploying and Testing a SOA Composite (Review)
(15 minutes)
Overview
In this practice, you deploy the ValidatePayment composite application to the Integrated
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

WebLogic Server, initiate an instance, and examine the process flow in Oracle Enterprise
Manager Fusion Middleware Control.

Assumption
The Integrated WebLogic Server is up and running.

Tasks
High-level steps:
• Deploying the ValidatePayment composite application using a command
a
• Testing and examining the deployed composite
) has
Deploying the Composite
ฺ c om ฺ
1. In a terminal window, enter the following commands: t i o n ide
cd /home/oracle/NewFeatures12c/SOA/apps t e lla t Gu
o n s den
ls –l
@ c Stu
./deploy.sh sca_ValidatePayment_rev1.0.jar i
n thinisthe terminal. You should see a
2. The build and deployment information will l k ardisplayed
be
e successfully.
ฺ k
message showing both build and deploying u executed
u s
e p ak e to
d
Testing and Examining the Deployed s
e enComposite
i (
n composite, c
li all available credit cards are stored in the database,
a r
For the ValidatePayment
l e
including payment
u lk rab
type, card number, expiry date, card name, and daily limit.
k K process
The validation s feincludes three steps:
a
e1)p First, n
a payment information is retrieved from the database, using the credit card
n-tr quoted in the order message as the key. If there is no data available with this
the
De nonumber
credit card number, payment is denied.
2) If data for the credit card number is available, the expiry date in the database record is
compared to the expiry date listed in the order message. If they are not the same, the
payment is also denied.
3) The last check compares whether the total order amount is less than the daily limit on
the credit card in the database.
If all tests are successful, the payment is authorized. Otherwise, it is denied.
3. Examine the SOA composite application.
a. Go to the Fusion Middleware Control console, and in the Target Navigation panel,
expand SOA > soa-infra > default. Now you should see the deployed ValidatePayment
[1.0] composite application.
b. Click the ValidatePayment [1.0] link. The home page (Dashboard tab page) for the
selected SOA composite application is displayed. You can view the service
components, and service and reference binding components included in the
composite.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 3
Note: This page also enables you to perform composite management tasks such as
retire, activate, shut down, start up, and test.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c a graphical
S tu display of the SOA
c. Click the Composite Definition tab. You should
i see
is 12c. This view is similar to the
l k arinnJDeveloper
composite applications designed in Oracle
e t hJDeveloper.
k ฺ ku o us
display of the SOA composite application Oracle

e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Here you can see that the implementation of this service uses a BPEL process to
receive the incoming payment information and then retrieve the credit card data from
the database, and perform the tests outlined in step 2.
4. Initiate and test the SOA composite application.
a. On the ValidatePayment [1.0] home page, click Test.
b. On the Test Web Service page, accept all default settings. Make sure that the Request
tab is selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
c. Scroll down to the Input Argumentslk arn e this
u us
ฺkhave
section.
k
To enter XML payload data,ayou
p o of selecting Tree View (default) or XML
toptions
View. e e
ns interface of text fields in which to enter
( de aicgraphical
• Tree View:iDisplays e
a r n le l
ulkView: ab the XML file format for inserting values. You can paste the
information
• KXML f e rDisplays
p a k rawaXML
n s payload of your message into this field.
e t r
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 5
d. Select XML View. You should see the web service invocation payload in XML format.
Tip: You can easily copy-and-paste your data into the XML View.
e. To load the test message, click Browse next to the Load Payload field, and select the
PaymentInfoSample_Authorized_soap.xml file located at:
/home/oracle/NewFeatures12c/SOA/files/resources/sample_input
This file already includes the SOAP message needed for the web service test.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ kucomposite
o uscompletes, the screen switches to the
f. Click Test Web Service. When a
p valuethe t
e e
Response tab and the returned
d e n se is shown (similar to the screenshot below).
n i ( l ic
r l e
u lka rab
k K sfe
a
ep n-tran
e
D no

g. Review the response message, and you should see that the payment status is
Authorized.
Note: You can also switch to Tree View to view the result.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 6
5. From here, you launch the Flow Trace of this instance.
a. Click Launch Flow Trace.
The Flow Trace window opens. You can see the flow of the composite and the status
of each service, component, and reference.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
ฺku todetailed
b. Click the BPEL process linkatokview the
us execution trail.
e e pprocessseactivities is displayed in a new window.
i ( d icen
The audit trail of the BPEL

a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 7
1) Click ViewPayload under receiveInput. What is the Authorization Amount?
2) Click ViewPayload under getPaymentInformation. Examine the message and
answer the following questions:
• What is the input variable?
• What is the output variable?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

• What is the dailyLimit of the credit card?


Tip: Make a note of the values of input and output variables. This information will
be used when you examine the composite structure/assembly model (in order to
understand how the composite work) in later practices.
3) Click ViewPayload under replyOutput to view the payment status.
c. You can also click the Flow tab to view the process flow.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 8
Practice 3-2: Migrating a SOA 11g Composite to 12c with JDeveloper
(15 minutes)
Assumption
The Integrated WebLogic Server is up and running.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
High-level steps:
• Create a new 12c workspace in JDeveloper.
• Copy the 11g Project files into the new workspace.
• Deploy and test the migrated composite application.

Creating a New SOA Workspace in JDeveloper


1. In JDeveloper, from the menu bar, select File > New > Application.
s a
) h a
2. From the NewGallery dialog box, select SOA Application. Click OK. m
co eฺ
n ฺ
l a t io uid
3. Use Hello12cWorkspace for Application Name. Click Finish.
s t el nt G
c on tude
project willSbe created.
4. After a few seconds, a new empty SOA composite
a r ni@ t his
Close the Project1 tab in the main window.
l k e
Click Yes when prompted to save changes.
k ฺ ku o us
e p a et
e in the
dnode e s
nApplications
5. Right-click the Project1
n i ( l i c pane, and select Delete Project. Select the
Remove project
k a r
and
b l
delete eall its contents (including course directories) option. Click Yes.
l
k Ku delete.
Confirm the
s f era
e p a the 11gr anProject into the New 12c Workspace
Copying
e - t
on JDeveloper and open a terminal window. Copy the HelloComposite11g project
D6. Minimize
n
into your new workspace.
Enter the following commands:
cd /home/oracle/NewFeatures12c/SOA/apps/11gProjects
ls –l
cp –r HelloComposite11g/ ~/jdeveloper/mywork/Hello12cWorkspace

7. Return to JDeveloper. Click the drop-down arrow on the far right and select Open Project.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
8. Open the HelloWorldComposite.jpr file located at:
) has
/home/oracle/jdeveloper/mywork/Hello12cWorkspace/HelloComposite11g
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

9. You will be presented with an Open Warning dialog box that actually performs the
appropriate migration of the files from 11g to 12c. Click Yes.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 10
10. After a few moments (30-90 seconds), the project will now be visible in the Applications
pane.

11. Open the composite.xml file for HelloWorldComposite for viewing.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
12. Take a few moments to examine the simple logic of this composite application.
t i o n ide
t e l la t Gu
Deploying and Testing the Migrated Composite Applications
o n d e n
13. Right-click the HelloWorldComposite project node in the
@ c Applications
S tu pane and select
i
Deploy > HelloWorldComposite.
l k e t his Server.” Click Next.
artonApplication
ฺkuOverwrite
14. In the Deployment Action box, select “Deploy
15. In the Deploy Configuration box,aselectk t o usany existing composites with same
revision ID. Click Next.
e e p se
(
16. In the Select Server ibox, e n
d selecticIntegratedWebLogicServer.
17. Validate that k r n
a deployment l e l Click Finish.

Control Kand
b was home
ullocatefetheracomposite
the successful. Return to the Enterprise Manager FMW
page for this new deployment.
a k
p the-tTest
18. Click s
anbutton.
e e r
D19. (or onother
Expand
nany
the request node in SOAP Body in the Input Arguments section. Enter your name
string) as the input value.
20. Click Test Web Service.
21. The response is returned. Click Launch Flow Trace to examine the details of this instance.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 11
Practice 3-3: Migrating a SOA 11g Composite to 12c with EM FMWC
(10 minutes)
Assumption
The Integrated WebLogic Server is up and running.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
High-level steps:
• Deploy the StockFaultSynch 11g composite application directly using the Oracle
Enterprise Manager 12c FMW Control web application.
• Deploy the TestStockFaultSync 12c composite application using a deploy script.
• Test and validate the deployed composites.

Deploying the 11g composite a


1. Using the Enterprise Manager FMWC, deploy an 11g SAR
) has
(sca_StockFaultSynch_rev1.0.jar), located at
ฺ c om ฺ
/home/oracle/NewFeatures12c/SOA/apps/11gProjects to the default partition.
t i o n ide
t e lla t Gu
2. You should see a message showing that the deployment executed successfully.

Deploying the 12c test composite o n s den


@ c Stu
i
3. In a terminal window, enter the following commands:
l k
cd /home/oracle/NewFeatures12c/SOA/apps arn e this
ls –l
k ฺ ku o us
e p a et
nswill be displayed in the terminal. You should see a
./deploy.sh sca_TestStockFaultSync_rev1.0.jar
i ( deinformation
c e
4. The build and deployment
a
message showing r nboth build
l e li deployment executed successfully.
and
u lk rab
k
Testing theK s fe
deployments
a
p -the n
5. eLaunch traEM FMW Control in a browser window: http://localhost:7101/em
D6.e Execute
n
no a test of the TestStockFaultSync composite.
a. Use the value orcl for the stockID in the payload.
b. It may take up to one minute (the very first time), but verify that the response is
returned successfully.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 12
Practice 3-4: Viewing and Testing the New Features in EM FMWC
(25 minutes)
Overview
In this practice, you explore the new user interface parts of EM FMWC.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. View the composite in the EM FMWC Dashboard.
a. Log in to EM FMWC at http://localhost:7101/em.
b. Expand SOA > soa-infra > default and select the deployed composite
TestStockFaultSync. Test it again with a payload of orcl.
c. From the TestStockFaultSync > Home > Dashboard, notice the green arrow to the left
of the composite name indicating that the composite is Active.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
d. Click the Target Information symbol to the right of the composite name to view
detailed version, location, and other information about the composite.

e. What server is it deployed on? What SOA partition? What host? Close the Target
Information dialog box.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 13
f. View the Dashboard tab. The Dashboard displays the components for this composite
TestStockFaultSync and its services and references: teststockfaultsync_client_ep
and StockFaultSynceSvc. Click the TestStockFaultSync link in the Components section
to see its details.
g. The Activity Time Distribution appears. Note the count for each activity and its Average
Execution Time.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
r ni@Click i s S
h. Note the Instance Rate Per Minute as aagraph.
l k15-seconde h
tincrements.
the Table View link to view the
Instance Rate in the form of a table u
ฺkthe View
in
u s Notice also that each
column is sortable. You canause
p k o
t the dialog box when done. > Unnamed Column
option: View > Columns
e s e
i ( deicon toicthe
> to hide and show the columns.
e nright
Close

r n
i. Click the Information
l e l of StockInfo (BPEL Component).

u lka rab
k K sfe
a
ep n-tran
e
D no

j. Click Source to view the BPEL source code.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

k. Use Find to find all the lines with “Assign.” Do not hit <return> or click OK. Instead,
click the Find Next blue arrow next to the binoculars icon.
s a
l. Use Go to Line to jump to line 35.
)h a
m. Use the Find Binoculars to find all occurrences of “ID.” m
co eฺ
n ฺ
n. Click OK to dismiss the Source window.
l a t io uid
t el nt G
o. View the Sensor Definitions and Sensor Action Definitions.
s
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r ni lehaslicno sensors defined. If you had a complex BPEL component
p. This BPELacomponent
ulk fsensor
with multiple
K e r abactions and definitions, how could you locate a particular definition
p a k this window?
in
a n s
e Hint: r
n-tOK
De q.noClick
Same as searching the source.
to close the Sensor Definition window.

2. View composite instances and fault information.


a. Click the SOA Composite pull-down and select Home > Dashboard to return to the
composite Home, or select the composite itself.
b. Under Services and References, click the teststockfaultsync_client_ep link.
c. Note the Instances and Faults displayed as a graph. Also note that a Table View is
available here as well. Click the Table View link to view the information.
d. Click the Properties tab. Note the different settings that can be enabled or disabled.
e. Note the Maximum Request Size. What is it set to? What does this value mean?

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Hint: Click in the text field and note the pop-up message.
s a
) ha
m
3. Click the Target Information icon again, and then the fully qualified compositeoname. Where
does this take you? Answer: Back to the Composite Home page Dashboard
o n ฺc tab eฺ
l l a ti u id
s te ent G
4. Search for composite and instances information.
co S n d is displayed?
a. On the composite Home, click the Composite@
i Definition tuWhat
tab.
b. Click the Source tab below the diagram.
l k aWhat
e t his Notice you can easily
rn is displayed?
resize the diagram as needed. u
a k ฺk to us
e p
c. Back on the Design tab, click the TestStockFaultSync
s e image. Note that the Isolate icon

i ( de icen
appears. Click the Isolate icon.

a r n le l
K ulk ferab
p a k ans
e tr
De non-
Note that this shows just the selected component.
d. Select the large isolated TestStockFaultSync icon and click the Additional Links icon.

Note that this displays the other components to which this component is connected.
e. Click the Flow Instances tab.
f. The Search Option pane slides out.
Hint: If the pane does not slide out, click the Spyglass.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 16
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
g. Click the Search button. What is displayed?
o n s deselect n Recent
h. From Search Options, the green plus sign (+) with
@ c Stu
the pull-down,
i
rn this
Instances. What happens when you select this?
i. Are there any other Search Options?lka
ฺ k s e the custom search values, and
uvalues,usave
bookmark the search page.
e p ak e to
Note that you can reset the search

i ( de icens
5. Search for anda r
view l e l
n fault information.
a. TestK ulkTestStockFaultSync
the
f e rab composite this time with the value msft. Then test
p a k
again
a
withn s
the values orcl, goog, and ibm.
e t r
n- msft, goog, and ibm will cause faults. This is as designed for the practice.
De noNote:
b. Return to the Composite home page and click the Flow Instances tab.
c. Search for composites created in the last 2 minutes, 8 minutes, and 15 minutes.
d. Click the Custom Time Period to create your own defined range of date and time to
search within. What happens when you select this? Deselect this check box when you
are done viewing the options.
What States can you search for? What Time Options can you filter for? What faults can
you search for? Select More Options to see additional search options.
e. Select each fault and notice the change in the Search options for that fault.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 17
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e u
lla arettheGdifferent
s t
f. Choose All Faults for the fault. What fault types are there? What
n Fault
Owners?
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D g.noLeave the Fault Owner set to component and select the Name pull-down. What, if any,
Fault Owners are there?
h. Change the Fault Owner to Mediator and select the Name pull-down again. Is there
any change? Why?
i. Click the Spyglass to hide the Search panel.

6. View sensor information.


a. Click one of the composite instances Flow ID in the Search Results table. Hint: If no
composite instances are displayed, click the Recent Instances link. Note that the
composite instances details appear below.
b. Display the composite sensor values for this instance by clicking the Composite Sensor
Values tab.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 18
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

c. Click the Composites tab. What is this composite’s sequence in the flow? When did the
flow enter the composite?
d. Close the Flow Trace window.
e. Use the Hide Details icon to toggle detail display on and off.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c instance.
S tu The Flow Trace
i
arn e this
f. Click the Flow ID again for the most recent composite
window appears.
l k
ku to otheuFlow
g. Click the More Information iconฺnext
k s Trace title. Note the information
e p a
displayed. Note that the correlation
eID tand ECID have been moved to this area.
de icen s
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-

h. Under Trace, select Actions > Flowtrace XML to view the XML for the flowtrace. Close
this window when done.
i. View the instance IDs for the components of this composite by selecting the Show
Instance IDs check box.
j. Click the GetStock component in the trace. Click the More Information icon next to the
Instance of GetStock title.

Note the information displayed.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 19
7. View the changing composite state.
a. Shut down the TestStockFaultSync composite. Note that the arrow changes to red,
indicating the composite is no longer active. Start up the composite.
b. From the Home Dashboard, click the TestStockFaultSync BPEL component link.
c. Note the Related Links. Select SOA-Infra Home to navigate to the SOA Infra
Dashboard.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

d. Click the Error Hospital tab. Click Search. What do you see?
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 3: Getting Started with Oracle SOA Suite 12c
Chapter 3 - Page 20
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfor
s Lesson
t e n 4:
t
o
JDeveloper:
c SNew d
tu Features
i @
l k arn e4 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 1
Practices for Lesson 4: New JDeveloper Features
Practices Overview
In these practices, you explore the changes in the composite project file structure, create TODO
tasks, refactor components and their artifacts, and manage shared design-time artifacts by
using the design-time MDS repository.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

These practices include the following tasks:


• Reviewing changes in the composite folder structure
• Choosing the directory for artifacts
• Creating TODO tasks for a composite and for its BPEL components
• Refactoring components and their artifacts
• Managing shared design-time artifacts using the SOA Design-Time MDS Repository

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 2
Practice 4-1: Exploring Changes in the Composite Folder Structure
and Windows Lists, and Refactoring the Composite (15 minutes)
Tasks
1. Close the Hello12Workspace application in JDeveloper.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

2. Open another JDeveloper application SOAWorkspace.jws located at:


/home/oracle/NewFeatures12c/SOA/SOAWorkspace

s a
)ha
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n i
Expand the CustomerInfoSvc
e l ic project.
lka rab l
u
Knew folders:
fe BPEL, WSDLs, and Schemas. Take a moment to explore their
3. Notekthe s
a n
p -tInraJDeveloper 12c, you can choose where to store artifacts and components.
econtents.
D4.e Right-click
non the CustomerInfoSvc composite file and select Open to open it in the main editor
window.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 3
5. Select Window > Structure. Notice that the structure of the composite is shown in the
Structure window. If you do not see the structure displayed, click the composite diagram.
Expand the folders for BPEL Processes and Services.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
6. In the composite editor, right-click the BPEL component and select Rename. Rename
) hait s
CustData.
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
a
7. Does
p kthe Structure
a n s window reflect this name change or does the asset appear in the BPEL
r
efoldernin-the
t Applications window? Answer: No.
De Closeo
n the composite editor and reopen it. Now check the Structure window again. The
Structure window has been refreshed to show the new name of the BPEL component.

8. Right-click the BPEL component and select Edit to open it in the BPEL editor. Look at the
editor window and inside the window. What was changed when you renamed the BPEL
component? Answer: Just the name of the main process scope. The file name still remains
RetrieveCustomerData.bpel.

9. Return to the composite editor and try changing the BPEL component name back to its
original name RetrieveCustomerData. Are you able to do this? Why not? Fix the issue
by closing the open BPEL editor, and then complete the renaming.

10. In the Applications window, expand the BPEL folder, then right-click the .bpel file by using
Refactor > Rename.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
• Rename the RetrieveCustomerData.bpel file GetCustData.bpel. Save ) as
hyour
changes.
ฺ c om ฺ
• Reopen the BPEL component in the BPEL editor. What has changed t i o n as a result
i de of
your renaming? l a
el nt G u
s t
BPEL scope, but the file name remains the same.@ Renaming
de renames the main
con Sthetueditor
You can see that renaming a BPEL component in the composite
.bpel file renames the
tab that opens in the editor. a r ni this
• Now change the .bpel file name k u lk RetrieveCustomerData.bpel.
back to u s e

ak e to
e p
11. With the BPEL component
i ( nsBPEL editor, open the Component window. If it is
deopenicinethe
by selectingl the Window > Components menu option.
not visible, open ritn
u lk rable
a
k K in thesBPEL
12. Right-click fe Constructs section of the Components window. From the shortcut
a
p select n
emenu, traIcon View with No Labels. Note how the display changes.
De non-

Now expand the BPEL Services section of the same window. Did your changes affect this
area as well? Answer: No. Each section has its own display options.
• Right-click and select List view. Note the changes. Reset the changed areas of the
window to whichever display suits you best.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 5
13. In the BPEL Services section, look at the services. Are there any services that look new
from the 11g version of SOA Suite?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
Answer: Coherence, JDE, LDAP, MFT, REST, Salesforce, and SAP
e lla tnew.
are
G u
n t
s den
o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 6
Practice 4-2: Creating TODO Tasks and Using the Find Capability
(15 minutes)
Tasks
1. Return to the composite editor and open the CustomerInfoSvc (composite.xml) file in the
Design view.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

2. In the Composite Editor, create two TODO tasks named Refactor BPEL Name and Add
Mediator.
• To do this, click the TODO Tasks icon on the Composite toolbar to open the TODO
dialog box. Then click the green plus (+) sign to create the new tasks. Click Close
when done.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
3. Place the cursor over the TODO icon. What do you notice?

4. Change the TODO task to Change BPEL Name. Did you notice that you have to press
Enter for your change to be applied? Simply closing the TODO dialog box does not apply
your change. Close the window when you are done.

5. Investigate the Source tab for the composite.


• Where are these TODO tasks stored? Can they be changed in the source?
• If so, can you see the changes in the TODO list itself?

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 7
Test this by changing the TODO task item back to Refactor BPEL Name. Save your
changes and return to the Design editor tab. Do you see your change reflected in the
TODO tasks?

6. Add a TODO task by right-clicking the service entry point retrievecustomerdata_client_ep.


Name your TODO task Transfer Assets to Design Time SOA MDS. (Do not forget
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

to press Enter to save your edits before closing the dialog box).

Notice the small TODO Task icon that has been added.

a
7.
has
Reopen the BPEL component editor. Add a TODO task to the main BPEL scope:
RetrieveCustomerData. )
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
Name the task Add Assign.

8. Save your changes. What changes do you see on the diagram as a result of creating the
BPEL TODO? Place your cursor over this new icon. What do you see?

9. Change the BPEL TODO item to Add Assign Activity. (You will need to carefully click
the TODO icon to avoid the arrow coming from the Partner Link.)

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 8
10. Investigate the source for both the composite and the component. Where are these TODO
items stored?
• Use the Find field to search for the text “Assign.” Is it found? How can you tell? If you
place your cursor over the pink indicator on the right side of the editor window, what
does it display?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

11. Click the pull-down to the left of the Find box. What are the options? What are they used
for?

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
Check Match Case and search for assign. l kWhat e t hisDeselect Match Case when you
arnhappens?
are done. k ฺ ku o us
e p a et
de iicon. e s
nWhat
n (
12. Click the Show Blocki Coloringl c happens? What is it trying to show?
r l e
u lka rab
k K sfe
a
ep n-tran
e
D no
Notice that the block shading corresponds to the plus (+) sign or the minus (–) sign to
expand or collapse sections, respectively, in the editor.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 9
Practice 4-3: Managing Shared Artifacts Using Design-Time SOA-MDS
(25 minutes)
Tasks
1. View the SOA Design-Time MDS Repository.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Select the Resources window. If it is not open, open it by selecting Window >
Resources.
b. Expand the IDE Connections window. You should see an entry for SOA MDS. Expand
that node, and then expand SOA_DesignTimeRepository. You see the following
structure: apps.

a
) has
ฺ c om ฺ
t i o n ide
e lla Where
c. Right-click SOA_DesignTimeRepository and view the properties. G u
is the
design-time repository stored? n t
s den t
o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Close this dialog box when you are done.


d. This is a new installation of JDeveloper, and the apps folder is currently empty.
Right-click apps and create a new folder: Stock.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Copy the StockSchema.xsd file from


/home/oracle/NewFeatures12c/SOA/files/xsd into the design-time folder
Stock at the following location: a
/home/oracle/jdeveloper/soamds/apps/Stock ) has
1) Open a terminal window. Enter:
ฺ c om ฺ
cd /home/oracle/NewFeatures12c/SOA/files/xsd
t i o n ide
2) Next, enter the command: t e lla t Gu
n s den
cp StockSchema.xsd ~/jdeveloper/soamds/apps/Stock
o
@ c Stu
e. i
Now return to JDeveloper and expand the Stock folder you just created. You should
l k arn e this
see the StockInfo.xsd file you just copied. If you do not see it, right-click the Stock
folder and select Refresh.
k ฺ ku o us
e p a et
One way to populate the Design Time SOA-MDS is by copying files to the SOA-MDS

i ( de icens
from the file system.

a r n le l
K ulkto the
2. Add an asset
f e r ab Time SOA-MDS and transfer it to the runtime SOA-MDS.
Design
k atonthe
a. Return
p a s CustomerInfoSvc project. Expand the Schemas folder and verify that
e n-tthe r
customerinfo.xsd asset is in the Schemas folder.
De b.noOpen the RetrieveCustomerData.wsdl file. View the source. Where is the
customerinfo.xsd file located?

Answer: ../Schemas/

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 11
c. Right-click the customerinfo.xsd file in the Schemas folder and select Share using
Design-Time MDS Repository.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
Click Next to advance to Choose Target. t i o n ide
d. Select “apps,” and then add a new folder named Customer e llbya usingt the
G u“Create a
folder” button. n t
s den
o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a kneeded,
If
a n s the “apps” folder until you see the Customer folder.
expand
r
e n-t the newly created Customer folder. Note that the following path appears below:
De e.noSelect
/apps/Customer.
Also notice the message at the bottom of the window showing the complete location
where the asset will be stored. Click Next.
Note where the assets will be stored:
oramds:/apps/Customer/customerinfo.xsd
oramds represents the SOA-MDS itself starting at the apps level.
Note: You could overwrite another resource with the same name if you needed to.
Click Next.
f. The References step shows what substitutions will be made. Click Finish and
acknowledge the completed transfer.
g. In the Resources window, right-click Design-time SOA-MDS and select Refresh.
Expand the repository and verify that the asset you added is present in the Customer
folder. You should see the new folder and file you transferred.
h. In the Applications window, expand the Schemas folder for your CustomerInfoSvc
composite. Note that it is now empty. The asset has been physically moved from the
project folder to the SOA Design-Time MDS Repository.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 12
i. Reopen the RetrieveCustomerData.wsdl file. View the source. Where is the
customerinfo.xsd file now located?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

It has been updated to refer to the asset that now resides inside oramds.
s a
j. Attempt to deploy the CustomerInfoSvc composite. Do you think it will succeed?
)ha
Were you right? Check the JDeveloper Log window - Deployment tab. In that log
window, a message redirects you to the server log for more details.
m
co eฺ
n ฺ
l a t io uid
s t el nt G
Answer: Even though the assets have been transferred
c on totthe u e Design-Time MDS
dSOA
r ni@
Repository, they are not available to the runtime S
IntegratedWebLogicServer
i s
DefaultDomain. To make them available,
l k a you must
e t htransfer the Design Time SOA-MDS
to the Run-Time SOA-MDS.
k ฺ ku o us
e p a et
3. To do this, you must have
( d e ens to the file-based Run-Time SOA-MDS. You will now
a connection
i
create this connection.
r n e l ic
a. Start bylk a aanew
creating l
b Resources connection. In the Resources window, select New >
u
IDEKConnections r
fe > SOA-MDS.
a k n s
ep tra
De non-

b. Use any name for this Run-Time SOA-MDS, but make sure to select “File-based.” The
Integrated and stand-alone domains use file-based MDS repositories instead of the
database.
c. Browse to its directory at:
/home/oracle/.jdeveloper/system12.1.3.0.xxxx/DefaultDomain/store
/gmds/mds-soa/soa-infra
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
Test the connection. Click OK.
) has
d. om ฺ
Initially the new Run-Time SOA-MDS contains only some preseeded assets. You are
ฺ c
t i o n ide
going to transfer your assets from the Design-Time SOA-MDS to the Run-Time SOA-
MDS.
t e l la t Gu

o n s den
In the Resources window, under SOA-MDS, right-click SOA_DesignTimeRepository,
and select Transfer.
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

• In the dialog box, expand apps and expand Customer. Note that the
customerinfo.xsd asset you moved to here earlier is shown. Select the check box
for customerinfo.xsd and StockSchema.xsd as well. Make sure the Target
Connection is the Run-Time SOA-MDS and click Transfer.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t io uid
Close the acknowledgement message.
s t el nt G
e. Refresh the Run-Time SOA-MDS. Do you see the new
and XSD assets you transferred? c on tudeand Stock Folders
Customer

r ni@ this S
f. Deploy the project. Does it deploy successfully?
a
You have moved an asset from the k u lk file-based
local s e design-time repository to the stand-

ak repository.
alone server run-time, file-based
u
to This asset can now be easily shared and
reused across composites.e p e
s now see how to do this.
i ( de icYou e nwill
a r n le l
u lk from
4. Reference assets
r a b Design-Time SOA-MDS.
the
K a new
a. Create
k s fecomposite project named CustomerProfile in the same application
a
ep n-tra n
workspace, SOAWorkspace, (File > New > Project > SOA Project).
e
D b.noAdd a simple Synchronous BPEL Process and expose it as a SOAP service. For the
Input and Output variables, first Import the schema from the Type Chooser dialog box,
and then select Design-Time SOA MDS and expand the folders until you find the
Customer folder. Expand the folder and select the customerinfo.xsd file. Select the
customerInfo type for both the Input and Output variables. Refer to the following
screenshots if you need assistance.

• Select Browse Input Files .

• Select Import Schema File .

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

c. View the WSDL for this service. What is the path to the customerinfo.xsd resource?
Answer: oramds:/apps/Customer/customerinfo.xsd
d. Deploy the project. Notice that the deployment succeeds, because the asset was
previously transferred to Run-Time SOA-MDS.
Note: If the deployment fails, you may need to restart the Integrated Server Instance to
recognize the new MDS artifacts.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 16
5. Export the Design-Time SOA-MDS as a JAR file.
a. In the Resources window, right-click the Design-Time SOA-MDS and select “Export to
jar.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Expand the apps hierarchy and select the Customer folder. a


c. Click the Search icon at the bottom of the window, navigate to
) has
customerinfo.jar. Click Open. ฺ c om ฺ
/home/oracle/NewFeatures12c/SOA/files, and enter the name of the JAR:

t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Click OK to create the JAR and click OK again.


d. Use the File Browser to navigate to the
/home/oracle/NewFeatures12c/SOA/files folder and open the JAR file with the
Archive Manager. Drill down into the Customer folder. What did you find?
Answer: Hopefully, you should see the exported customerinfo.jar file.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 17
Practice 4-4: Exploring Dependencies (10 minutes)
Tasks
1. In JDeveloper, expand the WSDLs folder of the CustomerInfoSvc project. Right-click the
RetrieveCustomerData.wsdl file and select Explore Dependencies.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
2. Investigate what is displayed.
a r ni@ this S
What is this WSDL file dependent on? What
k u lk is dependent
s e on it?

ak e to u
e p
i ( de icens
a r n Openleforl the customerinfo.xsd node. What happens? Answer: It
lk displayed
3. Right-click and
uand select
rabin the XSD editor.
K
is opened
k ans f e
p a
e nto-tthe r
D4.e Return
no Dependency Explorer tab. Right-click CustomerInfoSvc and select Explore
Dependencies. What is displayed?

5. Expand RetrieveCustomerData.bpel. What is displayed? Expand


RetrieveCustomerData.wsdl. What is displayed?

6. Click the Filter icon and enter bpel as a Custom Filter Extension.

What happens when you click OK? Answer: The BPEL component dependency is
removed from view.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 18
7. Right-click CustomerInfoSvc and select Show Reference Detail. What is displayed? How
would you use this to better understand the design and dependencies of your composite?

8. Right-click CustomerInfoSvc and select Select in Applications Window. What happens


when you do this? Answer: The node representing the composite.xml file is highlighted in
the Applications pane.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 19
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 4: JDeveloper: New Features


Chapter 4 - Page 20
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
t
Practices nfor
s Lesson e t
n 5:
Testing o d
candSDebugging
tu
i @
l k arn e5 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 1
Practices for Lesson 5: Testing and Debugging
Practices Overview
In these practices, you debug SOA composite applications and BPEL processes with the SOA
debugger, create test suites and their test cases with the SOA Composite Test Wizard, and run
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

test suites from within Oracle JDeveloper.


These practices include the following tasks:
• Debugging SOA composite applications with the SOA debugger
• Creating test suites and their test cases with the SOA Composite Test Wizard
• Running test suites from within Oracle JDeveloper
• Debugging BPEL processes from within JDeveloper

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 2
Practice 5-1: Setting Up and Deploying the CCValidate Project
(10 minutes)
Assumptions/Overview
The tasks in the practice may not be necessary if the soademo tables and data are already
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

populated in the database, and the CCValidate project has already been deployed to your
Integrated WebLogic Server.

Tasks

Creating New Tables and Data in the Database


1. From the JDeveloper menu, select File > Open.
2. Navigate to /home/oracle/NewFeatures12c/SOA/scripts/SQL.
3. Select JDBsoademo_create.sql. Click Open. a
The file is opened in a SQL worksheet.
) has
4. Click the Run Script icon.
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
rn this
l k a
k u use
The Select Connection dialog box is displayed.

5. If a connection has not already been
e p ak created,
e to click the “Create a new connection” icon. If
there is already a SOAWorkspace
(
Driver information. Ifi so,duse c e ns information
e the following
connection, you will probably need to add the JDBC

r n e l i to edit. Otherwise, you may skip to


lka rab
steps 10 and 11. l
u
K sfe
a k
e ep n-tran
D no

6. Enter the following details:


• Connection Name: SOA
• Connection Type: Java DB (Derby)
7. Ensure that the default Java DB (Derby) settings match the following:
• CONN_HOSTNAME: localhost
• CONN_JDBCPORT: 1527
• Database Name: soainfra
• Library: Java DB JDBC Driver
Note: You will probably need to select the library from the drop-down list.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 3
8. Click the Test Connection button to verify that the connection works.
The following message is displayed: Success!
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
9. Click OK.
a r n le l
k theraSelect
ulclose b Connection dialog box.
K
10. Click OK to
k isarun. s f e
p
Thea script
r n
eeOpenonand
D11. -t run another script to populate the data:
n
/home/oracle/NewFeatures12c/SOA/scripts/SQL/JDBsoademo_data.sql
When prompted, select the SOA connection that you defined a moment ago.

Deploying the CCValidate Composite Application


12. In the JDeveloper window, ensure that the SOAWorkspace application is selected from the
Application drop-down menu, and that the CCValidate project is visible.
13. Deploy (or redeploy if necessary) the CCValidate composite application project to
IntegratedWebLogicServer.
.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 4
Practice 5-2: Debugging a Composite Application in JDeveloper
(15 minutes)
Overview
In this practice, you use the SOA debugger to step through a running composite application.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks

Deploying the HelloBPEL Project


1. In the JDeveloper window, ensure that the SOAWorkspace application is selected from the
Application drop-down menu, and that the HelloBPEL project is expanded.
2. Deploy (or redeploy if necessary) the HelloBPEL composite application project to the
IntegratedWebLogicServer.
3. Open the HelloBPEL composite.xml file for editing.
a
4. Add breakpoint pairs to the interface and the BPEL process.
) has
om ฺ
a. Right-click the interface (blue arrow) icon and select Create Breakpoints Pair.
ฺ c
n ide
t i o
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r
b. Create a second l e l pair on the BPEL process.
n breakpoints
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 5
5. In the Application Navigator pane, right-click the HelloBPEL project and select Debug.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c(whichSwetuset in the /etc/hosts
i
hisconnection settings.
arn edefault
6. Change the Host by typing in soa12c.example.com
l k
file in Practice 2). Click OK to accept the remaining t
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

The Deploy HelloBPEL dialog box is displayed.


7. Verify that the debugger is successfully connected.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 6
8. Right-click the interface icon blue arrow and select Initiate WS Debugging.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The HTTP Analyzer is displayed.


9. Enter the following values:
CCNumber: 1234-1234-1234-1234
a
has
amount: 1000
)
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
r n le l
10. Click Send Request.
a
ulkstops
The debugger
K f e
b first breakpoint (which turns blue and starts pulsing).
ratathe
p a k ans
e tr
De non-

11. Click the Data tab and examine the incoming (normalizedRequestMessage payload)
values.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 7
12. On the JDeveloper main menu, click Step Into (F7).
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

13. Repeat until the debugger arrives at the first Assign activity.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i (
14. Press F7 again to observe c ns of the individual copy statements in the Assign
dethe iprogress
e
r n variables
activity. Expandathe l e lin the data window as needed.
K ulk ferab
p a k ans
e tr
De non-

15. Continue to use the F7 and F8 keys to move forward through the BPEL process. After
exiting the BPEL process and returning to the hellobpel_client_ep interface, pause to
observe the value of the response message.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 8
16. On completion of the composite instance, on the main JDeveloper menu, click the
Terminate icon, and select to terminate the debugger session.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 9
Practice 5-3: Creating Test Suites and Test Cases (20 minutes)
Overview
In this practice, you create a test suite and test case, run them from JDeveloper, and examine
the results.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
Creating and Running a Test Suite and Test Case on a Composite
1. If not already open, open the HelloBPEL composite in the composite editor.
2. Right-click the testsuites folder and select Create Test Suite. Accept the default name and
click OK.
3. The Create Composite Test Wizard appears. Accept the default test name.
Note that you can create new test suites in this window, if needed.
Click Next. a
has
4. Here you can choose the service and operation and, if applicable, call back the operation to
)
test.
ฺ c om ฺ
Accept the defaults and click Next.
t i o n ide
t e lla t Gu
5. Click Generate Sample and change the amount value to 1000, and the CCNumber value to
1234-1234-1234-1234.
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Click Next.

6. Click Generate Sample and change the values for the response as shown:

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 10
7. Click Finish to create the test case. The test case displays in the editor. Notice that the
initial message has been created for you, as well as the wire action.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

8. Run the test by right-clicking the test case in the Applications window and selecting Run
Test. If prompted for a deployment choice, use soa12c.example.com.

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
9. Accept the default server information and click OK. c
on tude
r nito@deploy,
i s S
a
Accept the default for the test to run. If prompted
k test results
lthe e h
t are displayed. If they do not display,
click OK.
After the composite deploys, it runs and k u
ฺ Test u s
right-click the test case and select
p a kShow t o Results.

( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D no

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 11
10. Clicking Test Run > test1.xml opens the test case in the test editor. Here you can modify
the test settings for another run. Return to the test output window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

11. Clicking the Expected or Actual value in the Assert Results area displays the XML.

12. Create another test for the same test suite, and this time change the expected response to
a
has
INVALID.
)
Rerun the test and examine the results. As expected, the test results indicate the error.
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

13. Search for all of the tests by clicking the Query Test Runs spyglass in the test results
window. Leave the fields empty and execute the query.
All test runs are displayed. Write down the exact name of one of the test runs.

14. Run another query but this time, enter the test name you wrote down from the previous step
exactly and query. The test results appear.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 12
15. Log in to EM FMWC. Select the HelloBPEL composite. Click the Unit Tests tab. What do
you notice? Answer: The test suite and test cases along with the run results are displayed
here.
You can still test and view the test results in EM FMWC. However, in 12c, you can run the
tests and view the results directly in JDeveloper without having to access another interface.
As in 11g, test results are available for query and reporting. However, those details are
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

outside the scope of this course.

Creating and Testing an Assertion for a BPEL Activity


16. Return to the test editor for your last test case.
Hint: Look for the tab with the name of your test, most likely test2.xml.

17. Double-click the BPEL component. You are prompted to create a component test.
Accept the default name and click OK. The BPEL editor opens in test mode.
a
18. Right-click the Assign_ValidateCC activity and select Edit Activity Test Data. ) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this

19. Click the green plus sign (+) to create
k kaunewoassert.
us
a
p se t
For Target, choose inputVariable/payload/ns2:CreditCheckRequest/ns2:CCNumber
e and
e n
i (d lice
click OK.
n
For Value, enter r1234-1234-1234-1234.
le CC Number. Click OK.
u lka enter a b
k K sfer
For the description, Test
a
ep n-tran
e
D no

Note that you can enter an assertion count to force the activity to execute a specified
number of times.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 13
20. Click OK to create the assertion. Note the new icon to the right of the Assign_ValidateCC
activity.

21. Rerun the test and view the results. Do you see the output for the BPEL activity test?
Using the BPEL test, you can now create assertions of individual activities.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

22. Close all editor tabs.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 5: Testing and Debugging


Chapter 5 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfort
s Lesson e t
n 6: BPEL
Editor: o
cNewSFeatures
tu d
i @
l k arn e6 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 1
Practices for Lesson 6: BPEL Editor: New Features
Practices Overview
In these practices, you work with the new features of BPEL editor, and work with the correlation
set editor.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

These practices include the following tasks:


• Editing BPEL activities in the Properties window
• Creating a correlation set

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 2
Practice 6-1: Exploring the New Features in the BPEL Editor
(20 minutes)
Tasks
1. Edit activities in the Properties window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a. Expand the CustomerInfoSvc project in the SOAWorkspace application. Expand the


BPEL folder, and right-click and open the .bpel file in the BPEL editor.
b. Add a new assign activity immediately after the receive activity. Look carefully at the
Assign activity icon. What do you notice?

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k isaansmall
There s yellow warning indicator.
e r
t the cursor over the warning indicator. What is shown in the pop-up
De no• n-Place
message?

The message indicates that there is a validation issue.


• Click the yellow indicator. The Validation Report window opens. Here you can view
all current validation issues with your activity.
• Close this window when you are done.
c. Look at the right side of the Design editor window. Can you see the small red
indicator? This is an additional visual clue that there are validation issues with the
BPEL code. Place the cursor over this.

Notice that it indicates what activity has the validation error.


Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 3
d. Right-click the assign activity icon that you just added and select Edit. The familiar Edit
Assign window appears.
This is how you edited assign actions in the 11g version. Note the new tabs available.
Close the window when you are done.
e. Now, with the assign activity selected, view the Properties window. If it is not visible,
you can display it by selecting Window > Properties.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
f. Notice that all the tabs that were present in the Edit Assignment window o
c mnow
are
available as editable properties.
o ฺ
n ideฺ
t i
t e lla t Gu
Click the Copy Rules tab. Click the Launch Assign Editor button.

o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k EditanAssignment
s
e The t r window opens.
De non-

Notice that this is the same Edit Assignment window that you opened by
double-clicking the activity. Close the window when you are done.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 4
g. Right-click the receiveInput activity icon and select Edit. Notice the new tabs that are
available. Close the dialog box.
With the receive activity selected, view the Properties window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t ioJDeveloper
u id 12c, all
l
Note that all the tabs present in the dialog box are here as well. In
te ewindow. t G
s
the BPEL activity properties can now be edited in the Properties
n n
co Toolbar.
2. Use the Additional Capabilities of the BPEL Editor – BPEL
@ S t ud
i
n tmenu,
a. Right-click the Assign1 activity. From thershortcut is select Add TODO Task. In the
k a h
ฺ k ul use
pop-up window, enter Create copy action.

e p ak e to
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Click OK to close the window.


Note that the Clipboard icon appears to the right of the assign activity. This indicates
that you have one or more TODO items for this activity.

Click the Clipboard icon.


The TODO Tasks window opens and displays your TODO Task. In this window, you
can add, edit, and delete tasks.
Add another TODO task called Rename Assign.
b. Right-click the receiveInput activity, and select Bookmark to create a bookmark for this
activity.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 5
Bookmarks allow you to quickly move to an activity, which can save time and effort in
navigating large BPEL diagrams. Name the bookmark receiveInput_initial.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Click OK to create the bookmark.


c. On the BPEL toolbar, click the drop-down arrow next to the Property Structure icon

a
d. has
Note that from Property Structure, you can select different aspects of the BPEL
)
process.
ฺ c om ฺ
Select Partner Links.
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
de appears.
The Partner Link window
i ( c e ns Examine the contents.
r
In this window,
a li edit, and delete Partner Links. Close this window.
nyou canleadd,
u lk Structure
The Property r ab provides the same access to many of the same BPEL
K
k anas
constructs f e
s the Structure window.
p a r
e n-t Structure window. It is usually located in the lower-left corner of the
De noJDeveloper
e. Access the
window. If you do not see it, select Structure from the Window menu.
f. Note that the Structure window has a tab next to it named Thumbnail.
Click the Thumbnail tab.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 6
Note that the Thumbnail tab displays a box that allows you to scroll around the BPEL
diagram, displaying a selected area. This is useful when working with large diagrams.
g. Click the Structure tab. Note the BPEL constructs that are available. These are a
superset of the constructs available in the Property Structure.
h. Return to the Property Structure icon, click it, and select Information.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
has
This displays the BPEL version and any properties that have been created for the
BPEL process. Close this window. Note also that the BPEL version is also now
)
displayed as a watermark in the lower-left corner of the Editor window.
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i is
l k arn eYou t hwill
i. From the Property Structure, select
ฺ k uProperties.
u s create a property for use later
in the practice.
p k
aProperties tofolder and create a new property by clicking the
e e
ns CustomerID.
( de theicproperty
In the dialog box, select
green plus sign.i Name
the
e
a r n le l
K ulk ferab
p a k ans
e tr
De non-

j. For the type, select Browse Types, then expand XML Simple Schema Types and
select string. Click OK.
After a moment, the newly created property appears.
Confirm your work, and then click Close to close the dialog box.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 7
k. Return to the BPEL toolbar and select the BPEL Designer Settings. Turn the Swim
Lanes off.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Note how the diagram changes. When done, switch these back on.
l. Continuing with the Designer Settings, switch the Partner Link Connections on and off.
With this, you can toggle display of the connection lines themselves.
Switching these off can help make diagrams with many partner links more readable.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 8
Practice 6-2: Creating a Correlation Set (15 minutes)
Overview
In this practice, you create a custom correlation set by using the Correlation Wizard and
examine how to create custom correlation sets manually. To create a custom correlation set,
you must define the properties that will store the values being passed and property aliases that
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

map message parts to properties.

Tasks
1. Make sure that the BPEL editor is open and you are editing
RetrieveCustomerData.bpel.
2. Add a new scope immediately after the Assign_1 activity and add an invoke activity to the
new scope.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

3. Add a local variable to this scope.

a. Click the variable icon: The Variables dialog box opens.

Add a new variable named CustomerCorrelationInfo by clicking the green plus


sign.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 9
b. Set Type to Message Type.
c. Click the Browse button to search for message types. In the Type Chooser dialog box,
expand Message Types > Project WSDL Files > RetrieveCustomerData.wsdl >
Message Types, and select RetrieveCustomerDataRequestMessage.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c omin theฺ file
Note: You can click the Import Schema File button and search for schemas
t i o n ide
lla t Gu
system, the Design-time SOA_MDS, or Project Libraries, if needed.
d. Click OK three more times to close all dialog boxes. ste
o n d e n
c u
4. Right-click the Invoke1 activity icon and selectrn i@ is St
Edit.
u l kand th select the variable you previously
a locatee and
ฺk to us
Click the Browse Variables spyglass icon
created: CustomerCorrelationInfo.
a
p se k
e e
d icen
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-

Click OK twice to close the dialog boxes.

5. Right-click the Invoke1 activity and select Setup Correlation. The Correlation Wizard
appears. In this practice, you create a new Correlation set. However, you could also choose
to edit an existing correlation set, if there is one.
6. Name the new correlation set CustomerIDCorrelation.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

You will need one property to map to the customer ID. By clicking the Browse button ,
search for the property you previously created named CustomerID. a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e n-tr
De Select
no CustomerID from the list of properties and click OK.
Note, as a convenience, you can also create, edit, and delete properties through this
interface.

7. Click Next. In Initiate Settings, choose “yes” for Initiate for the Invoke1 activity, and choose
request for the pattern.
For BPEL 2.0, you can select “response” if the correlation applies to an inbound message,
“request” if the correlation applies to an outbound message, or “request-response” if the
correlation applies to both outbound and inbound messages.
In this use case, you add the correlation to the invoked request. Click Next.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 11
8. You now need to create a Property Alias to define the activity's variable parts to the
correlation set property.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
Select CustomerID and click the icon for the Drag and Drop Editor.
) h a
Expand the CustomerCorrelationInfo variable until you see the ns1:id element. m
co Drag this to
n ฺ ฺ
the CustomerID Property Alias.
l a t i de Click
io fromuthere.
el nt G
Note: You can also use the Property Alias Editor and select the element
Next. s t
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D no

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 12
9. On the Correlated Activities area, you can add additional activities that participate in this
correlation. Click the green plus sign to see how the activities are displayed.
If appropriate, you would select the activity from the list. You do not need to do that in this
practice, so you can simply close the dialog box and click Next.

10. Review your settings, and then click Finish.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

You have completed configuring a custom Correlation set.

11. Manually examine a custom correlation set.


a. With Invoke1 still selected, examine its Property window. If it is not open, you can open
it by selecting Window > Properties.
b. Click the Correlations tab. You should see the CustomerIDCorrelation that you just
created. Select the CustomerIDCorrelation set and click the Edit Correlations button to
view the correlation details.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
c. Click the Edit Correlationp
e a pencileicon.
Set t
de icen s
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-
In the Edit Correlation Set window, you can see the property you previously created.
You can also add, edit, and delete properties from here.
Select the CustomerID property and then click the Edit pencil icon. The Edit property
window opens.

d. From here you can change the type for the property as well as add and delete property
aliases.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 13
Click Cancel three times to close all the dialog boxes. You just saw how you can create
a correlation set manually, as well as through the new Wizard.
e. Save your work and close all open editor windows.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 6: BPEL Editor: New Features


Chapter 6 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
t
Practices nfor
s Lesson e t
n 7:
o
c Stu
Transformations d
i @
l k arn e7 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 1
Practice 7-1: Transforming XML Data with XQuery and XSLT
(25 minutes)
Overview
A partially created composite application has already been started for you. The NativeData
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

project contains:
• An inbound File Adapter service (ReadFile), which polls for files in a directory location
and reads in the native data. It then performs an nXSD translation from the native data
format into an XML payload corresponding to the purchaseOrder element defined in
nxsd_po_schema.xsd.
• An outbound File Adapter reference (WriteFile), which creates a new file (for each
request) and directly writes the provided data. It expects an XML payload
corresponding to the order element defined in internal_order.xsd.
• A second outbound File Adapter reference (WriteFixed), which performs an nXSD a
has
translation from an XML payload into native data, then creates a new file (for each
)
ฺ c om ฺ
request) and writes that fixed-length formatted data to the file. The expected XML
payload is the record element defined in nxsd_fixedLen_schema.xsd.
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Your tasks include:


• Creating a Mediator component creating two routing rules as you connect it to these
three existing File Adapters
• Using the XQuery Mapper to create an XQuery transformation
• Using the XSLT Mapper to create an XSL transformation
• Deploying and testing the composite application

Tasks
1. Creating a Mediator Component
a. Open the NativeData composite application project in the SOAWorkspace application.
b. In the Composite Editor, drag a Mediator component from the Component Palette into
the Components column.
The Create Mediator dialog box opens.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 2
c. Set the name to RouteFile.
d. Accept the Define Interface Later template. Click OK.
Note: The interface is automatically defined in the next step, when the wire is created
from the exposed service to the Mediator.
e. Create a wire from the ReadFile exposed service icon to the RouteFile Mediator icon.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

f. Create a wire from the RouteFile Mediator icon to the WriteFile reference icon.
Create a wire from the RouteFile Mediator icon to the WriteFixed reference icon.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
decan ignore
e s Error messages for now.
nthe
g. Save your work.i You(
n le li c
a r
2. CreatingK ulkXQuery
the f e
b
raTransformation for the WriteFixed::Write Routing Rule
a k s
anthe RouteFile Mediator icon and select Edit.
e ea.p The- t r
Right-click
D non Mediator configuration editor opens.
b. Click the “Select an existing mapper file or create a new one” icon next to the
Transform Using field.

The Request Transformation Map dialog box appears.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 3
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

c. Click the Create Mapping green plus icon.


The Create Transformation Map dialog box appears.
d. Change the Type to XQuery. Accept the defaults for File Name and Directory.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
ฺ ku o usMap dialog box.
Click OK to close the Create Transformation
k
e p
Click OK to close the Requesta Transformation
e t Map dialog box.
e n s
r n i (d (purchaseOrder_To_record1.xqy)
e. The XQuery Mapper
l i ce window opens.
Completelyaexpand the
lkhierarchies.
a b lepurchaseOrder Input Source as well as the record Target
Type u
k K sfer
tree
a
ep n-tran
e
D no

f. Manually map the elements as shown in the following table:


Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 4
Source Target
custID custID
ID ordID
payOption payMethod
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

shipChoice shipMethod
status status
ccType ccName
ccNumber ccNum

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p
g. a k thatnsyou can view the XQuery source by clicking the corresponding tab at the
Noticera
e n-t to examine the file. You can also view individual mappings by opening the
De nobottomProperties editor pane directly underneath and selecting a mapped line.

h. Save all your work and then close the purchaseOrder_To_record1.xqy tab.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 5
i. Expand the Transformations folder in the NativeData project within the Applications
pane. You can see your new file here.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

3. Creating the XSL Transformation for the WriteFile::Write Routing Rule


a. Return to the RouteFile Mediator editor.
a
b.
has
Click the “Select an existing mapper file or create a new one” icon next to the
Transform Using field. )
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de iceMap
The Request Transformation nsdialog box appears.
a r n le l
K ulk ferab
p a k ans
e tr
De non-

c. Click the Create Mapping (green plus) icon.


d. The Create Transformation Map dialog box appears.
Leave the Type as XSLT. Accept the defaults for File Name and Directory.

Click OK to close the Create Transformation Map dialog box.


Click OK to close the Request Transformation Map dialog box.
e. The XSLT Mapper (purchaseOrder_To_order1.xsl) window opens.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 6
Completely expand the purchaseOrder Input Source as well as the order Target Type
tree hierarchies.
f. Drag the PurchaseOrder element in the source column and drop it to the Order
element in the target column.
The Auto Map Preferences window opens.
g. Click OK to accept the defaults.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The Auto Map feature finds no matches.


h. Manually map the leaf nodes. Use the table that follows if needed. (Note that there is
no mapping to the target node orderTotal.)
The first time you map a field, the following information dialog box appears. Select the
Skip This Message Next Time check box to avoid repeated display of this message.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
Source Target
i
custID customerId l k arn e this
orderId kฺ
ku o us
ID
e p a et
e ens
payOption dpayMethod
(
r n i
e l ic
lka rabstatus
shipChoice l
shipMethod
u
K sfe
status
a k an
e ep n-trccType cardType
D no ccNumber cardNumber
i. Map the node itemlist to the node items.
The Auto Map Preferences window appears again.
j. Click OK to accept the defaults
Note: Something very different happens this time. First, Auto Map finds several
matches. Secondly, a for-each node is added to the target message structure, and
the repeating element item is mapped to it. The for-each node is a graphic
representation of an XSL construct that allows processing of repeating message
elements in a loop.
k. Manually map the quantity node to qty.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 7
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

l. Verify and save your work.


m. Close all editors, except the NativeData overview window. a
) has
4. Deploying and Testing the NativeData Composite Application
ฺ c om ฺ
a. Deploy the NativeData project to IntegratedWebLogicServer. ion de
l a t
lcomposites u i
Remember to select the check box to overwrite any existing
s t epane. n t Gwith the same
revision ID. Verify successful deployment in the Message n ude
coinput
b. Make a copy of the purchase order and put it@
i in the S t directory:
file
cd ~/NewFeatures12c/SOA/filesarn
l k e t his
cp purchaseOrder.dat ../input/po.dat
k ฺ ku o us
c. Confirm that after 5 seconds,
e p a the following
e t occurs:
de fromicthe
e s
ninput directory.
i (
1. The file is removed
l
arn fileabislmoved
2. The original
l k e to
k KA useparate
s f r
/home/oracle/NewFeatures12c/SOA/files/archive/po.dat_<UUID>.
erecord
e p a3.
r a n of the order is written in fixed length format to:
t
De non-mp>.xml
/home/oracle/NewFeatures12c/SOA/output/native/po_<dateTimeSta

4. A copy of the file is passed to the composite application, and then, after
transformation, a purchase order is written to:
/home/oracle/NewFeatures12c/SOA/output/podata/po_<dateTimeSta
mp>.xml

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c
and verifyS tuthe data is correctly
i
Use JDeveloper or a text editor to open the output files that
formatted.
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 7: Transformations


Chapter 7 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
t
Practices nfor
s Lesson e t
n 8:
o
c PII
Protecting tuDatad
i @ S
l k arn e8 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 1
Practice 8-1: Setting Up and Deploying the CCValidate Project
(5 minutes)
Assumptions/Overview
The tasks in the practice will not be necessary if the soademo tables and data are already
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

populated in the database, and if the CCValidate project has already been deployed to your
Integrated WebLogic Server.
If you have successfully completed Practice 5-1, you can skip this practice and go
directly to Practice 8-2.

Tasks

Creating New Tables and Data in the Database


1. From the JDeveloper menu, select File > Open.
a
2. Navigate to /home/oracle/NewFeatures12c/SOA/scripts/SQL.
) has
3. Select JDBsoademo_create.sql.
c o m
The file is opened in a SQL worksheet.
o ฺ
n ideฺ
t i
4. Click the Run Script icon.
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
The Select Connection d dialog box s
e eisndisplayed.
i (
nnot already c
libeen created, click the “Create a new connection” icon.
Otherwise, lyoua r
5. If a connection has
k rab
can skipl e
to steps 10 and 11.
u
K sfe
a k
e ep n-tran
D no

6. Enter the following details:


• Connection Name: SOA
• Connection Type: Java DB (Derby)
7. Ensure that the default Java DB (Derby) settings match the following:
• CONN_HOSTNAME: localhost
• CONN_JDBCPORT: 1527
• Database Name: soainfra
• Library: Java DB JDBC Driver
Note: You will probably need to select the library from the drop-down list.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 2
8. Click the Test Connection button to verify that the connection works.
The following message is displayed: Success!
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
9. Click OK.
10. Click OK to close the Select Connection dialog box.
The script is run.
11. Open and run another script to populate the data:
/home/oracle/NewFeatures12c/SOA/scripts/SQL/JDBsoademo_data.sql
When prompted, select the SOA connection that you defined a moment ago.

Deploying the CCValidate Composite Application


12. In the JDeveloper window, ensure that the SOAWorkspace application is selected from the
Application drop-down menu, and that the CCValidate project is visible.
13. Deploy (or redeploy if necessary) the CCValidate composite application project to
IntegratedWebLogicServer.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 3
Practice 8-2: Encrypting and Decrypting Specific Message Fields
(20 minutes)
Overview
In this practice, you encrypt and decrypt parts of the composite message and examine the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

results in EM FMWC.

Tasks
1. In JDeveloper, ensure that the SOAWorkspace application is selected, and that the
CCValidate project is expanded.
Open the CCValidate (composite.xml) in the editor.

2. Right-click the entry point, ValidateCreditCard_ep, and select Encrypt Sensitive Data.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
3. There is onelk ab
K u policy: oracle/pii-security-policy.
Clickkthe pencil s f e r
icon to edit the policy.
e p a r a n
t
De non-
You will choose the message fields to add and set the key values for the security policy.

4. On the “Select Fields from input message(s)” screen, click the + icon to open the
Expression Builder and add the CCNumber field.
Click OK to exit the Expression Builder.
Click Next twice to advance to Select CSF Key Value.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
5. Click the plus sign (+) next to CSF Key Values to add a new credential.
1) User name: weblogic
@ c Stu
i
arn e this
2) Password: welcome1
l k
ku o us
3) Key: pii-csf-key2
k ฺ
e
6. Click Finish, OK, and OKeagain pato complete
s e t the dialog boxes and acknowledge the
i (
message about decrypting c n before sending to external services.
d the imessage
e
arn able l
l k
Ku stofthe
7. Add decryption
k er outbound payload.
a
ea.p Data. r anthe CreditCardDBService external reference and select Decrypt Sensitive
Right-click
e - t
D non
b. There is one policy: oracle/pii-security-policy. Click the Pencil icon to edit the policy.
c. Click the plus sign (+) to launch Expression Builder. Use this to add the ccNum to be
decrypted. Click OK when done. The Selected field should look like this:

d. Click Next twice. Ensure you choose the pii-csf-key2 value. Click Finish because you
are not decrypting the output message and you are using the same policy.
e. Click OK and OK again to complete the dialog boxes and acknowledge the message
about decrypting the message before sending it to external services.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 5
Your composite should now show two locks where the encryption and decryption are
enabled.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

f. Deploy the composite to IntegratedWebLogicServer.

8. Create the security policy.


a. You must define the security policy before you can use it in your composite. Open a
a
has
terminal window by selecting Applications > System Tools > Terminal.
b. Change directory to execute WLST: )
cd /u01/app/oracle/fmw/wlserver/common/bin ฺ c om ฺ
t i o n ide
c. Start WLST: ./wlst.sh
e G u
lla thet supporting
n s
When you run WLST the first time, there is a delay while t
it scans
e n files.
This may take a few seconds.
@ co Stud
i
arn e this
d. Connect to WebLogic:
l k
connect("weblogic","welcome1","t3://localhost:7101")
k ฺ ku o us
e p a et
de icens
e. Create the policy:

n i (
createCred(map="oracle.wsm.security",
l key="pii-csf-key2",
r
a able password="welcome1", desc="Key for pii")
user="weblogic",
k
u l r message “Credential created successfully,” close the terminal
f. When
k K youandsee
s f ethe
e p a window
r a n return to the EM FMWC.
n- t
D9.e Test
nothe encryption and decryption.
a. Before testing, check whether the Audit Level is set to Development; if not, apply that
change first. (The default setting for your environment is Production.)
Right-click soa-infra and select SOA Administration > Common Properties.
b. Go to the CCValidate composite home page and test it with a payload value of:
1234-1234-1234-1234 for CCNumber, and 1000 for amount
c. After the service executes, click the Launch Flow Trace button. On the flow trace, click
the ValidateCreditCard link.
d. In the Audit Trail, click the first View Payload link in the onMessage Input payload
received section.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 6
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. Notice in the payload that CCNum is encrypted.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
f. Close the View Payload window. ulk
arn e this
You are returned to the Audita k ฺk screen.
Trail t o us
e e p directly
seunder the invoked two-way operation
g. Now click the View Payload
( d e n
c ccNum is still encrypted.
i Noticelithat
“CreditCardDB…”.
r n l e
a at athebresponse just below to see that the cardNumber is visible. (You
h. However,
didK
lklook
uspecify r encryption for the response messages.)
k not
s f eany
a
ei.p Close r anopen windows.
all
e - t
D non
10. Additional optional activities:
If time permits, try experimenting with encrypting and decrypting the corresponding
sensitive data in the responses.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 7
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 8: Protecting PII Data


Chapter 8 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
t
Practices nfor
s Lesson e t
n 9: Fault
Policy o
c Stu
Wizard d
i @
l k arn e9 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 1
Practice 9-1: Using the Fault Policy Wizard (20 minutes)
Overview
In this practice, you design a fault policy with the Fault Policy Wizard and associate the fault
policy with the fault policy binding file.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Assumptions
This practice makes no assumptions.

Tasks

Deploying the SOA Composite Projects


1. Deploy the SayHello and CallGreeting projects.
a. Verify that the SOAWorkspace application is open and selected. If not, open the
a
has
workspace located at: /home/oracle/NewFeatures12c/SOA
b. Deploy SayHello to IntegratedWebLogicServer. )
ฺ c om ฺ
Remember to select the “Overwrite any existing composites with the same revision ID”
check box. t i o n ide
c. Repeat the previous step to deploy the CallGreeting project. t e lla t Gu
o n s den
@ c Stu
i is It concatenates the string
arnWorld”
2. Test the applications.
Note: The SayHello project is the classiclk“Hello
e t hproject.
k ฺ ku asopart
“Hello” and an input string that is received usof the service invocation. The
CallGreeting [asynchronous]p a t
passes that string whendite
project
e SayHello.
invokes
e n se In the following test, you verify that the
accepts an input string that you provide, and then

n (
i error andl ic do not [yet] throw any faults.
r
applications run without
l e
a abManager FMW Control: http://localhost:7101/em
a. Open the
u lkEnterprise
b. Ink the er
K TargetsfNavigation pane, expand the SOA > soa-infra > default nodes in the tree.
e p a r a n
Clicktthe “CallGreeting [1.0]” link.
De c.noOnn-the “CallGreeting [1.0]” home page, click the Test button.
d. On the Test Web Service page, scroll down to the Input Arguments section to the
Request tab. Click the arrow to expand payload.
e. Provide your first name (or any other text you like) as input.
f. Click the Test Web Service button (located at the top right or bottom right).
g. On the Response tab, click the Launch Flow Trace link. Verify that each step has
completed without error.

h. In Trace, click the MakeGreeting link.


Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 2
i. In Audit Trail, click the replyOutput – ViewPayload link.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

j. Verify that the payload includes the concatenated text.

a
) has
ฺ c om ฺ
Generating a Remote Fault
t i o n ide
3. Shut down the SayHello project.
t e lla t Gu
o n s soa-infra
a. In the Enterprise Manager target navigation pane, expand
d e n > default.
b. Select the SayHello project.
@ c Stu
i
c. In the SayHello pane, click Shut Down.arn
l k e t his
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 3
d. In the Confirmation dialog box, click Yes.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The project is shut down.

4. Generate a fault condition.


a. Repeat the preceding task 2, steps b–f to test the CallGreeting composite.
b. On the Response tab, click the Launch Flow Trace link. Note the state of each step of
a
has
the instance.
)
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
ฺ ku tab,
c. Above the Trace pane, on thekFaults
o us the fault information.
notice
e a
p se t
( e
d icen
r i
n le l
a
K ulk ferab
p a k ans
tr Policy
ee ona -Fault
DCreating
n
In this section, you use the wizard to create a Fault Policy.
5. In JDeveloper, open the composite overview for the CallGreeting project.
6. Create a fault policy document.
a. To open the wizard, right-click the CallGreeting root project node in the Applications
pane and select New > From Gallery.
The New Gallery dialog box opens.
b. In the Categories pane, select SOA Tier > Faults.
c. In the Items pane, select Fault Policy Document and click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
The Fault Policies editor opens.
) has
ฺ c om ฺ
7. Define a fault policy.
t i o n ide
a. Name the policy callerPolicy.
t e lla t Gu
b. Select remoteFault from the Fault Name drop-down n
o s den
list.
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e n-tr[retry] default-retry from the Default Action drop-down list.
De c.noSelect
This defines what actions the policy will take when it is activated.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 5
8. Edit the properties of the retry action.
a. Click the Actions tab and highlight default-retry.
b. Click the Pencil icon to edit the action.
1) Retry Count: 3
2) Retry Interval: 1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

3) Retry Failure Action: [humanIntervention] default-human


c. Verify your work and click OK.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
arn e this
The policy is now created.
d. Save your work and close the Policylk
ku ofileuisscreated in the project under SOA.
Wizard.
k
a et
Notice that the fault-policies.xml ฺ
e p
e ens
i ( d ic BPEL process CallingProcess.
9. Associate the faultnpolicy with lthe
r l e
u lka raEditor
a. On the Composite b toolbar, click the Edit Composite Fault Policies icon.
k K
Note:
s f e
The following screenshot will not match yours. Your project is named
ep a n
tra
CallGreeting.
De non-

The Composite Fault Policies screen is displayed. On this screen, you can associate
fault policies with the composite or the components therein. In this practice, you
associate the policy with the BPEL CallingProcess.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 6
b. Select the policy from the drop-down list to the right of the CallingProcess component.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
c. Click OK.
k ฺ ku o us
e p a et
( d e ens
10. Redeploy and test the application.
a. Redeploy the n
r i
CallGreeting
e l icproject to activate the fault policy.
b. Repeat lthe l
kaearlierrastep
b 2 to test the CallGreeting composite.
K u f e
a k
c. On the s
Response
n tab, click the Launch Flow Trace link.
ep Thisn-tr
a the trace indicates that the instance was retried three times after the initial
De nofailure.
time,

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 7
Manually Recovering the Fault
11. Place the cursor over the text “Recovery Required” on the Faults tab.
A message is displayed confirming that manual recovery is pending.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

12. Activate the SayHello project.


a. In the Enterprise Manager target navigation pane, expand soa-infra > default.
b. Select SayHello project.
c. In the SayHello pane, click Start Up.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icewant
d. Click Yes to confirm that you nsto start the SayHello composite.
a r n le l
lk therfault.
uEnterprise
13. Manually recover ab
k
a. In K
the s f e Manager target navigation pane, expand soa-infra > default.
a
eb.p Select n
-trathe CallGreeting project.
De c.noInnthe CallGreeting pane, click Flow Instances.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 8
d. In the Search pane, click Search.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

e. In the Search Results pane, click the Flow ID.

a
) has
The Flow Trace for the instance is displayed.
ฺ c om ฺ
f. On the Faults tab, click the Recovery Required link.
t i o n ide
Details of the fault are displayed along with the Retry and e lla options.
Abort G u
n t
s den t
g. Click Retry. o
c Stu
i @
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

The Trace is updated, indicating the completion of the instance.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

h. On the Faults tab, click the Refresh icon.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
The Recovery status is updated. o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
( d e ens
r
i. Close the openn i
Flow Trace
e l icwindow.
lka rab l
u
K sfe
a k
e ep n-tran
D no

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 9: Fault Policy Wizard


Chapter 9 - Page 10
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfor
s Lesson
t e n 10:
t
REST o
Binding
c StuWizard d
i @
l k arn e10 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 1
Practices for Lesson 10: Overview
Practices Overview
In these practices, you add a REST interface to the HelloBPEL project and modify the
HelloBPEL project by adding a REST interface that uses an HTTP Post Operation. You then
create a new project that calls HelloBPEL via the new REST interface. You deploy and test the
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

new project.
Finally, you create another REST interface that uses an HTTP Get Operation.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 2
Practice 10-1: Creating a REST Service Interface (HTTP Post)
(15 minutes)
Tasks

Defining a REST Interface


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

1. In the SOAWorkspace application, open the composite.xml file for the HelloBPEL
project.

2. Define a REST interface for the HelloBPEL composite.


a. Right-click the BPEL process interface and select Expose as REST.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
The Create Rest Binding window is displayed.@ c Stu
i
b. Set the following fields:
l k arn e this
• Name: helloBPEL_RS ฺku us
a
p sek t o
• Description: RESTe interface
( e
d icen
r i
n le l
3. Add a resource. a
K
a. Click uthelkAddfea rResource
ab (green plus sign) icon.
p a kThe Create
a n sREST Resource dialog box is displayed.
r
e n-t /CreditCheckRequest as a relative path to the resource.
De b.noInsert

c. Click OK.
d. Select the default resource (/) and click the Delete (X) icon.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 3
4. Add an operation binding.
a. Click the Add (+) icon and select “Add operation binding.”
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The REST Operation Binding dialog box is displayed.


b. Set the following fields:
• Operation: validateCard
• Resource: /CreditCheckRequest
• HTTP Verb: POST
c. Define the request.
1) Click the “Browse for schema file” icon. a
2) In Type Chooser, select the CreditCheckRequest element of the
) has
creditcheck.xsd file.
ฺ c om ฺ
3) Click OK.
t i o n ide
t e lla t Gu
You are returned to the REST Operation Binding dialog box.

o n s den
the c
5. Generate a sample payload. (You use this to test @ tulater.)
application
S
i
l k arn e this
a. Deselect the XML check box next to Payload.
b. Select the JSON check box. ฺku us
c. Click the Generate Sample a k
p se
Payload t o
icon.
e e
d icen
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-
d. In the Generate Sample Payload window, select the JSON option.
e. Modify the sample values:
• CCNumber: “1234-1234-1234-1234”
• amount: 1000
f. Click the “Select a directory” icon.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 4
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
g. Navigate to the SOA directory.
) has
h. Click the “Create new subdirectory” icon.
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e n-trSampleInput as the subdirectory name.
i. Enter
De j. noClick OK.
k. Highlight the newly created directory and click Select.
You are returned to the Generate Sample Payload window.
l. Verify your work and click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 5
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
You are returned to the REST Operation Binding window. ) has
ฺ c om ฺ
6. Define the response of the REST service. t i o n ide
a. Click the Response tab. t e lla t Gu
b. Deselect No Payload. o n s den
@ c Stu
i
his
c. Enter JSON as the Payload type.
k rnselecttcreditcheck.xsd
aand
k l
d. Click the “Browse for schema file” icon
u us e >
CreditCheckResponse. ฺ
ak e to
e p
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

e. Click OK.
f. Click Generate Sample Payload.
g. Select JSON as the Sample Type.
h. Verify that your sample is similar to the following screenshot: (The sample value may
vary.)

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 6
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

i. Click OK to close the REST Operation Binding window.

7. Verify your work and click OK to complete the definition of the REST binding.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Adding a Mediator
8. Create and configure a Mediator component.
a. Add a Mediator to the Component column of the composite overview window.
The Create Mediator window opens.
b. Set the Name to RouteData.
c. Accept the “Define Interface Later” template option.
d. Click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 7
9. Wire the Mediator component to the REST interface (helloBPEL_RS) and to the HelloBPEL
process.

10. Configure the Request transformation in the Mediator.


a. Right-click the Mediator icon and select Edit.
The RouteData.mplan window opens.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Expand the Static Routing rule that is created by the wire.


c. In the upper (request) section of the Static Routing rule, click the “Select an existing
mapper file or create a new one” icon.
d. In the Request Transformation Map dialog box, click the Create Mapping icon.
The Create Transformation Map dialog box is displayed.
e. Accept the default file name that is supplied. Click OK.
f. Click OK to close the Request Transformation Map dialog box.
a
has
The XSLT Mapper window opens.
g. Map the CCNumber element in the Source column to the CCNumber element in the )
target column.
ฺ c om ฺ
i o
h. Map the amount element in the Source column to the amount element in the target
t n ide
column.
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
i. Save your work. e p a et
j. Close the XSLTieditor ( e nsto the RouteData.mplan window.
deandicreturn
a r n le l
K
11. Configure uthelkReplyf e ab
rtransformation.
p
a. a k ans
In therSynchronous Reply section of the routing rule, click the “Select an existing
e e mapper - t
D non file or create a new one” icon.
b. In the Reply Transformation Map dialog box, click the Create Mapping icon.
The Create Transformation Map dialog box is displayed.
c. Accept the default file name that is supplied. Click OK.
d. Click OK to close the Reply Transformation Map dialog box.
The XSLT Mapper window opens.
e. Map the status element in the Source column to the status element in the target
column.

f. Save your work.


g. In the JDeveloper window, close the XSLT Mapper and the RouteData.mplan
windows.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 8
12. Verify that the composite application assembly model resembles the following image:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

13. Deploy the HelloBPEL project to IntegratedWebLogicServer. a


) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 9
Practice 10-2: Creating and Configuring a REST Reference Interface
(15 minutes)
Assumptions
This practice assumes that you have completed Practice 10-1 successfully.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. In the SOAWorkspace application, create a new empty SOA project named CallREST.
The composite.xml file is created and the overview window is opened for editing.

2. Add a REST binding to the External References swimlane.


The “Create Rest binding” dialog box is displayed.

3. Enter helloBPEL for the name. s a


)h a
m
co oneฺWADL
4. Click the Operations Bindings Add (+) button and select Add operations ฺbased
Service. t n
io uid
l a
el nt G
s t
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D no

The WADL Chooser is displayed.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 10
5. With Application Server selected, expand the SOA node and find the HelloBPEL REST
interface.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
lk rab and click OK.
6. Select application.wadl
u
areK
You k s
returned ftoethe “Create REST binding” window. The fields are automatically
p a n
a on the WADL file.
epopulatedtrbased
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p akฺ to u
( d ee ense
r n e ic binding” window.
i “Create lREST
a ab
7. Click OK to close
lkFilesthe l
u
The Localize
K sfedialog r box is displayed.
a k
p -tran
e eDeselect
non
8.
D OK. the Maintain original directory structure for imported files check box and click

The definition of the REST binding is completed.

Creating a BPEL Process


In this section, you create a BPEL process that invokes the REST interface that you created.
9. Add a BPEL process to the application.
The Create BPEL Process dialog box is displayed.
a. Name: CallREST
b. Template: Synchronous
c. Create an input variable based on the CreditCheckRequest element of the
creditcheck.xsd file (already in the project).
d. Create an output variable based on the CreditCheckResponse element of the
creditcheck.xsd file.
e. Verify your work and click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 12
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
10. Wire the BPEL process dtoethe REST
e s
nbinding.
i (
n le li c
a r
lk theraBPEL
Defining Activities
u in b Process
KBPELsProcess
11. Openkthe fe for editing.
a
p -tra n
eeCreate
D12. nonand configure an Invoke activity.
a. Add an Invoke activity to the BPEL process.
b. Map the Invoke activity to the helloBPEL partner link.
The Edit Invoke window is displayed.
c. Name the new activity Invoke_helloBPEL.
d. Automatically create input and output messages.
e. Verify your work and click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( e activity
13. Create and configure andAssign
c e ns to set the input message for the REST service.
a. Add an Assign
a r li the Invoke activity.
n activitylebefore
b. Nameuthelk new activity
rab Assign_CreditCard.
K
k the Assign
c. aIn f e
s Editor, map the CCNumber element in the process input variable to the
p
e CCNumber r a n
De d.noMapn-tthe amount
element in the input variable for the REST service.
element in the process input variable to the amount element in the
input variable for the REST service.

e. Click OK.

14. Create and configure an Assign activity to set the output message for the BPEL process.
a. Add an Assign activity after the Invoke activity.
b. Name the new activity Assign_Reply.
c. In the Assign Editor, map the status element in the REST service output variable to
the status element of the output variable for the BPEL process.
d. Verify your work and click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 14
15. Verify and save your work.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 15
Practice 10-3: Deploying and Testing the Composite Application
(10 minutes)
Assumptions
This practice assumes that you have completed all work through Practice 10-2 successfully.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. Deploy the CallREST composite application project to IntegratedWebLogicServer.
Remember to select the “Overwrite any existing composites with the same revision ID”
check box.
2. In Enterprise Manager, navigate to the test page for the CallREST project.
a. Open Enterprise Manager.
b. Navigate to the CallREST project.
c. On the CallREST home page, click Test. a
The test page opens. ) has
ฺ c om ฺ
d. On the Test Web Service page, scroll down to the Input Arguments section to the
t i o n ide
Request tab. Expand payload and enter the following values:
• CCNumber: 1234-1234-1234-1234
t e lla t Gu
• amount: 1000 o n s den
e. Click Test Web Service. @ c Stu
i
The Response tab is displayed.
l k arn e this
ฺ ku o us
f. Verify that the status value returned is VALID, as shown in the following screenshot:
k
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

g. On the Response tab, click the Launch Message Flow Trace link.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 16
h. In the Flow Trace, click the View Payload link for Assign_Reply in CallREST.
The called project hellobpelRS has successfully processed the message. The REST
adapter has converted the JSON to XML, and returned the status of VALID.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 17
Practice 10-4: Creating a REST Service Interface (HTTP Get)
(15 minutes)
Assumptions
This practice assumes that you have completed all work through Practice 10-3 successfully.
The following instructions are written with limited graphics in a terser manner intentionally to test
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

your ability to repeat most of the same tasks as you did in Practice 10-1.

Tasks

Defining a REST Interface


1. In the SOAWorkspace application, open the composite.xml file for the HelloBPEL
project.

a
has
2. Define an additional REST interface for the HelloBPEL composite.
a. Right-click the BPEL process interface and select “Expose as REST.” )
The Create Rest Binding window is displayed. ฺ c om ฺ
b. Set the following fields: t i o n ide
• Name: helloBPEL_Get t e lla t Gu
o n s den
• Description: REST GET interface
@ c Stu
i
3. Add a resource. l k arn e this
a. Click the “Add a Resource”a k ฺku to us
icon.
e
The Create REST Resourcee p dialogsebox is displayed.
i ( d icaseanrelative path to the resource.
a r n le l
b. Insert /GetCreditCheck
c. Click u
OK.lk rab
k K
d. Select s fe resource (/) and click the Delete (X) button.
the default
a
ep n-tra n
D4.e Add
noan operation binding.
a. Click the Add (+) icon and select “Add operation binding.”

The REST Operation Binding dialog box is displayed.


b. Set the following fields:
• Operation: validateCC
• Resource: /GetCreditCheck
• HTTP Verb: GET
c. Define the request.
1) Click the “Browse for schema file” icon.
2) In the Type Chooser, select the Request element of the creditcheck.xsd file.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 18
3) Click OK.
You are returned to the REST Operation Binding dialog box.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
5. Define the response of the REST service.
@ c Stu
a. Click the Response tab.
i
rn this
l k a
b. Deselect the XML Payload.
ฺ k u use
e p ak e to
c. Specify the Payload type JSON.
d. Click the “Browse for
i ( d c nsicon and select creditcheck.xsd >
eschemaefile”
a r n le li
CreditCheckResponse.

K ulk ferab
p a k ans
e tr
De non-

e. Click OK.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 19
6. Verify your work and click OK to complete the definition of the REST binding.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
Adding a Mediator
p ak andraconfigure
7. eCreate n s a Mediator component.
De a.noAddn-tanother Mediator to the Component column of the composite overview window.
The Create Mediator window opens.
b. Set the Name to RouteGETData.
c. Accept the “Define Interface Later” template option.
d. Click OK.

8. Wire the Mediator component to the REST interface (helloBPEL_Get) and to the HelloBPEL
process.

9. Configure the Request transformation in the Mediator.


a. Right-click the Mediator icon and select Edit.
The RouteGETData.mplan window opens.
b. Expand the Static Routing rule that is created by the wire.
c. In the upper (request) section of the Static Routing rule, click the “Select an existing
mapper file or create a new one” icon.
d. In the Request Transformation Map dialog box, click the Create Mapping icon.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 20
e. This time, try using the XQuery mapper instead of XSLT.
The Create Transformation Map dialog box is displayed.
f. Accept the default file name that is supplied. Click OK.
g. Click OK to close the Request Transformation Map dialog box. (You may need to click
OK again to hide the pop-up box).
The XQuery Mapper window opens.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

h. Map the CCNumber element in the Source column to the CCNumber element in the
target column.
i. Map the amount element in the Source column to the amount element in the target
column.
j. Save your work and close the .xqy file tab.
k. Close the XQuery mapper and return to the RouteData.mplan window.

a
has
10. Configure the Reply transformation.
)
a. In the Synchronous Reply section of the routing rule, click the “Select an existing
mapper file or create a new one” icon.
ฺ c om ฺ
i o n ide
b. In the Reply Transformation Map dialog box, click the Create Mapping icon.
t
c. Again, try using the XQuery mapper instead of XSLT.
t e lla t Gu
o n
The Create Transformation Map dialog box is displayed.
s den
@ c Stu
i
d. Accept the default file name that is supplied. Click OK.
k arn e this
e. Click OK to close the Reply Transformation Map dialog box.
l
The XQuery Mapper window opens.k ฺ ku o us
p a et
f. Map the status element in the Source column to the status element in the target
e
column.
i ( de icens
r n le l
g. Save your work, and close the .xqy file tab.
a
ulk ferab
h. In the JDeveloper window, close the RouteGETData.mplan window.
K
p a k ans
eeDeployn - tr HelloBPEL project to IntegratedWebLogicServer.
D11. no
the

Testing the New GET Interface


12. In Enterprise Manager, navigate to the test page for the HelloBPEL project.
a. Open Enterprise Manager.
b. Navigate to the HelloBPEL project.
c. On the HelloBPEL home page, choose the helloBPEL_Get from the Test button
drop-down menu.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 21
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The test page opens.


d. On the Test Web Service page, scroll down to the Input Arguments section to the a
Request tab. Expand payload and enter the following values:
) has
• amount: 1000
ฺ c om ฺ
• CCNumber: 1234-1234-1234-1234
t i o n ide
e. Click Test Web Service.
t e lla t Gu
The Response tab is displayed. o n s den
f. Verify that the status value (returned as JSON)@ c tushown in the following
is VALID,Sas
i
screenshot:
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 10: REST Binding Wizard


Chapter 10 - Page 22
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfort
s Lesson e t
n 11: New
Adapters o
c and tuMFT d
i @ S
l k arn e11 this
Chapter
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: New Adapters and MFT


Chapter 11 - Page 1
Practices for Lesson 11

There are no practices for this lesson.


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 11: New Adapters and MFT


Chapter 11 - Page 2
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Practices nfor
s Lesson
t e n 12:
t
Templates o
c and d
tu BPEL
i @ S
l k arn e this
Subprocesses
k ฺ ku Chapter
o us12
e a
p se t
( e
d icen
r i
n le l
a
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 1
Practices for Lesson 12: Templates and Subprocesses
Practices Overview
In these practices, you create SOA composite templates and service component templates. You
create BPEL scope templates, and create and reuse BPEL inline and stand-alone
subprocesses. You manage existing templates by removing and editing them in the SOA_MDS
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Designer.
This practice includes the following tasks:
• Creating SOA composite templates
• Creating service component templates
• Creating BPEL scope templates
• Creating BPEL inline and stand-alone subprocesses
• Managing BPEL Templates
a
) has
Assumptions
ฺ c
This lab assumes that you have completed Practice 4-3 and that the CustomerProfileom ฺ
composite has been created. t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 2
Practice 12-1: Creating and Using SOA Composite Templates
(10 minutes)
Overview
In this practice, you create a new template for a SOA composite project, and then use that as
the basis for a new SOA composite.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. In JDeveloper, open the FaultLogger project in the SOAWorkspace and the FaultLogger
composite.xml file in the composite editor. Inspect this composite and note its structure.
2. Use this project as the basis for creating a new SOA composite template. Then use this
template as the basis for a new SOA composite.
• Right-click the project home FaultLogger and select Create SOA Template.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
3. On the Specify Template Information screen, click the “Browse Locations” button to choose
a different location to store the template. This opens the Select Location dialog box.
4. Change the directory of where to store the template to:
/home/oracle/NewFeatures12c/SOA/templates

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 3
• Set the name for the template to FaultLoggerTemplate.

5. Note: Information Only – Do not do the following, because it will clear your settings
for the File System. Choose to store the template in the Design-Time SOA-MDS. On
selecting SOA-MDS, you see the folders that exist under the apps directory. You can save
your template to one of the existing folders. However, you cannot create or manage folders
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

and templates in this window. You will see how to do that later in the practice.
Instead for this practice, click OK to accept the settings for the File System.

6. You are returned to the Specify Template Information page. Notice that the “Save in” field
has been updated to reflect your selection.
Click Next.

7. You are not adding test suites or business indicator measurements to the template, so a
accept the selected files and click Finish to complete creation of the template.
) has
8. To view the newly created template, go to Tools > Preferences > SOA >nTemplates.ฺ com eฺThere,
you can see and manage your templates. Return to this a little later.
l a t io uid
Click Cancel to close the Preferences window. s t el nt G
c on tude
9. Close the FaultLogger window that is open inrthe editor. is S
ni@
u l k se th
a
10. Create a new SOA Composite based a k ฺkon thetotemplate
u you just created.
a. From the File Menu, e
p e Choose SOA project for the project type.
e Newn>sProject.
select
Click OK. i ( d ic e
r n l e l
b. Name the
u lkaprojectraLocalLogger
b and click Next.
K the SOA
c. Select
k s fe Template option. Confirm that the template you just created,
a
ed.p Click n
a is selected.
FaultLogger,
r
e - t
D non Finish.
A new composite is created and has the same structure and artifacts as your template.
You can now edit this new composite as needed.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 4
Practice 12-2: Creating and Using Service Component Templates
(15 minutes)
Overview

In this practice, you create a template based on a single component, and then use that template
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

to add and configure a new component.

Tasks
1. You have decided to store this and other templates in the Design-Time SOA MDS.
• Select the Resources window. If it is not visible, select Windows > Resources.
• Expand IDE connections and locate the SOA-MDS connection.
• Expand that and then expand SOA_DesignTimeRepository.
• Right-click apps and create a new folder named Templates. a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
2. With the LocalLogger composite still open in the editor window, right-click the BPEL
process LogFault and select Create Component Template.

The Create Component Template dialog box appears.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 5
3. Click the Browse Locations button for the “Save in” field. Save the template to the
Templates folder that you just created, under the SOA-MDS.
Select SOA MDS. Expand the apps folder. Select Templates folder.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)ha
m
co eฺ
n ฺ
Note that the selection field contains the location where the template is stored.
4. Click OK to return to the Create Component Template dialog box. l a t io uid
s t el nt G
c
5. Notice that you can choose a different icon for your template
de a meaningful
on andtuenter
description. Change the name to LogFaultTemplate r ni@ thand S my first BPEL
is enter
template for the description.
a
lk se
k u
Click Next.
p a kฺ to u
( d ee ense
6. Choose additional r n i to bundle.
files
e l ic
JDeveloper lunderstands l
ka rabthe dependences between different files, so some files are already
selected
u
Kand cannotfe be deselected without breaking the component template. You can
a k n s
e eInpthisnexercise,
choose to
- tra you files
add more to the template if you need to.
D no will simply accept what is selected and click Finish.
7. Return to Tools > Preferences > SOA > Templates to confirm that your new template was
added.
Close the dialog box when you are satisfied.

8. Open the CustomerProfile composite in the composite editor.

9. Right-click the Components swim lane and select Insert > Component Template.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 6
10. Select Log FaultTemplate and click OK.
Change the Main Component name to RecordFault, review the Template Entries, and
then click Finish when you are done reviewing the entries.
A new BPEL component and other components are added to the CustomerProfile
composite. Why did the other components get added as well as the BPEL component?
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

11. Switch back to the LocalLogger composite in the composite editor.

12. In the Component window, select SOA Templates.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
13. Drag the LogFaultTemplate icon to the Componentsi
rn thislane in the composite editor.
swim
k a
ฺ k ul use
exists, you see a warninge e p k sappears.
14. The Template Information dialogabox
indicator. e to Note that because this component already
i ( d icen
a r n le l
K ulk ferab
p a k ans
ee on-tr
D15. n can still add the component. Click Next.
You
In the Resolve Conflicts window, you can skip or override conflicts in the composite.
You are NOT going to actually add this template, so click Cancel to exit.
You have seen that you can use a component template in the same or different project
within the same application, making the reuse of components easier.

16. Close the LocalLogger composite editor tab.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 7
Practice 12-3: Creating and Using BPEL Scope Templates
(25 minutes)
Overview
In this practice, you create and use a BPEL Scope Activity Template.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. Open the CustomerProfile composite in the composite editor. Open the BPEL process
RecordFault.
2. Verify the scope after the receiveInput is configured as follows:
a. Scope name is: LogFaultToJMS.
b. The assign and invoke activities match the screenshot below:

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e pa stoethet PostFaultMsg Partner Link. Check to make
c. The InvJMS activity iseconnected
i (
sure that the invoke
n the local variable.
dactivityiciseusing
arn able l
l k
k Ku sfer
e p a ran
t
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 8
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
Verify the AssignFaultInfo activity mapping:

k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 9
3. Click the Create Custom Activity Template icon in the LogFaultToJMS Scope.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

4. Save the new template to the SOA-MDS apps/Templates folder.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
Click OK and click Next. o n s den
@ c Stu
i
n this so click Next.
5. You are not converting the input variable k a rlocal variable,
toa
k l e so click Next.
u anyuchanges,
s

6. View the Partner Link. You are not making
akto Bundle”towindow.
7. Expand the Adapters in thee p
“Files e
s selected. You decide to include the other
( de iceisnalready
Notice that the PostFaultMsg_jms
i
adapter as well,
a r n itlemight
because l be needed when used as the basis for a template.
K ulk ferab
Select WriteFaultAsFile_file.jca and click Finish.
p k
a ran s
e t
De non-

Once you click OK in the confirmation dialog box, the new template is created.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 10
8. In the Component window, expand the Custom Activity Templates section.

Do you see the template that you just created? If yes, then continue.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

9. Close the RecordFault and CustomerProfile tabs in the main window.


Open the LocalLogger composite in the editor and then open the BPEL component,
LogFault, for editing.
10. In the Component window, expand the Custom Activity Templates section. Drag the new
template, LogFaultToJMS and add it after the receiveInput activity.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
u lkCustomraActivity
11. In the Create b from Template window, notice the entries that will be
K
k ans
included. f e
p a
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 11
Click Next.

12. You are now prompted to resolve conflicts. For this practice, you simply take the default
selections to skip. However, you can choose to override the local files with the template, if
needed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

s a
)h a
m
co eฺ
n ฺ
l a t io uid
s t el nt G
c on tude
a r ni@ this S
k u lk se
p a kฺ to u
Click Next.
( d ee ense
r n i
e l ic
lkaBindings l
abscreen, you can choose to bind the template variable to a different
K u
13. On the Variable
f e r
p a k Youanares not going to do so, so click Finish.
variable.
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 12
The new scope has been added and integrated into the BPEL process. You can now make
any changes that this specific BPEL component needs.

14. Save your work and close all open editor windows.
You have seen how to create and reuse a scope template.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 13
Practice 12-4: Creating and Using BPEL Stand-Alone and Inline
Subprocesses (30 minutes)
Overview
In this practice, you create and use stand-alone and inline BPEL subprocesses. You start by
creating a reusable subprocess to broadcast an event and write to a file.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Tasks
1. Open the LocalLogger composite in the composite editor.
2. Right-click the Components swim lane and select Insert > Subprocess.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
s den
3. Name the process NotifyInterestedParties. con
i @ S tu
Note that you can choose where to save this r
a n this
subprocess. You can just use the default
location. k
ul use
ฺ k
e p ak e to
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Click OK.
The subprocess is created and is added to the composite diagram.

4. Right-click and select Edit to open the subprocess in the BPEL editor.
You now want to add an event publication and write the fault to a flat file to keep a record of
the fault.

5. Create an invoke activity to publish an event.


a. Add an invoke activity to the main scope.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Edit the invoke activity.


c. Change its name to PubEvent. Click Apply.
d. Change the Interaction Type to Event. a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a
6. Create a new Event r n Definition
l e land event.
a. Click
K uthelkBrowse
f e
b button.
raEvents
p a k ans
e tr
De non-

b. Click the Publish New Event button.

c. Click the Create EDL file button.


d. Change the EDL File name to NotifyEvents.
You can choose where to store the EDL files.
e. Click the Create button.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

f. Name the new event: NewFaultEvent.


g. Browse for the type and choose faultinfo as the type. Click OK and then click OK
again to create the event.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e n-tnewr event definition must look like this:
De noYour

h. Click OK three times to return to the invoke activity.


i. Create a new variable. Accept the defaults. Click OK twice to close the dialog boxes.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 16
7. Add a file Adapter as a Partner Link and configure it to write the FaultInfo to a file.
a. Drag the File Adapter to the Partner Link swim lane. Adapters are located in the BPEL
Services area of the Component window.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

b. Name it RecordFault. Click Next twice.


Notice the new File Server Connection JNDI name. This references a a
predefined file adapter connection pool. You can choose a different pool here. ) has
Click Next.
ฺ c om ฺ
c. Select Write and click Next.
t i o n ide
d. e lla t Gu
Set the outgoing directory to /home/oracle/NewFeatures12c/SOA/output.
t
e. o n s den
Set the file name to FaultRecord%yyMMddHHmmss%.txt. Click Next.
@ cthe FaultInfo.xsd.
S tu
f. Browse for the schema file and select faultinfo i in
g. Click OK, Next, and then Finish. The l k arn eLinkthisiscreated.
Partner
k ฺ ku o us
8. Create a new invoke activityetop a the e tFile Adapter.
de below
write to
e s
nthe PubEvent activity.
a. Add a new invoke i (activity
n activity. l i c
k arinvoke
b. Edit thelnew
a b le
1)
u er
KName sit fRecordFaultToFile. Click Apply.
a k n
ep 2) For trathe Partner Link, select RecordFault and click OK.
De no3)n-Create a new Input Variable. Accept the defaults.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 17
• Click OK to close the dialog box.
Your subprocess must now look like the screenshot below:
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
9. Save your work and close the NotifyInterestedParties sbpel editor.
n
10. Return to the LocalLogger composite editor. Edit the BPEL
o sprocess
d e n
LogFault.
11. Add the subprocess to the BPEL activity flow. i@
c Stu
a. Open the Subprocesses area of the Component
l k his
arn ewindow
t
b. Drag the new subprocess icon toฺk u beforeuthe
just s end of the BPEL process.
ak
p se t o
e e
d icen
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-

12. Edit the new call activity. Name it NotifyPeers.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 18
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
13. Set the value for the PubEvent_InputVariable ฺ c om ฺ
t i o n ide
a. Click Value, and then click the button with the ellipsis (...)
t e l la t Gu
b. Select Expression, and then click the Expression Buildersicon.
o n d e n
c payload
c. Expand to the description string element of the faultInfo
@ S tu of the BPEL process
inputVariable. i is
l
d. Click the Insert Into Expression button.k arncanealsothadd
You some static text if you wish, as
in the screenshot below. ฺ k u us
e. Click OK. e p ak e to
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

14. Set the values for the other two variables, as shown:

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 19
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
lla teditor.
eLogFault G u
15. Click OK. The new call is added. Save your work and closes
n t
the
e n
o
c Stu d
i
16. In the composite editor, add a new, one-way BPEL @
rn forththeisinput.
process named NotifyPartners. Do
k a
ฺ k ul use
not expose it as a SOAP service. Use faultinfo

e p ak e to
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

17. Open NotifyPartners in the BPEL editor.


From the Oracle Extensions section of the Component window, add a Call activity right after
the receiveInput activity.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 20
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

18. Double-click the Call activity to edit it.


a. Name it SendEventAndLog.
a
b. For the subprocess, choose NotifyInterestedParties from the drop-down list.
Note that the Arguments appear. ) has
For now, simply click OK without configuring these. ฺ c om ฺ
t i o n ide
update the variables with the correct data sources. t e lla t Gu
Later, after you build this BPEL process with more details, you can come back and

o n s den
@ c Stu
19. Save your work. Do not close the NotifyPartners i
rn theditor.
BPEL is
l k a e
k ฺ ku o us
20. You will now create a new inline subprocess.
e p a eStructuret
From the BPEL toolbar, select
d e en Propertys > Inline Subprocesses.
n i ( l ic
r l e
u lka rab
k K sfe
a
ep n-tran
e
D no

21. Highlight the Inline Subprocesses folder and click the green plus sign to create a new inline
subprocess.

22. Name the new subprocess NotifyJMSPartners.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 21
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
a. To edit the subprocess, you may need to open it in your BPEL editor.
t i o n If so, iclick
d e this
e la nt G
new subprocess after selecting it from the drop-down menu las shown u
below:
s t
c on tude
a r ni@ this S
k u lk se
a ฺ to u
kfaultInfoVar
e e p
b. Create a new variable named
s e schema. as an Element, based on the
faultInfo Type(in
i d lice
the n
FaultInfo
r n
u lka rable
k K sfe
a
ep n-tran
e
D no

Note that you can also add Partner Links, Correlation sets, and other activities as
appropriate. Close the dialog boxes when you are done.

23. Switch back to the Main Process.


a. Add a call to the new inline subprocess by dragging the new subprocess,
NotifyJMSPartners, from the Subprocess Inline section of the Component window
directly below the SendEventAndLog Call activity.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 22
24. Edit the new Call activity. Name it NotifyJMSPartners.
Set inputVariable as the variable.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
25. Your BPEL process must now look like the following:
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

26. Save your work and close all editor windows.

27. From the Tools menu, select Preferences > SOA > Templates.

28. You see all your previously created templates displayed. In this window, you can delete
existing templates and add new file locations containing templates, which can then be used
in JDeveloper.

29. If you right-click in the window, you can choose from the pop-up menu and filter by template
type.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 23
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Practices for Lesson 12: Templates and BPEL Subprocesses


Chapter 12 - Page 24
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
e l l a G u
Additionalns t
Practices: e t
n Sharing
o
c Stin
Functionality d
u Oracle SOA
i @
l k arn e this
Suite
k ฺ ku Chapter
o us13
e a
p se t
( e
d icen
r i
n le l
a
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 1
Overview
Practices Overview
In these practices, you first execute the setup steps to prepare the dependencies needed for
your new template-based BPEL application. You then import a BPEL template into the SOA
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Design Time Repository. You create a project, and use the BPEL component template to
accelerate development of the project. You then modify the project to include the creation and
calling of a BPEL in-line subprocess. Finally, you deploy and test the finished project.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 2
Practice A-1: Setting Up Dependencies for the New OrderFlow
Project
Tasks

Creating Additional Data in the Database


Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

1. From the JDeveloper menu, select File > Open.

2. Navigate to /home/oracle/NewFeatures12c/SOA/scripts/SQL.

3. Select JDBcreate_waitingorders.sql.
The file is opened in a SQL worksheet.

a
has
4. Click the Run Script icon.
)
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
The Select Connection dialog box is displayed. i@
c Stu
l k arn e this
5. Choose an existing connection. If k ku o uhas
a ฺconnection
s not already been created, click the
e
“Create a new connection” icon. a
p Otherwise, t
e you may skip to steps 10 and 11.
e n s
r n i (dconnection”
Click the “Create a new
l i ce icon.
u lka rable
k K sfe
a
ep n-tran
e
D no

6. Enter the following details:


• Connection Name: SOA
• Connection Type: Java DB (Derby)

7. Ensure that the default Java DB (Derby) settings match the following:
• CONN_HOSTNAME: localhost
• CONN_JDBCPORT: 1527
• Database Name: soainfra
• Library: Java DB JDBC Driver

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 3
Note: You probably need to select the library from the drop-down list.
8. Click the Test Connection button to verify that the connection works.
The following message is displayed: Success!
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
9. Click OK.

10. Click OK to close the Select Connection dialog box.


The script is run.

11. Close the.sql file tab that you opened.

Populating the Demo User Community


12. Deploy the web application to seed the embedded LDAP with users.
a. Right-click the Terminal icon on your desktop and select Open.
b. In the terminal window, initiate the deployment script by issuing the following
commands:
cd ~/NewFeatures12c/SOA/scripts/util

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 4
sh deploySeedApp.sh
The script confirms that deployment is completed.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

13. Run the DemoCommunitySeedServlet within the application that you just deployed to seed
the demo users to the internal LDAP database.
Note: The deployment script also added an icon to your desktop to access the newly
deployed application.
a. On your desktop, right-click the DemoCommunitySeedServlet icon and select Open.
a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
ar e this
An Untrusted Application Launcher promptnmay be displayed.
b. Click Launch Away to proceed. l k
u us
A browser window is opened k toฺk
e p a e to
nsappears.
http://localhost:7101/integration/SOADemoCommunity/DemoCommunitySeedServlet.
( de iceform
The Seed Demo Community
i
a r
c. Click the Submit n button.
l e l
K ulk ferab
p a k ans
e tr
De non-

A confirmation page lists the users and groups that were added.

14. Close the Seed Demo Community tab of your browser.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 5
Deploying Additional Projects
15. Deploy the Approval and ApprovalTaskForm projects.
a. In JDeveloper, right-click the Approval project and select Deploy > Approval.
b. Select “Deploy to Application Server.”
c. Select the “Overwrite any existing composites with the same revision ID” check box.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

The Task Flow Deployment screen appears.


d. Use the following options:
• Application Name: Change from SOAWorkspace to ApprovalTaskForm
• Overwrite Existing Application: Select this check box.
• Deployable Taskflow Projects: Select ApprovalTaskForm.jpr.
e. Verify your settings and click Next.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-
f. Select the application server IntegratedWebLogicServer.
g. Click Finish.
After a few seconds, the Oracle Deployment Configuration window appears.
h. Click Deploy.
i. In the Deployment – Log window, verify that the deployment is successful.

Note: You may ignore the following compiler warnings:


Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 6
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

16. Update the Host Name for the ApprovalTaskForm application


a. In Enterprise Manager FMW Control, click the “Approval [1.0]” composite link, and then
click the ManualApproval link in the Components window.
b. Click the Administration tab. This may take a few seconds to render.
c. Change the Host Name field to: soa12c.example.com
d. Click the Apply button. Click OK to confirm the change.

a
has
17. Test the Approval composite application.
On another web browser tab, open the Worklist application: )
ฺ c om ฺ
a. Access the Oracle BPM Worklist application: [DO NOT use localhost.]
t i o n ide
t e lla t Gu
http://soa12c.example.com:7101/integration/worklistapp

o n s den
b. Log in to the application as jcooper with the password welcome1.
c Stu
c. In EM FMW Control, on the “Approval [1.0]” home page, click the Test button.
@
i
Request tab. l k arn e this
d. On the Test Web Service page, scroll down to the Input Arguments section on the

k ฺ ku o us
e. Use the Browse button to replace the sample XML data with the contents of the
e p a et
de icens
/home/oracle/NewFeatures12c/SOA/files/resources/sample_input/pro
i (
cessOrder.xml file.
n le l
a r
f. Click Test Web Service.
K ulk ferab
g. Switch to the Worklist application tab.
p a k ans
h. Click the Refresh icon.
e tr
De non-
i. Click the Manual Approval task entry.
The order details are displayed in the lower pane.
j. Click Approve.
k. Return to the Enterprise Manager tab.
l. On the Response tab, click the Launch Flow Trace link and verify that the composite
instance has completed.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 7
Practice A-2: Using a BPEL Component Template and a Subprocess
Assumptions
This practice assumes you have completed Practice A-1.

Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Importing Templates to the SOA Design Time Repository


1. Import templates from the.jar file to the Design Time Repository.
a. In JDeveloper, in the IDE Connections section of the Resources tab, right-click SOA-
MDS and select Refresh.

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
b. Expand the SOA-MDS
i ( de folder
c e nsright-click SOA_DesignTimeRepository.
and
a r
c. In the context l e li “Import from Jar.”
nmenu, select
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 8
d. Navigate to the JAR file location:
/home/oracle/NewFeatures12c/SOA/files/resources/mds.jar
Click Open.
e. In the “Import from Jar” window, click Import.
f. In the IDE Connections pane, expand the /apps folder and verify successful import of
the specified template.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Creating a Project
2. In the SOAWorkspace application, create a new empty SOA project named OrderFlow.
The composite.xml file is created and the overview window is opened for editing. a
) has
Adding a BPEL Component from a Template
ฺ c om ฺ
3. Add a BPEL Component from a template.
t i o n ide
t e lla t Gu and select
a. In the component overview window, right-click in the Components swimlane
Insert > Component Template.
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
ulk fComponent
TheKChoose e rab Template dialog box appears.
p a k Ifathe n sComponent Template option does not appear, stop the Integrated
r
e n-t Server. Close and reopen JDeveloper. Restart the Integrated WebLogic
Note:
De noWebLogic
Server. You can resume your work while it is restarting.
b. Select ProcessOrder and click OK.

The “Create SOA Component from Component Template” dialog box appears.
c. Examine the template entries and click Finish.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 9
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
The composite overview window is updated.i@c S tu
d. Verify your project and save your work.ar
n this
l k
u use
ฺ k
e p ak e to
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Note: Expect many error messages as you save. Recall that JDeveloper performs a
validation check each time you save. These errors indicate that the project is not fully
configured, which is expected at this point.

Creating and Configuring a Database Adapter


4. In the assembly model (composite.xml) for the OrderFlow project, add a Database
adapter to the External References swimlane.
The Adapter Configuration Wizard opens.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 10
5. To configure the Database adapter, perform the following steps:
Step Screen Choices or Values
a. Database Adapter Name: UpdateStatus
Reference
b. Service Connection Verify the following settings: (You may need to use
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

the Browse icon to obtain the SOA Connection.)


• Connection: SOA
• User Name: soainfra
• Driver:
org.apache.derby.jdbc.clientDriver
• Connect String:
jdbc:derby//localhost:1527/soainfra
• JNDI Name: eis/DB/SOA
s a
c. Operation Type Select the “Perform an operation on a Table”) ha
option.
ฺ c om ฺ
Ensure that only the Update Only
t i o n box
check
i d eis
selected.
e lla t G u
n s t
Deselect the other operations. e n
c o u d
d. Select Table Click Importi@Tables. St
e. Import Tables k
Setlthe
rn filter.
aBCA_% e t his
ฺ u Query.
kClick us
ak
p Move t o
f. Import Tables ee
d e n se the BCA_ORDERS table from the Available list
n i ( l ic to the Selected list.
r l e
u lka rab Click OK.
g. k KSelect s fe
e p a r a n Table Verify that the BCA_ORDERS table is listed.
t
De nh.on-Relationships Click Next.
i. Attribute Filtering Deselect all attributes except status.
j. Advanced Options Click Next.
k. JCA Endpoint Properties Click Next.
l. Finish Click Finish.

6. In the Composite Editor, wire the ProcessOrder BPEL process to the UpdateStatus external
reference.
7. Open the BPEL process for editing.
8. Verify that UpdateStatus is shown in the Partner Links column and save your work.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 11
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Modifying the BPEL Process


9. Add a new Scope activity to the BPEL process, just below the GetValidation activity.
10. Create and configure an Invoke activity.
a. Add an Invoke activity to the new Scope.
a
has
b. To specify the partner link, drag the Invoke activity to the UpdateStatus partner link.
)
The Edit Invoke dialog box appears.
ฺ c om ฺ
c. Name the new activity Invoke_Update.
t i o n ide
d. Create a new Input variable.
t e lla t Gu
e. Verify and save your work.
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 12
11. Create and configure an Assign activity.
a. Add an Assign activity within the Scope activity, just above Invoke_Update.
b. Name the activity SetUpdate.
c. Right-click the new activity and select Edit.
d. Map the outputVariable element orderId to the ordId element of
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Invoke_Update_update_inputVariable.
e. Map the outputVariable element status to the status element of
Invoke_Update_update_inputVariable.
f. Verify and save your work.

Converting the Scope to a Subprocess s a


) h a
Updating the order status is something that will need to be done multiple times in this business
process. For this reason, it makes sense to convert the update function (as defined m
co in the scope
n ฺ ฺ
activity) to a subprocess.
l a t io uide
s t el nt G
con Stude
12. Convert the Scope1 scope to a subprocess.
a. Collapse the scope and right-click the Scope @
ni this
icon.
a r
b. Select “Convert to a Subprocess.”
k u lk se
p a kฺ to u
( d ee ense
r n i
e l ic
lka rab l
u
K sfe
a k
e ep n-tran
D no

The Create Inline Subprocess dialog box appears.


c. Name the subprocess updateOrderStatusSP.
Leave the “Replace Scope with Subprocess Call” check box selected. This
automatically replaces the current scope with a Call activity.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 13
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
d. Click OK. ฺ c om ฺ
t i o n ide
A call activity is displayed in the process.
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Note: The subprocess is also displayed in the Palette under Subprocesses. You can
see and edit the definition of the subprocess when switching from the Main Process to
the subprocess on top of the BPEL editor. All partner links that are available in the
Main Process are displayed, in case you want to add another Invoke. Changes to the
subprocess are reflected in every call.

13. Add a call activity after ValidationService.


a. Expand the Subprocesses section of the Component Palette.
The updateOrderStatusSP subprocess is displayed.

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 14
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
b. Drag the updateOrderStatusSPฺk u usfrom the Component Palette to the BPEL
p k subprocess
to just below the GetApproval activity.
aof the eIf activity,
process, within the If branch
e
de icens
i (
n le l
a r
K ulk ferab
p a k ans
e tr
De non-

A new call activity is added to the process. That is all that needs to happen to invoke
the subprocess and have the order status updated to whatever value is returned by the
call to the approval process (APPROVED or REJECTED).

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 15
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

a
14. Save your work. ) has
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 16
Practice A-3: Deploying and Testing the OrderFlow Composite

Assumptions
This practice assumes that you have completed Practices A-1 and A-2 successfully.

Tasks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

Deploying the Composite Application


1. Deploy the OrderFlow composite application to IntegratedWebLogicServer.
Remember to select the “Overwrite any existing composites with the same revision ID”
check box.

Testing the Composite Application


Overview: In this section, you submit an order that will first have the credit card validated, and if
a
has
the card is valid, will have the order manually approved. As employee jcooper, you log in to
the Worklist application to approve the order. Before you do that, you open a SQL script, the
)
Worklist application, and the Enterprise Manager Test window.
ฺ c om ฺ
o n ide
2. In JDeveloper, open the JDBlist_waitingorders.sql file located at:
t i
/home/oracle/NewFeatures12c/SOA/scripts/SQL/.
t e lla t Gu
n
3. In a web browser, open the Worklist application:
o s den
c Stu
a. Access the Oracle BPM Worklist application: [DO NOT use localhost.]
@
i
l k arn e this
http://soa12c.example.com:7101/integration/worklistapp

k ฺ ku o us
b. Log in to the application as jcooper with the password welcome1.
p a et
4. On a second web browser tab, open the Oracle Enterprise Manager Test page.
e
( de icens
a. Access Enterprise Manager at http://localhost:7101/em.
i
a r n le l
b. In the Target Navigation pane, expand the SOA > soa-infra > default nodes in the tree.

K ulk ferab
Click the “OrderFlow [1.0]” link.

p a k ans
c. On the “OrderFlow [1.0]” home page, click the Test button.
e tr
De non-
d. On the Test Web Service page, scroll down to the Input Arguments section to the
Request tab.
e. Use the Browse button to replace the sample XML data with the contents of the
/home/oracle/NewFeatures12c/SOA/files/resources/sample_input/pro
cessOrder.xml file.
DO NOT click Test Web Service just yet.
5. Execute the following steps (quickly in sequence) for testing:
a. In JDeveloper, with the JDBlist_waitingorders.sql tab selected, click Run
Script.

b. In Enterprise Manager, click Test Web Service.


c. Quickly switch to the Worklist application tab.
d. Click the Refresh icon.
e. Click the Manual Approval task entry.
The order details are displayed in the lower pane.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 17
f. Click Approve.
g. In JDeveloper, with the JDBwaiting_orders.sql tab selected, click Run Script.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2016, Oracle and/or its affiliatesฺ

h. Return to the Enterprise Manager tab.


i. On the Response tab, click the Launch Flow Trace link.
j. Examine the audit trail for ProcessOrder.
k. View each of the payload options and observe the changes in the Status field.

Note: If it took more than 30 seconds to complete steps b–f, your results in step g will vary.
The status field may read ‘VALID.’ Enterprise Manager will report a test failure because the
test will have timed out.
a
has
For the purpose of this exercise, you can ignore this and simply try to run the test scenario
again. )
ฺ c om ฺ
t i o n ide
t e lla t Gu
o n s den
@ c Stu
i
l k arn e this
k ฺ ku o us
e p a et
i ( de icens
a r n le l
K ulk ferab
p a k ans
e tr
De non-

Copyright © 2016, Oracle and/or its affiliates. All rights reserved.

Additional Practices: Sharing Functionality in Oracle SOA Suite


Chapter 13 - Page 18

You might also like