[JBoss jBPM] - problems with task assignment
by petia
Hi again
I have now installed and I am running the latest release of jbpm-jpdl (i.e. an installation through jbpm-jpdl-3.2.1). I have the following process definition:
| <process-definition
| xmlns="" name="sequence">
| <start-state name="start">
| <task name="start-task">
| <assignment expression="user(manager)"></assignment>
| <controller>
| <variable name="employee" access="read,write,required"></variable>
| </controller>
| </task>
| <transition name="t1" to="task1"></transition>
| </start-state>
| <task-node name="task1">
| <task name="task1">
| <assignment actor-id="manager"></assignment>
| </task>
| <transition name="t2" to="task2"></transition>
| </task-node>
| <task-node name="task2">
| <task name="task2a">
| <assignment expression="previous"></assignment>
| </task>
| <task name="task2b">
| <assignment expression="user(manager)"></assignment>
| </task>
| <transition name="t3" to="end1"></transition>
| </task-node>
| <end-state name="end1"></end-state>
| </process-definition>
|
Every task in this process is assigned to a specific user namely user or manager (who are two of the predefined users coming with the installation). However, when executing the process everyone is able to execute everything, i.e. every user defined in the system can both start and end any task, even tasks which have not been assigned to him. Is this a bug or am I thinking wrongly?
A second question I have is related to the data flow in a process and the forms generation. In the previous version I run (i.e. 3.1.2) task data was defined through the controller construct and during run-time forms were automatically generated in the web-console for displaying and gathering instance specific data. This does not seem to be the case any longer. My impression is that now in order to enter or display any data, one needs to define all the forms necessary for doing it. Is this correct? (It is of course important to be able to define your own forms, but when developing and testing the logic of a process it is nice to also have the automatic generated forms.) In the process definition above I have defined a task controller, where the variable employee is required. When executing the process as manager, I can see the variable in the Variables View in the web interface but I can not give it any value (probably because I have not yet defined any form for it) However (and it feels strange), I can end the task even if this variable is required and I have not entered any value for it. Again, am I thinking wrongly or is this a bug?
Finally, from the manager's interface I was able to define new users, groups and memberships. However, I can not use them. When trying to login as one of the new users I get the error message anonymous wrote : Login failed. Invalid user name or password. The new users do not appear in the login window's table but they seem to have been saved in the database (at least I am able to see them when going back to manager's Identities view). How do I get the user changes through? (I think I saw somewhere instructions on how to delete the login table from the login window, but I can not find back to there.) Also, is it possible to change users' data, such as email address, from this interface or do I need to remove and redefine the user in order to do this?
Grateful for any feedback.
Kind regards, Petia
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060833#4060833
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060833
18Â years, 9Â months
[JBoss jBPM] - get the token in another task-node on a struts application
by galvino
Hi everybody .
I have a problem to go to next task-node with jbpm in a web application by using struts.
i did a small process like this:
anonymous wrote : start
| task1
| task2
| end
On my first bean in strut, i deploy process and i go to the first task.
But when i write this in order to go to the next task:
anonymous wrote :
| TaskMgmtSession taskMgmtSession = jbpmContext.getTaskMgmtSession();
|
| TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(1);
| taskInstance.setActorId(jbpmContext.getActorId());
| taskInstance.start();
|
| Token token = graphSession.loadToken(1);
| Transition transition=null;
| String transitionName=null;
|
| if (token.getNode().getLeavingTransitions().isEmpty() == false) {
| Iterator availableTransitionsIterator = token.getNode().getLeavingTransitions().iterator();
| while (availableTransitionsIterator.hasNext()) {
| transition = (Transition) availableTransitionsIterator.next();
| }
| transitionName=transition.getName();
| }
|
| token.signal(transitionName);
| ProcessInstance processInstance = token.getProcessInstance();
|
| jbpmContext.save(processInstance);
|
there are an error :
anonymous wrote :
| Integrity constraint violation - no parent FK_TASKINST_TASK table: JBPM_TASK in statement [insert into JBPM_TASKINSTANCE (NAME_, DESCRIPTION_, ACTORID_, CREATE_, START_, END_, DUEDATE_, PRIORITY_, ISCANCELLED_, ISSUSPENDED_, ISOPEN_, ISSIGNALLING_, ISBLOCKING_, TASK_, TOKEN_, SWIMLANINSTANCE_, TASKMGMTINSTANCE_, CLASS_, ID_) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'T', null)]
|
what's this error means ?
i think it can't execute *.signal() why ?
Please I need your help !!!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060831#4060831
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060831
18Â years, 9Â months
[EJB 3.0] - Type mapping problem with Decimal on DB2/400
by lauerc
I'm trying to manage a table on an DB2/400 with a EJB3 entity bean but Hibernate failes to correctly map the database data type to a data type in the entity bean.
The column type is defined as follows:
| PREIS DECIMAL(12,5)
|
When I define the getter like
| @Column(name = "PREIS", precision = 13, scale = 5)
| public BigDecimal getPreis() {...
|
I get the following error:
| javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: PREIS, expected: numeric(13,5)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
| ...
|
I've tried to fix the problem by changing the annotation like:
| @Column(name = "PREIS", columnDefinition = "DECIMAL(13,5)")
|
The result of this attempt was:
| javax.persistence.PersistenceException: org.hibernate.HibernateException: Wrong column type: PREIS, expected: DECIMAL(13,5)
| at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
| at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
| ...
|
I've also tried to combie the annotation attributes like this:
| @Column(name = "PREIS", columnDefinition = "DECIMAL(13,5)", precision = 13, scale = 5, nullable = true)
|
but the result stays the same.
Any suggestions deeply appreciated!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060830#4060830
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060830
18Â years, 9Â months
[Installation, Configuration & Deployment] - JBoss AS - shutdown.sh -S fails
by konstandinos
hello
i get the following error when executing shutdown.sh -S
--
Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
--
i have installed jboss (4.0.5ga) on ubuntu linux (dapper drake 6.06 server edition), with jdk1.6 (update2).
also, jboss is installed under it's own user 'jboss' as recommended in the installation guide. all the file access permissions are set correctly. i doubt this has anything to do with it anyway.
note: jboss starts up perfectly when using run.sh. if i start jboss in an active console, and let it load (which works), and then press ctrl+c, it shuts itself down perfectly too. thus it is only shutdown.sh -S that is breaking; but i need this functionality so that shutting down my server gracefully shuts down jboss too.
also please note that i am using 'sudo -u jboss /home/jboss/bin/run.sh' and 'sudo -u jboss /home/jboss/bin/shutdown.sh -S' to startup and shutdown down jboss respectively. these commands are recommended by the jboss documentation for init.d startup (and shutdown) scripts.
below is a full print-out of the error. please help. thanks.
--
| Stopping jboss..
| kosta@Plato:~$ Exception in thread "main" java.lang.SecurityException: Failed to authenticate principal=null, securityDomain=jmx-console
| at org.jboss.jmx.connector.invoker.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:97)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
| at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
| at sun.rmi.transport.Transport$1.run(Transport.java:159)
| at java.security.AccessController.doPrivileged(Native Method)
| at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
| at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
| at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
| at java.lang.Thread.run(Thread.java:619)
| at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
| at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
| at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
| at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
| at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:133)
| at org.jboss.invocation.InvokerInterceptor.invokeInvoker(InvokerInterceptor.java:365)
| at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:197)
| at org.jboss.jmx.connector.invoker.client.InvokerAdaptorClientInterceptor.invoke(InvokerAdaptorClientInterceptor.java:66)
| at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:70)
| at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)
| at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:100)
| at $Proxy0.invoke(Unknown Source)
| at org.jboss.Shutdown$ServerProxyHandler.invoke(Shutdown.java:266)
| at $Proxy1.shutdown(Unknown Source)
| at org.jboss.Shutdown.main(Shutdown.java:237)
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060819#4060819
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060819
18Â years, 9Â months
[JBoss Seam] - Seam 2.0 with Hibernate filters
by Kruno
I am trying to use filter in side seam but when I define filter in components.xml
|
| <persistence:filter name="timeFilter">
| <persistence:name>time</persistence:name>
| <persistence:parameters>
| <key>time</key>
| <value>#{currentDate}</value>
| </persistence:parameters>
| </persistence:filter>
|
|
| <persistence:managed-persistence-context name="manager"
| auto-create="true"
| persistence-unit-jndi-name="java:/EntityManagerFactories/kadrovska">
| <persistence:filters>
| <value>timeFilter</value>
| </persistence:filters>
|
|
| </persistence:managed-persistence-context>
|
|
I get an exception during deploy:
| java.lang.RuntimeException: Could not create Component: manager
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:910)
| at org.jboss.seam.init.Initialization.installComponents(Initialization.java:841)
| at org.jboss.seam.init.Initialization.init(Initialization.java:508)
| at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34)
| at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3854)
| at org.apache.catalina.core.StandardContext.start(StandardContext.java:4359)
| at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
| at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
| at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.apache.catalina.core.StandardContext.init(StandardContext.java:5310)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:297)
| at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
| at org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
| at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
| at org.jboss.web.WebModule.startModule(WebModule.java:83)
| at org.jboss.web.WebModule.startService(WebModule.java:61)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
| at sun.reflect.GeneratedMethodAccessor111.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
| at $Proxy0.start(Unknown Source)
| at org.jboss.system.ServiceController.start(ServiceController.java:417)
| at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy45.start(Unknown Source)
| at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
| at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
| at org.jboss.ws.integration.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:93)
| at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
| at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy46.start(Unknown Source)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
| at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1015)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
| at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
| at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
| at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
| at $Proxy9.deploy(Unknown Source)
| at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
| at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
| at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
| Caused by: java.lang.IllegalArgumentException: No converter for type: org.jboss.seam.persistence.Filter
| at org.jboss.seam.util.Conversions.getConverter(Conversions.java:55)
| at org.jboss.seam.Component$ConstantInitialValue.<init>(Component.java:2152)
| at org.jboss.seam.Component.getInitialValue(Component.java:479)
| at org.jboss.seam.Component.access$200(Component.java:134)
| at org.jboss.seam.Component$ListInitialValue.<init>(Component.java:2254)
| at org.jboss.seam.Component.getInitialValue(Component.java:471)
| at org.jboss.seam.Component.getTopInitialValue(Component.java:459)
| at org.jboss.seam.Component.initInitializers(Component.java:437)
| at org.jboss.seam.Component.<init>(Component.java:257)
| at org.jboss.seam.Component.<init>(Component.java:207)
| at org.jboss.seam.init.Initialization.addComponent(Initialization.java:896)
| ... 93 more
|
I have managed to apply filters trough hibernate annotations, but since I use one filter for bunch of entitys. I would like to define filter in one place and apply
them on any collection. the documentation says that filters can be defined for packages i just can't find how :)
And one more thing could some one please explain is this definition of the filter something achieved in hibernate with this @FilterDef
| <persistence:filter name="currentFilter">
| <persistence:name>current</persistence:name>
| <persistence:parameters>
| <key>date</key>
| <value>#{currentDate}</value>
| </persistence:parameters>
| </persistence:filter>
|
if it is where is the type and why is value applied here not trough manager
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060817#4060817
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060817
18Â years, 9Â months
[JBoss Seam] - Re: problem with conversations
by kosl
Thank u very much for trying to help me, I really apreciate that. Below you will find all the relevant code:
| <page view-id="/register.xhtml" action="#{conversation.begin}"/>
|
I tried also the version recommended in the first answer to my post.
the backing bean interface:
| package user.register;
|
|
|
| public interface Register
| {
|
|
| public String getStep();
| public String go(String dir);
|
| public String submit();
| public String accept();
| public void destroy();
|
| public String getEmail();
| public void setEmail(String email);
| public String getEmailRepeat();
| public void setEmailRepeat(String emailRepeat);
| public String getFirstName();
| public void setFirstName(String firstName);
| public String getLastName();
| public void setLastName(String lastName);
| public String getLogin();
| public void setLogin(String login);
| public String getPassword();
| public void setPassword(String password);
| public String getPasswordRepeat();
| public void setPasswordRepeat(String passwordRepeat);
| public void setStep(String step);
| public String getSex();
| public void setSex(String sex);
|
|
|
| }
|
|
the backing bean code:
| package user.register;
|
| import java.util.List;
|
| import javax.ejb.Remove;
| import javax.ejb.Stateful;
| import javax.faces.application.FacesMessage;
| import javax.persistence.EntityManager;
| import javax.persistence.PersistenceContext;
|
| import org.jboss.seam.ScopeType;
| import org.jboss.seam.annotations.Begin;
| import org.jboss.seam.annotations.Destroy;
| import org.jboss.seam.annotations.In;
| import org.jboss.seam.annotations.Name;
| import org.jboss.seam.annotations.Scope;
| import org.jboss.seam.core.FacesMessages;
|
|
| @Stateful
| @Scope(ScopeType.CONVERSATION)
| @Name("register")
|
| public class RegisterAction implements Register
| {
|
| @PersistenceContext
| private EntityManager em;
|
| @In
| FacesMessages facesMessages;
|
|
| private String login, firstName, lastName, password, passwordRepeat, email, emailRepeat, sex;
|
| String step = "who";
|
|
| public String getStep()
| {
| return step;
| }
|
| public String go(String dir)
| {
| String goTo = null;
| String[] steps = {"who", "confirm", "info"};
| for(String step : steps)
| if(step.equals(dir))
| goTo = dir;
|
| if(goTo == null)
| {
| for( int i = 0; i < steps.length; i++)
| {
| if(step.equals(steps))
| {
| if(dir.equals("prev") && i > 0)
| goTo = steps[i-1];
| else
| if(dir.equals("next") && i < (steps.length-1))
| goTo = steps[i+1];
| break;
| }
| }
| }
|
| setStep(goTo);
|
| return null;
| }
|
| public String accept()
| {
| return null;
| }
|
|
| @Begin(join=true)
| public String submit()
| {
| if(true)
| {
| go("confirm");
| return null;
| }
| return null;
| }
|
| public String getEmail()
| {
| return email;
| }
|
| public void setEmail(String email)
| {
| this.email = email;
| }
|
| public String getEmailRepeat()
| {
| return emailRepeat;
| }
|
| public void setEmailRepeat(String emailRepeat)
| {
| this.emailRepeat = emailRepeat;
| }
|
| public String getFirstName()
| {
| return firstName;
| }
|
| public void setFirstName(String firstName)
| {
| this.firstName = firstName;
| }
|
| public String getLastName() {
| return lastName;
| }
|
| public void setLastName(String lastName)
| {
| this.lastName = lastName;
| }
|
| public String getLogin()
| {
| return login;
| }
|
| public void setLogin(String login)
| {
| this.login = login;
| }
|
| public String getPassword()
| {
| return password;
| }
|
| public void setPassword(String password)
| {
| this.password = password;
| }
|
| public String getPasswordRepeat()
| {
| return passwordRepeat;
| }
|
| public void setPasswordRepeat(String passwordRepeat)
| {
| this.passwordRepeat = passwordRepeat;
| }
|
| public void setStep(String step)
| {
| this.step = step;
| }
| public String getSex()
| {
| return sex;
| }
| public void setSex(String sex)
| {
| this.sex = sex;
| }
|
| @Destroy
| @Remove
| public void destroy()
| {
| }
|
|
| }
|
|
seems to me nothing interesting going on in the bean code, simple getters and setters.
Webpage code:
| <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
| "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
| <ui:composition xmlns="http://www.w3.org/1999/xhtml"
| xmlns:s="http://jboss.com/products/seam/taglib"
| xmlns:ui="http://java.sun.com/jsf/facelets"
| xmlns:f="http://java.sun.com/jsf/core"
| xmlns:h="http://java.sun.com/jsf/html"
| xmlns:sx="http://myfaces.apache.org/sandbox"
| xmlns:x="http://myfaces.apache.org/tomahawk"
| xmlns:ice="http://www.icesoft.com/icefaces/component"
| template="templates/page.xhtml">
|
| <ui:define name="title">
| <ice:outputText value="#{messages.register_title}" />
| </ui:define>
| <ui:define name="body">
| <ice:outputText value="#{messages.register_logoutFirst}" rendered="#{identity.loggedIn}"/>
|
| <ice:panelStack selectedPanel="#{register.step}" rendered="#{!identity.loggedIn}">
| <!--############################################################# WHO #############################################################-->
| <ice:panelGroup id="who">
| <ice:form>
| <ice:panelGrid columns="2" columnClasses="formLabel, formInput">
| <ice:outputText value="#{messages.login}"/>
| <ice:inputText id="login" value="#{register.login}" required="true"/>
|
| <ice:outputText value="#{messages.firstName}"/>
| <ice:inputText id="firstName" value="#{register.firstName}" required="true"/>
|
| <ice:outputText value="#{messages.lastName}"/>
| <ice:inputText id="lastName" value="#{register.lastName}" required="true"/>
|
| <ice:outputText value="#{messages.sex}"/>
| <ice:selectOneMenu id="sex" value="#{register.sex}">
| <f:selectItem itemLabel="#{messages.choose_value}" itemValue="NotChosen"/>
| <f:selectItem itemLabel="#{messages.female}" itemValue="female"/>
| <f:selectItem itemLabel="#{messages.male}" itemValue="male"/>
| </ice:selectOneMenu>
|
| <ice:outputText value="#{messages.password}"/>
| <ice:inputSecret id="password" value="#{register.password}" required="true"/>
|
| <ice:outputText value="#{messages.passwordRepeat}"/>
|
| <ice:inputSecret id="passwordRepeat" value="#{register.passwordRepeat}" required="true">
| <x:validateEqual for="password" message="#{messages.passwordRepeat}"/>
| </ice:inputSecret>
|
| <ice:outputText value="#{messages.email}"/>
| <ice:inputText id="email" value="#{register.email}" required="true">
| <x:validateEmail/>
| </ice:inputText>
|
| <ice:outputText value="ConversationID"/>
| <ice:outputText value="#{conversation.id}"/>
|
|
| <ice:outputText value="#{messages.emailRepeat}"/>
| <ice:inputText id="emailRepeat" value="#{register.emailRepeat}" required="true">
| <x:validateEqual for="email" message="#{messages.register_passwordDoesntMatch}"/>
| </ice:inputText>
|
|
| </ice:panelGrid>
|
| <ice:commandButton value="#{messages.confirm}" action="#{register.submit}"/>
|
| </ice:form>
| </ice:panelGroup>
| <!--############################################################# CONFIRM #############################################################-->
| <ice:panelGroup id="confirm">
| <ice:form>
| <ice:panelGrid columns="2" columnClasses="formLabel, formInput">
| <ice:outputText value="#{messages.login}"/>
| <ice:outputText value="#{register.login}"/>
|
| <ice:outputText value="#{messages.firstName}"/>
| <ice:outputText value="#{register.firstName}"/>
|
| <ice:outputText value="#{messages.lastName}"/>
| <ice:outputText value="#{register.lastName}" />
|
|
| <ice:outputText value="#{messages.sex}"/>
| <ice:outputText value="#{messages[register.sex]}"/>
|
| <ice:outputText value="#{messages.email}"/>
| <ice:outputText value="#{register.email}"/>
|
| <ice:commandButton value="#{messages.correct}" action="#{register.go('prev')}"/>
| <ice:commandButton value="#{messages.accept}" action="#{register.accept}"/>
|
|
| </ice:panelGrid>
| </ice:form>
| </ice:panelGroup>
| </ice:panelStack>
| </ui:define>
| </ui:composition>
|
|
As I mentioned above I enter the webpage directly putting it's url into the browser, I submit the form in one tab, it's not validated (as expected) open the webpage in another tab/window and the field that I've completed before has the same value in the new window/tab what is unexpected for me since, given the entry in pages.xml I would expect a new conversation to start.
I know that in the case of registration this might be not wrong but I feel that I don't understand something and would be happy to know how to achieve the effect of starting new conversations.
Kind REgards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060816#4060816
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060816
18Â years, 9Â months