You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jordan Thomas <jo...@ipa.fraunhofer.de> on 2002/12/05 12:08:16 UTC

RE: AW: Workflow Extention

Hi Matthias

OK, I have modified my workflow as I have seen the obvious errors in what I
was trying to do. Now I have the problem that my second action (see code
below) does not allow me to enter that step. The message that I am getting
is "Previous state does not match any allowed previous state!". From what I
can see, the "previousState" of the second step does match the  "newState"
of the first step. One thing that I have noticed is that when I enter the
first state it says "Current State: null". Any ideas?

thanks

Jordan

    <action path="/registration/1"
            type="scoop.web.struts.registration.RegistrationAction"
            className="com.livinglogic.struts.workflow.ApplicationMapping"
            name="registrationForm"
            scope="request"
            input="/tiles/registerCompany"
            validate="true">
        <set-property property="primaryWorkflow"
value="registration-workflow"/>
        <set-property property="newState" value="1"/>
        <set-property property="endWorkflow" value="false"/>
        <forward name="success" path="/tiles/registerCompany"/>
    </action>
    <action path="/registration/2"
            type="scoop.web.struts.registration.RegistrationAction"
            className="com.livinglogic.struts.workflow.ApplicationMapping"
            name="registrationForm"
            scope="session"
            input="/tiles/registerCompany_step1"
            validate="true">
        <set-property property="primaryWorkflow"
value="registration-workflow"/>
        <set-property property="newState" value="2"/>
        <set-property property="prevState" value="1"/>
        <set-property property="endWorkflow" value="false"/>
        <forward name="success" path="/tiles/registerCompany"/>
    </action>

-----Original Message-----
From: Matthias Bauer [mailto:Matthias.Bauer@livinglogic.de]
Sent: Wednesday, 27 November 2002 3:08 PM
To: jot@ipa.fhg.de
Cc: 'Struts Users Mailing List'
Subject: Re: AW: Workflow Extention


Jordan,

I think I understand pretty well, what you are trying to do. However
according to your configuration you should not be able to execute
"/registration/2" before having executed "/registration/1".

Here are some examples:

/registration -> /registration/1 -> /registration/1->/registration/2  -
this should work
/registration -> /registration/1 -> /registration/3  - this should fail
with the last action
/registration -> /registration/1 -> /registration/2->/registration/1  -
this should fail with the last action
/registration -> /registration/1 -> /someAction->/registration/2  - this
should work, if "/someAction" is not part of the workflow

Maybe you can try these examples out and see if it works as expected.

Remark to the last example: The last example works, if "/someAction" is
not part of  the registration-workflow, because it does not change the
state of this workflow.

--- Matthias




Jordan Thomas wrote:

