TIES532 (2012): Guidelines for the 4 computer class demo

smuthhomelyΔιακομιστές

17 Νοε 2013 (πριν από 3 χρόνια και 8 μήνες)

134 εμφανίσεις

Demo 4

TIES532 (2012
)



TIES532

(2012
)
: Guideline
s

for
the
4
th

computer class demo


The objective:

To get familiar with
BPEL
. In this demo we will work with Eclipse BPEL Designer and
Apache ODE as BPEL engine.


The task:


1

Prepare the environment

You have two options in the
preparation:



You take a single ZIP file that contains everything (Apache ODE+ Eclipse +BPEL designer )

o

go to step 2 and then to step 4



You configure everything yourself from scratch (if you want to learn something more)

o

go to step 3 and then to step 4


2

Simple environment preparation

2.1

Download
http://users.jyu.fi/~minagy/ties532/demos/demo4/bpel
1
.zip

to any folder you want.

2.2

Unzip its content to c:
\
My
Temp
\



This is very important!!!
It must be unzipped into this folder.

2.3

Now you should see
bpel folder
under
your c:
\
My
Temp folder.

Under bpel folder there should be two
folders (eclipse and
apache
-
tomcat
-
5.5.35
).

2.4

Run eclipse from eclipse folder. Apache ODE is in
apache
-
tomcat
-
5.5.35

folder.



3

Environment preparation from scratch

3.1

You should start by installing
Ec
lipse BPEL Designer and Apache ODE
. There is fairly clear tutorial
at
http://www.eclipse.org/bpel/users/pdf/HelloWorld
-
BPELDesignerAndODE.pdf
. Read chapters 1
and 2, but
s
kip
subchapters

2.2.1

and 2.2.2
. The document itself it not completely fresh, therefore it
refers to older versions of Apache ODE and other components. When following these instructions,
install these versions of the software that is mentioned in the tuto
rial:



Apache Tomcat 5.5.
35

(not higher
, just to be sure
)



Apache ODE 1.3.5



Eclipse IDE for Java EE Developers (206 MB) (
http://www.eclipse.org/downloads/
)



Ecli
pse BPEL Designer plug
-
in 0.5.0

(update site:
http://download.eclipse.org/
bpel/update
-
site/
)

3.2

After successful installation of Apache ODE and Eclip
se BPEL Designer, call the teacher and he
will
check if ODE is configured prop
erly
.


4

Create a simple
BPEL

process

4.1

Read chapter 3 from
the tutorial mentioned in step 3
.1
.

Try to create a simple Hello world process and
run it.

When it works as it should, proceed to the next step.

Important comment
: In step 3 of chapter 3 you will be
asked to configure the binding. The path to
your service must look like http://localhost:8080/ode/processes/<
process
_name>

Demo 4

TIES532 (2012
)



4.2

Create a new project BPEL project. Do not use the same project as in step 2.1. Within this new
project, create a new BPEL process fi
le called
decisionProcess.bpel
.
This will also create files
decisionProcess.bpelex

and
decisionProcessArtifacts.wsdl
.

The

process will have the following
parameters as input and output:



input:

o

name (xsd:string)

o

age (xsd:integer)



output:

o

resultMessage (xsd:
string)

4.3

The idea of the process is that the user enters his name (e.g. “John”) and age (e.g. 20) and the system
answers by returning a string in resultMessage parameter. In case user’s age is higher than 18, the
resultMessage is equal to “Good <name>, you
are old enough.”. Otherwise resultMessage is equal to
“Sorry <name>, you are too young.” Examples of input
-
output pairs:



case 1: input=”John”, 20 => output=”Good John, you are old enough.”



case 2: input=”Mary”, 17 => output=”

Sorry Mary, you are not too
young.”

4.4

In order to keep this demo simple, we don’t call any partner services. We just utilize building blocks
like <bpel:if>, <bpel:assign> and XPath features to complete this demo.


Submission of demo results:

In order to submit the demo result, please,
use the online submission system at
http://users.jyu.fi/~minagy/ties532/students/login.php
.

The system expects
these files to be uploaded:



decisionProcess.bpel



decisionProcess.bpel
ex



decisionProcess
Artifacts
.
wsdl



deploy.xml


Deadline:
as always, one week later


Tips
:

1.

Always initialize variables when you declare them
.

It might make sense to have one big assign block
in the beginning of the process where all the variables are assigned.

2.

When building a BPEL process, input and output message definition should be the first step in the
modeling process
. Do not do it later in the process, because you may need to change other elements
as well.

3.

Don’t forget that you can always edit the source c
ode of a BPEL process in XML view (some things
might be easier/faster with it)
. However, be sure that the changes are properly reflected in the
graphical model. If not, perform what is described in the next tip.

4.

Sometimes when things go wrong with the visu
al BPEL editor, closing and opening your *.bpel file
will help the editor to “refresh”/”restart”
.

5.

When you deploy a new version of your process

and you want to test it
, always reload the Web
Service Explorer

(reload = right
-
click on the wsdl file and call
Web Service Explorer).

Demo 4

TIES532 (2012
)



6.

After every successful test

of your code (e.g. using Web Service Explorer)
, save the BPEL XML
code into a separate
text
file
. This way

you can “roll back” any time to a working solution
. It is
reasonable to keep a history of these
XML source codes.

Another way is to use an Eclipse feature. Eclipse remembers the history of every file and it can show
you how the file looked like at certain time in the past. Just right click on the file and from the menu
choose Team
-
>Show Local History
.

Then double
-
click on the date you want to see. You can also
compare files between each other.