15
Protsesside realiseerimine, BPEL Tarvo Treier [email protected]

Protsesside realiseerimine, BPEL Tarvo Treier [email protected]

Embed Size (px)

Citation preview

Page 1: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Protsesside realiseerimine, BPEL

Tarvo Treier

[email protected]

Page 2: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Täna kavas

KordamineProjektBPELÜlesanded

Page 3: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Kordamine

XMLXSDWSDLSOAPVeebiteenusXPathXSLT IP

Data

Server KlientHTTP/JMS/SMTP/...

SOAP

Envelope

Header (metainfo)

Body (info)

WSDL

Spec Types Messages PortTypes

Access Binding Service

XSD

ElementsSimpleTypesComplexTypes

Page 4: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Projekt

Iga grupp valib omale teema (vt. eelmise tunni suusalaenutust) ja kooskõlastab selle õppejõuga.

Kui ise ei oska teemat valida, saate selle õppejõu käest. Kui tänase tunni jooksul on teema välja valitud, siis saate

boonuspunkti. Projekt koosneb 3 osast:

Protsessi kirjeldus tekstiline (Use Case) graafiline (vabalt valitud notatsioonis eelmises tunnis mainitute hulgast)

Protsessi realisatsioon BPEL-is (+SoapUi projekt protsessi väljakutseks ja veebiteenused, mida protsess kasutab, kui need pole avalikud teenused)

Kes soovib, võib protsessi kirjeldada kahes osas: teha nö. AS-IS analüüsi ja tehnilisele protsessile lähema TO-BE analüüsi.

Projekti formaalse kirjelduse panen välja selle nädala lõpuks.

Page 5: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Mis on BPEL?

Business Process Execution Language Wikipedia:

http://en.wikipedia.org/wiki/Business_Process_Execution_Language

Standard: http://docs.oasis-open.org/wsbpel/2.0/wsbpel-v2.0.pdf

Tutorial: http://www.netbeans.org/kb/61/soa/bpel-guide.html, http://weblogs.java.net/blog/kalali/archive/2007/05/a_scenario_base.html

Page 6: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL

<bpel:process name="simpleExampleProcess" targetNamespace="foo"xmlns:bpel="http://schemas.xmlsoap.org/ws/2003/03/business-process/"xmlns:links="wsdl://elsewhere">

[... declarations omitted ... ]

<bpel:sequence> <bpel:receive partnerLink="invoker" portType="links:in“ operation="computation" variable="input" /> <bpel:assign> <bpel:copy> <bpel:from variable="input" part="argument1" /> <bpel:to variable="input1" part="root" /> </bpel:copy> </bpel:assign><bpel:invoke partnerLink="service1" portType="links:service1Input“ operation="computation1" inputVariable="input1" />

[... more BPEL omitted ... ]

<bpel:reply partnerLink="invoker" portType="links:in“ operation="computation" variable="result" /></bpel:sequence></bpel:process>

BPEL kood (XML)

BPEL visuaalne vaade

Page 7: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL protsess

Page 8: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL elemendid(1)

Help> SOA Development > BPEL Designer

Page 9: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL elemendid(2)

Invoke. Enables the business process to send a message to a partner web service. Invokes a one-way or request-response operation on a portType offered by a

partner. The operation is defined in the partner's WSDL file.

Receive. Causes the process to wait for a matching message to arrive from a partner service. The process cannot continue or end until it receives a matching message from the partner service.

Reply. Causes the process to send a message in reply to a partner service's message that came through a Receive activity.

Partner Link. Identifies a partner web service listed in the BPEL source code which will exchange messages with your business process. The relationships between your process and a partner web service are characterized by defining the "roles" played by each of the services and specifying the portType provided by each service to receive messages.

Page 10: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL elemendid(3)

Assign. Copies the values of one variable to another, or assigns new data to variables using expressions. For details, see About the BPEL Mapper.

Empty. Expresses no particular activity, and thus is useful when a fault needs to be caught and suppressed.