>Yes, I see what you are saying and if I define the next state, then if I
>try to jump out of the workflow I get a an exception saying that it is
>not allowed by the workflow.
>
>What makes me think that it is disregarding the wrokflow is that I can
>enter the workflow at an point (i.e /registration/2) without having
>executed any of the other steps. Essentially, all I want to do is not
>control where the user goes but where the user came from. This way, it
>cascades backwards ensuring that the user enters in all of the data.
>
>Is this clearer? Hopefully you have an idea on how to solve this one.
>
>Cheers and thanks for the help
>
>Jordan
>
>-----Ursprüngliche Nachricht-----
>Von: Matthias Bauer [mailto:Matthias.Bauer@livinglogic.de]
>Gesendet: Wednesday, 27 November 2002 1:22 PM
>An: jot@ipa.fhg.de
>Cc: 'Struts Users Mailing List'
>Betreff: Re: Workflow Extention
>
>
>Jordan,
>
>according to the configuration the user should not be able  to execute
>"/registration/1" before having executed "/registration". Also
>"/registration/2" can not be executed before "/registration/1", and so
>on.
>
>What the configuration does NOT prohibit, is to execute "/registration"
>or any other action after "/registration/1" or "/registration/2",
>because you are not defining nextState values.
>
>Do you see something else? What lets you think that "it seems to be
>disregarding the workflow"?
>
>One remark: You can as well leave away the property endWorkflow if you
>want it to be false, because this is the default.
>
>--- Matthias
>
>
>
>Jordan Thomas wrote:
>
>
>
>>Matthias,
>>
>>Ok, I tried that and it now seems to be disregarding the workflow. Can
>>you seen anything wrong with my struts-config.xml tags? (Sorry for the
>>big code chunk >:O) Essentially what (am trying to do is allow a user
>>to go to the next step or stay on the same step. I am using struts 1.1b
>>
>>Thanks
>>
>>Jordan
>>
>>----------action class------------
>>
>>...
>>public final class NewRegistrationAction extends GenericAction {  ....
>>public ActionForward performAction( ActionMapping mapping, ActionForm
>>form,
>>           HttpServletRequest request, HttpServletResponse response )
>>            throws IOException, ServletException {
>>...
>>
>>----------struts-config.xml------------
>>
>><action path="/registration"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           scope="request"
>>           input="/tiles/registrationDetails"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="0"/>
>>       <set-property property="endWorkflow" value="false"/>
>>       <forward name="success" path="/tiles/registrationDetails"/>
>>   </action>
>>   <action path="/registration/1"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           name="registrationForm"
>>           scope="session"
>>           input="/tiles/registerCompany_step1"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="1"/>
>>       <set-property property="prevState" value="0"/>
>>       <set-property property="prevState" value="1"/>
>>       <set-property property="endWorkflow" value="false"/>
>>       <forward name="success" path="/tiles/registerCompany_step1"/>
>>   </action>
>>   <action path="/registration/2"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           name="registrationForm"
>>           scope="session"
>>           input="/tiles/registerCompany_step2"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="2"/>
>>       <set-property property="prevState" value="1"/>
>>       <set-property property="prevState" value="2"/>
>>       <set-property property="endWorkflow" value="false"/>
>>       <forward name="success" path="/tiles/registerCompany_step2"/>
>>   </action>
>>   <action path="/registration/3"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           name="registrationForm"
>>           scope="session"
>>           input="/tiles/registerCompany_step3"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="3"/>
>>       <set-property property="prevState" value="2"/>
>>       <set-property property="prevState" value="3"/>
>>       <set-property property="endWorkflow" value="false"/>
>>       <forward name="success" path="/tiles/registerCompany_step3"/>
>>   </action>
>>   <action path="/registration/4"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           name="registrationForm"
>>           scope="session"
>>           input="/tiles/registerCompany_step4"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="4"/>
>>       <set-property property="prevState" value="3"/>
>>       <set-property property="prevState" value="4"/>
>>       <set-property property="endWorkflow" value="false"/>
>>       <forward name="success" path="/tiles/registerCompany_step4"/>
>>   </action>
>>   <action path="/registration/5"
>>           type="scoop.web.struts.registration.NewRegistrationAction"
>>
>>className="com.livinglogic.struts.workflow.ApplicationMapping"
>>           name="registrationForm"
>>           scope="session"
>>           input="/tiles/registerCompany_step5"
>>           validate="true">
>>       <set-property property="primaryWorkflow"
>>value="registration-workflow"/>
>>       <set-property property="newState" value="5"/>
>>       <set-property property="prevState" value="4"/>
>>       <set-property property="prevState" value="5"/>
>>       <set-property property="endWorkflow" value="true"/>
>>       <forward name="success" path="/tiles/registerCompany_step5"/>
>>   </action>
>>
>>
>>
>>-----Original Message-----
>>From: Matthias Bauer [mailto:Matthias.Bauer@livinglogic.de]
>>Sent: Tuesday, 26 November 2002 8:36 AM
>>To: Struts Users Mailing List
>>Subject: Re: Workflow Extention
>>
>>
>>Hi Jordan,
>>
>>sorry for the late response...
>>
>>You can not specify a wildcard like * for nextPath - the framework does
>>not support that up to now. I would be happy to integrate it, if you
>>
>>
>can
>
>
>>explain a valid use case for it.
>>
>>Right now I do not see a necessity for a wildcard, because you can
>>always leave away the "nextPath" and the "nextState" parameters, which
>>has basically the same result: The action that follows next can be any
>>action.
>>
>>To refer to you concrete problem: Preventing people from entering your
>>workflow in the middle can be achieved by using the prevState
>>parameters:
>>
>>If you have actions A, B, C and you want the user to execute B only if
>>A
>>
>>has been executed before and C only if B has already been executed you
>>can do the following:
>>
>>- equip action A with the state 1, action B with state 2
>>- set prevState=1 for action B and prevState=2 for action C
>>
>>This way action B can only be executed, if the workflow is in state 1
>>(i. e. action A has been executed) and action C can only be executed,
>>
>>
>if
>
>
>>the workflow is in state 2 (i. e. action B has been executed).
>>
>>Pls. let me know, if this helps.
>>
>>--- Matthias
>>
>>
>>Jordan Thomas wrote:
>>
>>
>>
>>
>>
>>>Hi All,
>>>
>>>I am using the workflow extention to create my workflows. It seems
>>>that
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>>when I am in the middle of a workflow, there is no way to allow the
>>>user to jump out of the workflow into another area of the application.
>>>
>>>
>
>
>
>>>I have tried specifying a * and a *.do as a nextPath parameter but
>>>
>>>
>that
>
>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>>doesn't seem to work. Does anyone know how to gain a little more
>>>flexibility with this framework? All I want to do is stop people from
>>>jumping steps/entering into the middle of a workflow. At the moment,
>>>
>>>
>it
>
>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>>seems that a user needs to enter a workflow and then complete that
>>>workflow before a he/she can leave it. Does anyone have any
>>>
>>>
>suggestions
>
>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>>how I can work around this?
>>>
>>>Thanks
>>>
>>>Jordan
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>>
>>>
>>>
>>>
>><ma...@jakarta.apache.org>
>>
>>
>>
>>
>>>For additional commands, e-mail:
>>><ma...@jakarta.apache.org>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>>
>>
>>
>
>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Change Struts Example to use an actual database

Posted by Mark <ma...@libero.it>.
Umm i was asking similar questions last week to no avail..

The example in the documentation leaves one wondering just which servet it
is thats accessing the dataSource. AH .. I thought perhaps the servlet
object is something to do with the ActionServlet

I still have had no joy accessing the datasource outside the actionservlet,
which make me wonder why everyone bangs on about seperating Actions from
business logic.. 

Now I'm looking at the common's stuff which is being used for 1.1 , I don't
know if this is a knowledge deficit on my part or its a secretive secret
thing that's a secret... Ssshhhhhh.. But joking asside the commons stuff
looks like it might play the game..

The other option would jut be to do the normal jdbc stuff but pull the
values from the stuts config.xml...

----
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.*;



import java.sql.*;
import javax.sql.DataSource;


public class LoginAction extends Action {

/**
*
*
*
*
*/

    public ActionForward perform(
                                ActionMapping mapping,
                                ActionForm form,
                                HttpServletRequest request,
                                HttpServletResponse response)

        throws IOException, ServletException
        {

            LoginForm theForm = (LoginForm) form;

            String username = theForm.getUsername();
            String password = theForm.getPassword();
            String company = theForm.getCompany();
                   
            try {
                DataSource dataSource = servlet.findDataSource(null);
                Connection conn = dataSource.getConnection();
                
              String query = "SELECT "+
                                    "users.name,"+
                                    "FROM users,companies "+
                                    "WHERE users.username = '"+ username +"'
bla bla ";

          
                   
                Statement stmt = conn.createStatement ();
                ResultSet rs = stmt.executeQuery(query);
                HttpSession session = request.getSession();
                if(rs.next())
                {
                            return (mapping.findForward("sucess"));

                }
                else
                {
                            return (mapping.findForward("failure"));
                }

            }
            catch (SQLException e) {
                e.printStackTrace();
            }
                

        }
}



On 5-12-2002 16:59, "Jack R." <ra...@hotmail.com> wrote:

> Hi,
> 
> I am learning how Struts works with an database, so I am trying to change
> Struts Example (struts-example.war) to use an actual database for user data.
> 
> Can you please tell me what I need to do to achieve that? I notice it has
> the following data source configuration in struts-config.xml, do I just need
> to change that to point to my database? How should I create a table in my
> database first? And where in the code is the user data being writtin to the
> database? I can only find code for MemoryDatabase.
> 
> Thanks for any help.
> 
> 
> 
> <!--
> 
> <data-sources>
> 
> <data-source>
> 
> <set-property property="autoCommit"
> 
> value="false"/>
> 
> <set-property property="description"
> 
> value="Example Data Source Configuration"/>
> 
> <set-property property="driverClass"
> 
> value="org.postgresql.Driver"/>
> 
> <set-property property="maxCount"
> 
> value="4"/>
> 
> <set-property property="minCount"
> 
> value="2"/>
> 
> <set-property property="password"
> 
> value="mypassword"/>
> 
> <set-property property="url"
> 
> value="jdbc:postgresql://localhost/mydatabase"/>
> 
> <set-property property="user"
> 
> value="myusername"/>
> 
> </data-source>
> 
> </data-sources>
> 
> -->
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Change Struts Example to use an actual database

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Thu, 5 Dec 2002, Jack R. wrote:

> Date: Thu, 5 Dec 2002 09:59:50 -0600
> From: Jack R. <ra...@hotmail.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Change Struts Example to use an actual database
>
> Hi,
>
> I am learning how Struts works with an database, so I am trying to change
> Struts Example (struts-example.war) to use an actual database for user data.
>
> Can you please tell me what I need to do to achieve that? I notice it has
> the following data source configuration in struts-config.xml, do I just need
> to change that to point to my database? How should I create a table in my
> database first? And where in the code is the user data being writtin to the
> database? I can only find code for MemoryDatabase.
>
> Thanks for any help.
>

The example app itself doesn't have the code for JDBC-based access to this
kind of data, but it would be fairly straightforward to add (if you start
from the 1.1 version of the example app sources):

* In the examples source code, you'll see an interface called
  UserDatabase.  This is an example of the Data Access Object
  (DAO) design pattern, because it deals with the logical business
  data of the app, and hides the details of how it is actually
  accessed.  All the business logic in the example app interacts
  through this interface, so you can switch the implementation
  underneath the covers to store the data anywhere you want.

* You'll need to create an implementation of this interface, as
  well as the User and Subscription interfaces, which reads and
  writes to a database (the existing MemoryUserDatabase implementation
  reads and writes to an XML file).

* When designing the UserDatabase implementation, you'll need to
  figure out how to gain access to the JDBC connection that you
  need.  The simplest method is probably to use the default data
  source for the current webapp, which you can make accessible
  to your UserDatabase implementation (among other ways) by passing
  it to the constructor as a java.sql.DataSource object.

* Alternatively, if you're running on a platform that supports
  JNDI resources (like Tomcat 4.x or later), you might want to
  use that approach instead.  The advantage is that your code
  can get to the data source without having any explicit passing
  of a DataSource or Connection variable.  For more info, see:

  http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

* In the struts-config.xml file for the example app, you'll see
  UserDatabase implementation that should be used.  Modify the
  class name to be a new one for your implementation, and customize
  the <set-property> methods to set whatever configuration properties
  your UserDatabase implementation needs (may not need any for this
  particular scenario).

* Of course, you'll need to set up database username and password,
  and the table structures your DAO implementation expects, in the
  database that is pointed at by the configuration properties.

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Change Struts Example to use an actual database

Posted by "Jack R." <ra...@hotmail.com>.
Hi,

I am learning how Struts works with an database, so I am trying to change
Struts Example (struts-example.war) to use an actual database for user data.

Can you please tell me what I need to do to achieve that? I notice it has
the following data source configuration in struts-config.xml, do I just need
to change that to point to my database? How should I create a table in my
database first? And where in the code is the user data being writtin to the
database? I can only find code for MemoryDatabase.

Thanks for any help.



<!--

<data-sources>

<data-source>

<set-property property="autoCommit"

value="false"/>

<set-property property="description"

value="Example Data Source Configuration"/>

<set-property property="driverClass"

value="org.postgresql.Driver"/>

<set-property property="maxCount"

value="4"/>

<set-property property="minCount"

value="2"/>

<set-property property="password"

value="mypassword"/>

<set-property property="url"

value="jdbc:postgresql://localhost/mydatabase"/>

<set-property property="user"

value="myusername"/>

</data-source>

</data-sources>

-->

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: AW: Workflow Extention

Posted by Jordan Thomas <jo...@ipa.fraunhofer.de>.
Matthias,

In addition here is the console output.

cheers

Jordan


16:59:39,370 INFO  [RequestProcessor] Processing a 'GET' for path '/login'
16:59:39,410 INFO  [Engine] action: Authtype: null
16:59:39,410 INFO  [Engine] action: Defined workflow: registration-workflow
16:59:39,420 INFO  [Engine] action:   Current state: 1
16:59:39,430 INFO  [Engine] action:   Defined next states: []
16:59:39,430 INFO  [Engine] action:   Defined next paths: []
16:59:39,440 INFO  [Engine] action: Previous primary workflow:
registration-workflow
16:59:39,470 INFO  [Engine] action: Current primary workflow: login-workflow
16:59:39,470 INFO  [Engine] action: Forward to: /tiles/login
16:59:44,387 INFO  [Engine] jsp: init
16:59:52,870 INFO  [Engine] jsp: init
16:59:57,136 INFO  [Engine] jsp: init
17:00:03,805 INFO  [RequestProcessor] Processing a 'GET' for path
'/registration'
17:00:03,815 INFO  [Engine] action: Authtype: null
17:00:03,825 INFO  [Engine] action: Defined workflow: registration-workflow
17:00:03,825 INFO  [Engine] action:   Current state: 1
17:00:03,835 INFO  [Engine] action:   Defined next states: []
17:00:03,845 INFO  [Engine] action:   Defined next paths: []
17:00:03,845 INFO  [Engine] action: Defined workflow: login-workflow
17:00:03,855 INFO  [Engine] action:   Current state: null
17:00:03,865 INFO  [Engine] action:   Defined next states: null
17:00:03,865 INFO  [Engine] action:   Defined next paths: null
17:00:03,875 INFO  [Engine] action: Previous primary workflow:
registration-workflow
17:00:03,885 INFO  [Engine] action: Current primary workflow:
registration-workflow
17:00:03,906 INFO  [Engine] action: Updating workflow: registration-workflow
17:00:03,906 INFO  [Engine] action:   Setting currentState to 1
17:00:03,916 INFO  [Engine] action:   Setting definedNextStates to []
17:00:03,926 INFO  [Engine] action:   Setting definedNextPaths to []
17:00:03,936 INFO  [Engine] action: Forward to: /tiles/registration
17:00:06,619 INFO  [RequestProcessor] Processing a 'GET' for path '/login'
17:00:06,629 INFO  [Engine] action: Authtype: null
17:00:06,639 INFO  [Engine] action: Defined workflow: registration-workflow
17:00:06,649 INFO  [Engine] action:   Current state: 1
17:00:06,659 INFO  [Engine] action:   Defined next states: []
17:00:06,659 INFO  [Engine] action:   Defined next paths: []
17:00:06,669 INFO  [Engine] action: Defined workflow: login-workflow
17:00:06,680 INFO  [Engine] action:   Current state: null
17:00:06,680 INFO  [Engine] action:   Defined next states: null
17:00:06,690 INFO  [Engine] action:   Defined next paths: null
17:00:06,700 INFO  [Engine] action: Previous primary workflow:
registration-workflow
17:00:06,700 INFO  [Engine] action: Current primary workflow: login-workflow
17:00:06,710 INFO  [Engine] action: Forward to: /tiles/login
17:00:08,212 INFO  [RequestProcessor] Processing a 'POST' for path
'/login/action'
17:00:08,222 INFO  [Engine] action: Authtype: null
17:00:08,232 INFO  [Engine] action: Defined workflow: registration-workflow
17:00:08,232 INFO  [Engine] action:   Current state: 1
17:00:08,242 INFO  [Engine] action:   Defined next states: []
17:00:08,242 INFO  [Engine] action:   Defined next paths: []
17:00:08,252 INFO  [Engine] action: Defined workflow: login-workflow
17:00:08,262 INFO  [Engine] action:   Current state: null
17:00:08,272 INFO  [Engine] action:   Defined next states: null
17:00:08,272 INFO  [Engine] action:   Defined next paths: null
17:00:08,282 INFO  [Engine] action: Previous primary workflow:
registration-workflow
17:00:08,292 INFO  [Engine] action: Current primary workflow: login-workflow
17:00:08,292 INFO  [Engine] action: Previous state does not match any
allowed previous state!



-----Original Message-----
From: Matthias Bauer [mailto:Matthias.Bauer@livinglogic.de]
Sent: Thursday, 5 December 2002 3:30 PM
To: Jordan Thomas
Cc: Struts User List
Subject: Re: AW: Workflow Extention


Jordan,

the configuration looks ok to me. Can you please send me the complete
log messages. They should look somehow like these (I took them from the
example application):

> 2002-12-05 15:27:52 action: Processing a GET for /beginWf1Transition
> 2002-12-05 15:27:52 action:  Looking for Action instance for class
> com.livinglogic.struts.workflow.test.Wf1Action
> 2002-12-05 15:27:52 action: Authtype:
> com.livinglogic.struts.workflow.test.Authentication
> 2002-12-05 15:27:52 action: Previous primary workflow: null
> 2002-12-05 15:27:52 action: Current primary workflow: wf1
> 2002-12-05 15:27:52 action: Updating workflow: wf1
> 2002-12-05 15:27:52 action:   Setting currentState to 1
> 2002-12-05 15:27:52 action:   Setting definedNextStates to [2]
> 2002-12-05 15:27:52 action:   Setting definedNextPaths to []
> 2002-12-05 15:27:52 action: Forward to: /inHome.jspp
> 2002-12-05 15:28:03 action: Processing a GET for /wf1St2Transition
> 2002-12-05 15:28:03 action:  Looking for Action instance for class
> com.livinglogic.struts.workflow.test.Wf1Action
> 2002-12-05 15:28:03 action: Authtype:
> com.livinglogic.struts.workflow.test.Authentication
> 2002-12-05 15:28:03 action: Defined workflow: wf1
> 2002-12-05 15:28:03 action:   Cleanup action names: [cleanupWf1]
> 2002-12-05 15:28:03 action:   Current state: 1
> 2002-12-05 15:28:03 action:   Defined next states: [2]
> 2002-12-05 15:28:03 action:   Defined next paths: []
> 2002-12-05 15:28:03 action: Previous primary workflow: wf1
> 2002-12-05 15:28:03 action: Current primary workflow: wf1
> 2002-12-05 15:28:03 action: Updating workflow: wf1
> 2002-12-05 15:28:03 action:   Setting currentState to 2
> 2002-12-05 15:28:03 action:   Setting definedNextStates to [3, 2]
> 2002-12-05 15:28:03 action:   Setting definedNextPaths to []
> 2002-12-05 15:28:03 action: Forward to: /inHome.jspp


--- Matthias



Jordan Thomas wrote:

>Hi Matthias
>
>OK, I have modified my workflow as I have seen the obvious errors in what I
>was trying to do. Now I have the problem that my second action (see code
>below) does not allow me to enter that step. The message that I am getting
>is "Previous state does not match any allowed previous state!". From what I
>can see, the "previousState" of the second step does match the  "newState"
>of the first step. One thing that I have noticed is that when I enter the
>first state it says "Current State: null". Any ideas?
>
>thanks
>
>Jordan
>
>    <action path="/registration/1"
>            type="scoop.web.struts.registration.RegistrationAction"
>            className="com.livinglogic.struts.workflow.ApplicationMapping"
>            name="registrationForm"
>            scope="request"
>            input="/tiles/registerCompany"
>            validate="true">
>        <set-property property="primaryWorkflow"
>value="registration-workflow"/>
>        <set-property property="newState" value="1"/>
>        <set-property property="endWorkflow" value="false"/>
>        <forward name="success" path="/tiles/registerCompany"/>
>    </action>
>    <action path="/registration/2"
>            type="scoop.web.struts.registration.RegistrationAction"
>            className="com.livinglogic.struts.workflow.ApplicationMapping"
>            name="registrationForm"
>            scope="session"
>            input="/tiles/registerCompany_step1"
>            validate="true">
>        <set-property property="primaryWorkflow"
>value="registration-workflow"/>
>        <set-property property="newState" value="2"/>
>        <set-property property="prevState" value="1"/>
>        <set-property property="endWorkflow" value="false"/>
>        <forward name="success" path="/tiles/registerCompany"/>
>    </action>
>
>
>



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: AW: Workflow Extention

Posted by Matthias Bauer <Ma...@livinglogic.de>.
Jordan,

the configuration looks ok to me. Can you please send me the complete 
log messages. They should look somehow like these (I took them from the 
example application):

> 2002-12-05 15:27:52 action: Processing a GET for /beginWf1Transition
> 2002-12-05 15:27:52 action:  Looking for Action instance for class 
> com.livinglogic.struts.workflow.test.Wf1Action
> 2002-12-05 15:27:52 action: Authtype: 
> com.livinglogic.struts.workflow.test.Authentication
> 2002-12-05 15:27:52 action: Previous primary workflow: null
> 2002-12-05 15:27:52 action: Current primary workflow: wf1
> 2002-12-05 15:27:52 action: Updating workflow: wf1
> 2002-12-05 15:27:52 action:   Setting currentState to 1
> 2002-12-05 15:27:52 action:   Setting definedNextStates to [2]
> 2002-12-05 15:27:52 action:   Setting definedNextPaths to []
> 2002-12-05 15:27:52 action: Forward to: /inHome.jspp
> 2002-12-05 15:28:03 action: Processing a GET for /wf1St2Transition
> 2002-12-05 15:28:03 action:  Looking for Action instance for class 
> com.livinglogic.struts.workflow.test.Wf1Action
> 2002-12-05 15:28:03 action: Authtype: 
> com.livinglogic.struts.workflow.test.Authentication
> 2002-12-05 15:28:03 action: Defined workflow: wf1
> 2002-12-05 15:28:03 action:   Cleanup action names: [cleanupWf1]
> 2002-12-05 15:28:03 action:   Current state: 1
> 2002-12-05 15:28:03 action:   Defined next states: [2]
> 2002-12-05 15:28:03 action:   Defined next paths: []
> 2002-12-05 15:28:03 action: Previous primary workflow: wf1
> 2002-12-05 15:28:03 action: Current primary workflow: wf1
> 2002-12-05 15:28:03 action: Updating workflow: wf1
> 2002-12-05 15:28:03 action:   Setting currentState to 2
> 2002-12-05 15:28:03 action:   Setting definedNextStates to [3, 2]
> 2002-12-05 15:28:03 action:   Setting definedNextPaths to []
> 2002-12-05 15:28:03 action: Forward to: /inHome.jspp


--- Matthias



Jordan Thomas wrote:

>Hi Matthias
>
>OK, I have modified my workflow as I have seen the obvious errors in what I
>was trying to do. Now I have the problem that my second action (see code
>below) does not allow me to enter that step. The message that I am getting
>is "Previous state does not match any allowed previous state!". From what I
>can see, the "previousState" of the second step does match the  "newState"
>of the first step. One thing that I have noticed is that when I enter the
>first state it says "Current State: null". Any ideas?
>
>thanks
>
>Jordan
>
>    <action path="/registration/1"
>            type="scoop.web.struts.registration.RegistrationAction"
>            className="com.livinglogic.struts.workflow.ApplicationMapping"
>            name="registrationForm"
>            scope="request"
>            input="/tiles/registerCompany"
>            validate="true">
>        <set-property property="primaryWorkflow"
>value="registration-workflow"/>
>        <set-property property="newState" value="1"/>
>        <set-property property="endWorkflow" value="false"/>
>        <forward name="success" path="/tiles/registerCompany"/>
>    </action>
>    <action path="/registration/2"
>            type="scoop.web.struts.registration.RegistrationAction"
>            className="com.livinglogic.struts.workflow.ApplicationMapping"
>            name="registrationForm"
>            scope="session"
>            input="/tiles/registerCompany_step1"
>            validate="true">
>        <set-property property="primaryWorkflow"
>value="registration-workflow"/>
>        <set-property property="newState" value="2"/>
>        <set-property property="prevState" value="1"/>
>        <set-property property="endWorkflow" value="false"/>
>        <forward name="success" path="/tiles/registerCompany"/>
>    </action>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>