[JBoss Seam] - multiple pageflows
by wondermike
Hello, I'm using the sample app generated by seam-gen (from http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88326) and I'm trying to implement a second pageflow.
The easiest way to start was to copy pageflow.jpdl.xml to pageflow2.jpdl.xml, copy first-page.xhtml to ctrfirst-page.xhtml (same with second and third). The pageflow started from a different page than home.xhtml.
In the file pageflow2.jpdl.xml I renamed everything appropriate (so did I in ctr*.xhtml):
<?xml version="1.0"?>
|
| <pageflow-definition name="shellflow2">
|
| <start-page name="start2" view-id="/contractlist.xhtml">
| <redirect/>
| <transition name="first-page2" to="first-page2"/>
| </start-page>
|
| <page name="first-page2" view-id="/ctrfirst-page.xhtml">
| <redirect/>
| <transition to="first-page2"/>
| <transition name="continue-flow2" to="continue-flow-decision2"/>
| </page>
|
| <decision name="continue-flow-decision2" expression="#{flowBean2.continueFlow}">
| <transition name="true" to="second-page2"/>
| <transition name="false" to="start2"/>
| </decision>
|
| <page name="second-page2" view-id="/ctrsecond-page.xhtml">
| <redirect/>
| <transition to="second-page2"/>
| <transition name="third-page2" to="third-page2"/>
| </page>
|
| <page name="third-page2" view-id="/ctrthird-page.xhtml">
| <redirect/>
| <end-conversation />
| </page>
|
| </pageflow-definition>
In components.xml I included the new file:
| ...
| <component class="org.jboss.seam.core.Jbpm">
| <property name="processDefinitions">processdefinition.jpdl.xml</property>
| <property name="pageflowDefinitions">pageflow.jpdl.xml</property>
| <property name="pageflowDefinitions">pageflow2.jpdl.xml</property>
| </component>
| ...
|
Moreover I copied FlowBean.java, SimpleFlow.java and SimpleFlowAction.java to FlowBean2.java and so on. Of course SimpleFlowAction2.java looks like this:
| ...
| @Name("pageflow2")
| ...
| @Begin(pageflow="shellflow2")
| public void begin() {
| System.out.println("pageflow2: SHELLFLOW METHOD HIT!!!");
| }
|
| public String gotoFirstPage() {
| System.out.println("pageflow2: 1st page");
| return "first-page2";
| }
|
| public String gotoSecondPage() {
| System.out.println("pageflow2: 2nd page");
| return "second-page2";
| }
| ...
|
Now the secod pageflow works perfectly, but the first pageflow is broken:
| 04:42:17,281 INFO [STDOUT] SHELLFLOW METHOD HIT!!!
| 04:42:17,281 ERROR [STDERR] javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.tx.Ejb3TxPolicy.handleInCallerTx(Ejb3TxPolicy.java:93)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:130)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:201)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
| 04:42:17,281 ERROR [STDERR] at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:188)
| 04:42:17,281 ERROR [STDERR] at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
| 04:42:17,281 ERROR [STDERR] at $Proxy182.begin(Unknown Source)
| 04:42:17,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| 04:42:17,281 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| 04:42:17,281 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| 04:42:17,281 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:32)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.callComponentMethod(Component.java:1334)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.callCreateMethod(Component.java:1322)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.newInstance(Component.java:1312)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1263)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.Component.getInstance(Component.java:1246)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.jsf.SeamVariableResolver.resolveVariable(SeamVariableResolver.java:44)
| 04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:134)
| 04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
| 04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstValue.getTarget(AstValue.java:62)
| 04:42:17,281 ERROR [STDERR] at com.sun.el.parser.AstValue.invoke(AstValue.java:147)
| 04:42:17,281 ERROR [STDERR] at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
| 04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
| 04:42:17,281 ERROR [STDERR] at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
| 04:42:17,281 ERROR [STDERR] at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
| 04:42:17,281 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:106)
| 04:42:17,281 ERROR [STDERR] at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
| 04:42:17,281 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
| 04:42:17,281 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
| 04:42:17,281 ERROR [STDERR] at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
| 04:42:17,281 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.servlet.SeamRedirectFilter.doFilter(SeamRedirectFilter.java:30)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 04:42:17,281 ERROR [STDERR] at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| 04:42:17,281 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 04:42:17,281 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 04:42:17,281 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| 04:42:17,281 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 04:42:17,281 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 04:42:17,281 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 04:42:17,281 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
| 04:42:17,281 ERROR [STDERR] Caused by: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
| ...
| 04:42:17,343 ERROR [SeamExceptionFilter] uncaught exception handled by Seam
| javax.servlet.ServletException: Error calling action method of component with id _id6:_id10
| ...
| 04:42:17,343 INFO [SeamExceptionFilter] killing transaction
| 04:42:17,343 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
| javax.faces.FacesException: Error calling action method of component with id _id6:_id10
| at
| ...
| Caused by: javax.ejb.EJBTransactionRolledbackException: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
| ...
| Caused by: java.lang.IllegalArgumentException: pageflow definition not found: shellflow
|
(I shortened the stacktrace a little bit)
Did I screw up something? How can I get the first workflow get back to work again?
I suspect the components.xml, but I'm not sure. This must be the right place to define further pageflows which are defined in separate files, isn't it?
TIA for any suggestions.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965160#3965160
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965160
19 years, 10 months
[JBoss jBPM] - Re: how to retrieve task instance/process instances in a spe
by yxyang
"Olivier_Debels" wrote : I think it is much cleaner to just add your own queries.
|
| It's rather easy if you just do it the same way as it is done in jbpm. Just create your own extra queries file and make sure it is loaded in your hibernateSessionFactory (by adding it in your hibernate.cfg.xml).
|
| By doing this you can extend the jbpm stuff with your own queries without the need to change anything to the internal queries or mappings.
|
Yes. It is partially true. It is only needed to change the hibernate.cfg.xml to include something like:
| <!-- hql queries and type defs -->
| <mapping resource="org/jbpm/db/hibernate.queries.hbm.xml" />
|
anonymous wrote :
| Then you can write some classes which shield you from the hibernate usage. You could f.e. add a new service or provide your own implementation for an existing one (by putting it in your own jbpm.cfg.xml).
|
I just don't understand how to add my own jbpm.cfg.xml file. If i do this, what will happen to the existing configuration items in the original jbpm.cfg.xml file? After going through the source code, i found that all the Sessions like GraphSession, TaskMgntSession etc are obtained from JbpmContext which use the DBPersistenceService. And DBPersistenceService hardcode these sessions there.
What i can do is to create my own class like XXXSessioin and initialize it manually because it cannot be availalbe from JbpmContext.
Is this right?
comments?
Yang
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965158#3965158
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965158
19 years, 10 months
[JBoss jBPM] - Re: taken end and task instance end
by yxyang
"cpob" wrote : if you want to end the task, you should do a taskInstance.end.
|
| Or, you could add end-tasks="true" to your task node xml:
| <task-node name="task4" end-tasks="true">
|
| That will then end all open tasks when the node is left.
(1)what do you mean "task end"? I went through the source code and find out that the hibernate queries for findTaskInstance....() related methods only retrieve the "open" tasks.
(2)What is the purpose of this "open" flag in jbpm design?
(3)Under what situation, will the completion of a task instances trigger a signal on the token? In other words, who will response for the triggering of the token when a task instance is completed?
anonymous wrote :
| Token.end will END the token and all of its children
|
(4)I know token.signal() move the token to next node. But what is the function of "token.end()"? If a token and all of its children are ended, what does it mean?
yang
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3965153#3965153
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3965153
19 years, 10 months