Wait. Instructs the process to wait for a specified time or until a certain time has passed. Only one of the expiration criteria must be satisfied.

Throw. Generates a fault from inside a business process or throws an exception within a business process. It can be used to explicitly signal an internal fault of the process.

Exit. Terminates the execution of a business process instance.

Rethrow. Rethrows the fault caught by the fault handler

Compensate. Terminates the execution of a business process instance.

CompensateScope. Terminates the execution of a business process instance.

Page 11: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

BPEL elemendid(4)If. Specifies a conditional process behavior when one branch of activity is executed from a set of choices.

While. Repeats an activity as long as the specified condition is true.

Repeat Until. Repeatedly executes one or more activities as long as specific conditions hold true after the execution of each iteration.

For Each. Repeatedly executes the activities contained inside a Scope activity N+1 times, where N equals the Final Counter Value minus the Start Counter Value.

Flow. Specifies one or more activities to be performed concurrently, one after another.

Sequence. Defines a collection of activities to be performed sequentially, in the order they are listed.

Pick. Waits for the occurrence of one of the defined events and then performs the activity associated with the event that occurred. The occurrence of these events is often mutually exclusive. If more than one event occurs, the one that occurred first is performed.

Scope. Defines a nested activity with its own associated local variables, fault handlers, partner links, and correlation sets.

Page 12: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

<?xml version = "1.0" encoding = "UTF-8" ?><process name="tempConverter"

.... <variables>

<variable name="inputVariable" messageType="client:tempConverterRequestMessage"/>

<variable name="invokeFaherenheitToCelsiusInput"

messageType="ns1:FahrenheitToCelsiusSoapIn"/> </variables>

<sequence name="main"> <receive name="receiveInput" partnerLink="client" portType="client:tempConverter"

operation="process" variable="inputVariable" createInstance="yes"/> <assign name="assignFaherenheitToCelsiusInput"> <copy> <from variable="inputVariable" part="payload"

query="/client:tempConverterProcessRequest/client:input"/>

<to variable="invokeFaherenheitToCelsiusInput" part="parameters"

query="/ns1:FahrenheitToCelsius/ns1:Fahrenheit"/>

</copy> </assign> <invoke name="invokeFaherenheitToCelsius" partnerLink="TempconvertService_PL"

portType="ns1:TempConvertSoap" operation="FahrenheitToCelsius" inputVariable="invokeFaherenheitToCelsiusInput"

outputVariable="invokeFaherenheitToCelsiusOutput"/> ... <reply name="replyOutput" partnerLink="client" portType="client:tempConverter"

operation="process" variable="outputVariable"/> </sequence></process>

Muutujate defineerimine

Protsessi sisend

Protsessi väljund

Väärtuste omistamine (XPATH)

Välise teenuseväljakutsumine

Page 13: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Ülesanne 1

Loo lihtne sünkroonne BPEL protsess, mille sisendiks on nimi (string) ja väljundiks sisestatud nimi + “, tere!”.

Kutsu loodud protsess välja kasutades SoapUi-d

Page 14: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Ülesanne 2

Muuda Ülesanne 1 BPEL protsessi nii, et see kutsuks välja avaliku temperatuuri teisendamise veebiteenuse: http://www.w3schools.com/webservices/tempconvert.asmx?WSDL

Protsess peab tagastama konverteerimise tulemuse. Lisa protsessi uus sisendparameeter “action” ( valige

ise sobiv andmetüüp ja võimalikud väärtused ) ja protsess peab “action” sisendi põhjal otsustama, kas kutsuda välja operatsioon FahrenheitToCelsius või CelsiusToFahrenheit.

Kutsu loodud protsess välja kasutades SoapUi-d

Page 15: Protsesside realiseerimine, BPEL Tarvo Treier idu0110@gmail.com

Ülesanne 3

Võta aluseks eelmises tunnis kirjeldatud suusalaenutuse protsess ning loo selle protsessi realisatsioon

Kutsu protsess välja SoapUI-d kasutades.