From jbosstools-commits at lists.jboss.org Wed Dec 26 07:51:13 2007 Content-Type: multipart/mixed; boundary="===============5101736950550212073==" MIME-Version: 1.0 From: jbosstools-commits at lists.jboss.org To: jbosstools-commits at lists.jboss.org Subject: [jbosstools-commits] JBoss Tools SVN: r5443 - trunk/jbpm/docs/reference/en/modules. Date: Wed, 26 Dec 2007 07:51:13 -0500 Message-ID: --===============5101736950550212073== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ochikvina Date: 2007-12-26 07:51:13 -0500 (Wed, 26 Dec 2007) New Revision: 5443 Modified: trunk/jbpm/docs/reference/en/modules/Test_Drive_Proc.xml trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml trunk/jbpm/docs/reference/en/modules/the_views.xml Log: http://jira.jboss.com/jira/browse/JBDS-233 - updating accroding to Svetlana= Mukhina remarks = Modified: trunk/jbpm/docs/reference/en/modules/Test_Drive_Proc.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jbpm/docs/reference/en/modules/Test_Drive_Proc.xml 2007-12-26 12:= 45:39 UTC (rev 5442) +++ trunk/jbpm/docs/reference/en/modules/Test_Drive_Proc.xml 2007-12-26 12:= 51:13 UTC (rev 5443) @@ -53,7 +53,7 @@ =
- Call the JUnit Test Class Creation wizard + Call the JUnit Test Case Creation wizard = @@ -64,9 +64,9 @@ = And then Java > JUnit > JUnit Test Case - to call the specialized JUnite Test class creation wiz= ard. + to call the specialized JUnite Test case creation wiza= rd.
- Call the JUnit Test Class Creation wizard + Call the JUnit Test Case Creation wizard = @@ -90,26 +90,27 @@ By default JUnite 3 version of testing framework is selected. Of= course, you can choose new advanced JUnit 4 version. In this case you'll be prompted= to add new JUnit Library to your build path. To add it automatically just click on = the appropriate link. - = +
A First Test Scenario - = +
- = + Then, we call the test class HelloTest - and press - Finish button to complete. - = - Next, we should write a simple test scenario as shown on the ne= xt figure. Let's study the - code of this test case. + and press + Finish + button to complete. = -
+ Next, we should write a simple test scenario as shown on the ne= xt figure. Let's + study the code of this test case. + +
A First Test Scenario = @@ -159,8 +160,8 @@ Of course, this simple scenario was not very interesting, but t= he purpose of it was to show how you can reuse your development skills in a very straightf= orward way when doing process development. To see how more interesting processes and pro= cess test - scenario's can be developed, we suggest you to read the JBoss jBPM User - Guide and to study the API reference. Moreover some= more examples will be - given later in this book. + scenario's can be developed, we suggest you to read the JBoss jBPM Use= r Guide and to + study the API reference. Moreover some more examples will be given= later in this book. = Modified: trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml 2007-1= 2-26 12:45:39 UTC (rev 5442) +++ trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml 2007-1= 2-26 12:51:13 UTC (rev 5443) @@ -13,25 +13,37 @@ Actions : The JBoss jBPM Integration Mechanism = In this chapter we will show how to do software integration wit= h JBoss - jBPM. The standard mechanism to realize this is to wrap= the functionality you + jBPM. The standard mechanism to implement this is to wr= ap the functionality you want to integrate in a class that implements the ActionHandler - interface. In order to demonstrate it let's specify He= llo World action for our process. + interface. In order to demonstrate it let's specify He= llo World action for our + process. =
Creating a Hello World Action - = - Each Hello World process should integrate one or more Hello = World actions, so this is what we - will be doing. We can integrate custom code at different point= s in the process + + Each Hello World process should integrate one or more Hello = World actions, so this is + what we will be doing. We can integrate custom code at differe= nt points in the process definition. To do this we have to specify an action handler, r= epresented by an implementation of the ActionHandler interface, and attach this piece of code to a part= icular event. These events - are amongst others, going over a transition, leaving or enteri= ng nodes, after and - before signalling. + are amongst others, going over a transition, leaving or enteri= ng nodes, after and before + signalling. = + To make things a little bit more concrete, let's creat= e a new class called + HelloActionHandler + . For that firstly we'll create a new package = + com.jbay.action + in the + src/java/main + folder of our project. Then, we should call New Cl= ass Creation wizard as + usual by right-clicking and navigating + New > Class + . +
- A Simple Hello Action + Creating HelloActionHendler Class = @@ -40,14 +52,26 @@
= - To make things a little bit more concrete, we will implemen= t an - ActionHandler - . To do this, create a new class called + Notice that two first gaps have been filled automatically. H= ere, instead of + Package + option + Enclose type + option can be selected where a type in which to en= close a new class should + be specified. + + In our case, we leave everything as it is, just type HelloActionHandler - , which implements the + as a name of new class and add + org.jbpm.graph.ActionHendler + interface as it's shown in the picture above.= + + Thus, our + HelloActionHandler + implements the ActionHandler - interface and implement the execute method as show= n in the next figure. This - test will add a variable named + interface including the + execute + method as shown in the next figure. Here, we add a= variable named greeting to the collection of process variables and puts a = message in it : "Hello from ActionHandler".= @@ -57,44 +81,59 @@ = - +
+ + Now, as we have + HelloActionHandler + class defined, let's explore how we can handl= e it. =
Integrating the Hello World Action - = - The main purpose of this chapter is to provide you with the = steps to associate - our Hello World action with a particular event and test the co= rrectness of our actions as well. = + The main purpose of this chapter is to provide you with the = steps associating our + Hello World action with a particular event and test the correc= tness of our actions as + well. + As good Testcity citizens we will first create a Unit Test = that proves the behaviour we want to achieve by adding the ActionHandler - to the process. So we implement another test. Crea= ting the process instance - is code we already saw in the previous chapter. We assert that= no variable called - - greeting exist. Then we gi= ve the process a signal to move it to the first state. We want - to associate the execution of the action with the event of goi= ng over the transition - from the start state to the first state. So after the signal, = the process should be in - the first state as in the previous scenario. But moreover, the= + to the process. So we implement another test. + = + At first, let's return to the + code we already saw in the pre= vious chapter and add new test method + testActionHendler to it= . + = +
+ Create the Hello Action Test + = + + + + + +
+ = + We assert + that no variable called greeting + exist. Then we give the process a signal to move i= t to the auction state. We + want to associate the execution of the action with the event o= f going over the + transition from the start state to the auction state. So after= the signal, the process + should be in the auction state as in the previous scenario. Bu= t moreover, the + greeting variable should exist and contain the string "= ;Hello from ActionHandler". That's what we assert in the last li= nes of the test method. = -
- Create the Hello Action Test + = = - - - - - -
- - Running the tests now results in a failure. As a matter of = fact, we did not associate + Running the tests now results in a failure. The point is th= at we did not associate the action with any particular event in the process definition= , so the process variable did not get set. = @@ -103,7 +142,8 @@ = - +
@@ -111,7 +151,7 @@ Let's do something about it and add an action to the f= irst transition of our sample process. To do this you can use the Actions tab in the = Properties Editor that is under the graphical canvas. Bring up the popup menu of the act= ion element container and - chose New Action as it's shown on the screenshot below. The ot= her way to add an action + chose New Action as it's shown on the figure below. The other = way to add an action to the transition is simply to use the dropdown menu that is a= vailable under the action icon in the right upper corner of the Properties View. = @@ -147,7 +187,8 @@ = - +
@@ -178,7 +219,8 @@ = - +
@@ -190,7 +232,8 @@ Integration Points = The different integration points in a process definition ar= e thoroughly documented in - the JBoss jBPM User Guide. Instance nodes= can contain many action + the JBoss jBP= M User Guide. Instance nodes can contain many action elements. Each of these will appear in the Action element list= of the Actions tab. But each Action also has a properties view of itself. You can navi= gate to this view by selecting the added Action in the outline view. Modified: trunk/jbpm/docs/reference/en/modules/the_views.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- trunk/jbpm/docs/reference/en/modules/the_views.xml 2007-12-26 12:45:39 = UTC (rev 5442) +++ trunk/jbpm/docs/reference/en/modules/the_views.xml 2007-12-26 12:51:13 = UTC (rev 5443) @@ -191,8 +191,8 @@ - Then, as its value in the right column we can put the te= xt This - transition leads to the end state. + Then, we can put the text This + transition leads to the end state in the right = column as its value. =
Comment is added --===============5101736950550212073==--