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
===================================================================
--- 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 @@
</emphasis></para>
<figure>
- <title>Call the JUnit Test Class Creation wizard</title>
+ <title>Call the JUnit Test Case Creation wizard</title>
<mediaobject>
<imageobject>
@@ -64,9 +64,9 @@
<para> And then <emphasis>
<property>Java > JUnit > JUnit Test
Case</property>
- </emphasis> to call the specialized JUnite Test class creation
wizard.</para>
+ </emphasis> to call the specialized JUnite Test case creation
wizard.</para>
<figure>
- <title>Call the JUnit Test Class Creation wizard</title>
+ <title>Call the JUnit Test Case Creation wizard</title>
<mediaobject>
<imageobject>
@@ -90,26 +90,27 @@
<para>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.</para>
-
+
<figure>
<title>A First Test Scenario</title>
-
+
<mediaobject>
<imageobject>
<imagedata
fileref="images/Test_Drive_Proc/test_driv_proc_2b.png"
scale="75"/>
</imageobject>
</mediaobject>
</figure>
-
+
<para>Then, we call the test class <emphasis>
<property>HelloTest</property>
- </emphasis> and press <emphasis>
- <property>Finish</property></emphasis> button to
complete.</para>
-
- <para> Next, we should write a simple test scenario as shown on the next
figure. Let's study the
- code of this test case. </para>
+ </emphasis> and press <emphasis>
+ <property>Finish</property>
+ </emphasis> button to complete.</para>
- <figure>
+ <para> Next, we should write a simple test scenario as shown on the next
figure. Let's
+ study the code of this test case. </para>
+
+ <figure id="hello_test">
<title>A First Test Scenario</title>
<mediaobject>
@@ -159,8 +160,8 @@
<para> Of course, this simple scenario was not very interesting, but the
purpose of it was to
show how you can reuse your development skills in a very straightforward way when
doing
process development. To see how more interesting processes and process test
- scenario's can be developed, we suggest you to read the
<property>JBoss jBPM User
- Guide</property> and to study the API reference. Moreover some more
examples will be
- given later in this book.</para>
+ scenario's can be developed, we suggest you to read the <ulink
+
url="http://docs.jboss.com/jbpm/v3/userguide/">JBoss jBPM User
Guide</ulink> and to
+ study the API reference. Moreover some more examples will be given later in this
book.</para>
</chapter>
Modified: trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml
===================================================================
--- trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml 2007-12-26 12:45:39
UTC (rev 5442)
+++ trunk/jbpm/docs/reference/en/modules/The_JBoss_jBPM_Int_Mech.xml 2007-12-26 12:51:13
UTC (rev 5443)
@@ -13,25 +13,37 @@
<title>Actions : The JBoss jBPM Integration Mechanism</title>
<para> In this chapter we will show how to do software integration with
<property>JBoss
- jBPM</property>. The standard mechanism to realize this is to wrap the
functionality you
+ jBPM</property>. The standard mechanism to implement this is to wrap the
functionality you
want to integrate in a class that implements the <emphasis>
<property>ActionHandler</property>
- </emphasis> interface. In order to demonstrate it let's specify Hello
World action for our process.</para>
+ </emphasis> interface. In order to demonstrate it let's specify Hello
World action for our
+ process.</para>
<section>
<title>Creating a Hello World Action</title>
-
- <para>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 points in the
process
+
+ <para>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 points in
the process
definition. To do this we have to specify an action handler, represented by
an
implementation of the <emphasis>
<property>ActionHandler</property>
</emphasis> interface, and attach this piece of code to a particular
event. These events
- are amongst others, going over a transition, leaving or entering nodes, after
and
- before signalling. </para>
+ are amongst others, going over a transition, leaving or entering nodes, after
and before
+ signalling. </para>
+ <para> To make things a little bit more concrete, let's create a
new class called <emphasis>
+ <property>HelloActionHandler</property>
+ </emphasis>. For that firstly we'll create a new package
<emphasis>
+ <property>com.jbay.action</property>
+ </emphasis> in the <emphasis>
+ <property>src/java/main</property>
+ </emphasis> folder of our project. Then, we should call New Class
Creation wizard as
+ usual by right-clicking and navigating <emphasis>
+ <property>New > Class</property>
+ </emphasis>. </para>
+
<figure>
- <title>A Simple Hello Action</title>
+ <title>Creating HelloActionHendler Class</title>
<mediaobject>
<imageobject>
@@ -40,14 +52,26 @@
</mediaobject>
</figure>
- <para> To make things a little bit more concrete, we will implement an
<emphasis>
- <property>ActionHandler</property>
- </emphasis>. To do this, create a new class called <emphasis>
+ <para>Notice that two first gaps have been filled automatically. Here,
instead of <emphasis>
+ <property>Package</property>
+ </emphasis> option <emphasis>
+ <property>Enclose type</property>
+ </emphasis> option can be selected where a type in which to enclose a
new class should
+ be specified.</para>
+
+ <para>In our case, we leave everything as it is, just type
<emphasis>
<property>HelloActionHandler</property>
- </emphasis>, which implements the <emphasis>
+ </emphasis> as a name of new class and add <emphasis>
+ <property>org.jbpm.graph.ActionHendler</property>
+ </emphasis> interface as it's shown in the picture
above.</para>
+
+ <para>Thus, our <emphasis>
+ <property>HelloActionHandler</property>
+ </emphasis> implements the <emphasis>
<property>ActionHandler</property>
- </emphasis> interface and implement the execute method as shown in the
next figure. This
- test will add a variable named <emphasis>
+ </emphasis> interface including the <emphasis>
+ <property>execute</property>
+ </emphasis> method as shown in the next figure. Here, we add a variable
named <emphasis>
<property>greeting</property>
</emphasis> to the collection of process variables and puts a message
in it :
<emphasis>"Hello from
ActionHandler"</emphasis>. </para>
@@ -57,44 +81,59 @@
<mediaobject>
<imageobject>
- <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_2.png"
scale="75"/>
+ <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_2.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
+
+ <para>Now, as we have <emphasis>
+ <property>HelloActionHandler</property>
+ </emphasis> class defined, let's explore how we can handle
it.</para>
</section>
<section>
<title>Integrating the Hello World Action</title>
-
- <para>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 correctness of
our actions as well.</para>
+ <para>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 correctness of our
actions as
+ well.</para>
+
<para> As good Testcity citizens we will first create a Unit Test that
proves the behaviour
we want to achieve by adding the <emphasis>
<property>ActionHandler</property>
- </emphasis> to the process. So we implement another test. Creating the
process instance
- is code we already saw in the previous chapter. We assert that no variable
called
- <emphasis>
- <property>greeting</property></emphasis> exist. Then we
give the process a signal to move it to the first state. We want
- to associate the execution of the action with the event of going 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
<emphasis>
+ </emphasis> to the process. So we implement another test.</para>
+
+ <para>At first, let's return to the
+ code we already saw <link linkend="hello_test">in the
previous chapter</link> and add new test method <emphasis>
+ <property>testActionHendler</property></emphasis> to
it. </para>
+
+ <figure>
+ <title>Create the Hello Action Test</title>
+
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_3.png"
+ scale="75"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>We assert
+ that no variable called <emphasis>
<property>greeting</property>
+ </emphasis> exist. Then we give the process a signal to move it to the
auction state. We
+ want to associate the execution of the action with the event of 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. But moreover, the
<emphasis>
+ <property>greeting</property>
</emphasis> variable should exist and contain the string
"Hello from
ActionHandler". That's what we assert in the last lines of
the test
method.</para>
- <figure>
- <title>Create the Hello Action Test</title>
+
- <mediaobject>
- <imageobject>
- <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_3.png"
scale="75"/>
- </imageobject>
- </mediaobject>
- </figure>
-
- <para> Running the tests now results in a failure. As a matter of fact, we
did not associate
+ <para> Running the tests now results in a failure. The point is that we did
not associate
the action with any particular event in the process definition, so the
process variable
did not get set. </para>
@@ -103,7 +142,8 @@
<mediaobject>
<imageobject>
- <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_4.png"
scale="75"/>
+ <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_4.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
@@ -111,7 +151,7 @@
<para> Let's do something about it and add an action to the first
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 action element
container and
- chose New Action as it's shown on the screenshot below. The other 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 available under
the action
icon in the right upper corner of the Properties View.</para>
@@ -147,7 +187,8 @@
<mediaobject>
<imageobject>
- <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_7.png"
scale="75"/>
+ <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_7.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
@@ -178,7 +219,8 @@
<mediaobject>
<imageobject>
- <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_10.png"
scale="75"/>
+ <imagedata
fileref="images/The_JBoss_jBPM_Int_Mech/jboss_jbpm_int_mech_10.png"
+ scale="75"/>
</imageobject>
</mediaobject>
</figure>
@@ -190,7 +232,8 @@
<title> Integration Points</title>
<para> The different integration points in a process definition are
thoroughly documented in
- the <property>JBoss jBPM User Guide</property>. Instance nodes
can contain many action
+ the <ulink
+
url="http://docs.jboss.com/jbpm/v3/userguide/">JBoss jBPM
User Guide</ulink>. 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 navigate to this
view by
selecting the added Action in the outline view. </para>
Modified: trunk/jbpm/docs/reference/en/modules/the_views.xml
===================================================================
--- 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 @@
</imageobject>
</mediaobject>
</figure>
- <para>Then, as its value in the right column we can put the text
<emphasis>This
- transition leads to the end state</emphasis>. </para>
+ <para>Then, we can put the text <emphasis>This
+ transition leads to the end state</emphasis> in the right column as
its value.</para>
<figure>
<title>Comment is added</title>