[JBoss jBPM] - Re: how to find ProcessInstance current state or node
by Johan.Parent
Hi,
You can get the root token for your process. From there you can find out in which node(s) it resides.
A bit like below (this collects all the active nodes) but then again you'll need to do some instanceof work to see what type of node you actually got.
| ...
| ProcessInstance p = ctx.loadProcessInstance(id);
|
| // Second build a Set with all the active nodes in the process instance
| Token t = p.getRootToken();
| Map <String, Token> children = t.getChildren();
|
| // Put in the set
| Set<Map.Entry<String,Token>> cSet = children.entrySet();
| for (Iterator<Map.Entry<String,Token>> it = cSet.iterator(); it.hasNext();) {
| Map.Entry<String,Token> e = it.next();
| Token tok = e.getValue();
| //
| nodes.add(tok.getNode());
| }
|
|
| // Also add the node for this token (if any) to the set
| Node here = t.getNode();
| if (here != null)
| nodes.add(here);
|
|
|
And oh yeah, since the hibernate proxies will get in the way of your instanceof logic you'll need to do something like below first (believe me ;)
| // We need to this to access the real object otherwise
| // we bump into the proxy object and instanceof won't work
| if (nodeinstanceof HibernateProxy) {
| node= ((HibernateProxy)node).getHibernateLazyInitializer().getImplementation();
| }
|
Hope this helps,
Johan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115507#4115507
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115507
18 years, 3 months
[JBoss Seam] - Re: How to control end of conversations/state of stateful be
by gus888
For "How to control end of conversations":
I have the same problem. I think that it is critical issue for the core (conversation) of Seam. The Seam forum here suggested that you use "propagation=none" to all other buttons and links which users can reach and propagate away from the current conversation. I think, maybe I am wrong, that this way is not practicable in a production project. One reason is that maybe there are a couple of dozens links and buttons on screen, the second is that maybe there are other conversation begin buttons and links on screen.
My previous suggestion is that as long as system run a @Begin, system should put current foreground conversation to background (let system timeout clean) and start a new foreground conversation (if the conversation id is automatically created by system). Currently, in the Seam, this functionality only works on the SAME foreground conversation bean, for example, I start a conversation A from Conversation Bean A by clicking @Begin from A, then if I go back to click @Begin from the same Conversation Bean A, Seam will create a new conversation, BUT instead, if I go back to click @Begin from Conversation B, the whole system will throw exception (need @Begin (join=true)) and the system will be down. This is critical problem in a production project. Please correct me if I am wrong. I like to create a JIRA if Seam team think it is necessary. Thank you and have a good holiday.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115504#4115504
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115504
18 years, 3 months
[JBossWS] - DateTime Format errors
by mmiddleton
I am currently working with a customer with a webservice. I wrote the webservice using jbossws in java and the client the are writing is in vb.
Here is our problem:
They want to be notified if they send a date that is invalid. As it is right now by the time their request gets to my code if they send in an invalid DateTime that value is "null" in the java object that I receive, this is the same thing I get if they don't send in a date (it's not a required field), because of this there is no way for me to tell if they simply did not send in a date or if they sent in an invalid date. I was wondering if there was a way for the user to be notified if they send in an invalid date or is that something that we will have to catch in the client before the xml request is sent to the webservice, or is there away for the exception (assuming one occurs if an invalid date is sent in) to be passed along to my code for me to handle it. Thanks in advance for your replies.
Matthew
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115503#4115503
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115503
18 years, 3 months
[EJB 3.0] - Re: ClassCastExeption while invoking a Bean
by aindigo
i got the same exception, any tips?
none of the tips posted here works....
i have the same descriptors.. same scenario..
the 1st code was auto generated by netbeans 6
| java.lang.ClassCastException
| com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
| javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
| cl.imagicair.ldap.DatosLdap.lookupLdapInfo2Bean(DatosLdap.java:99)
| cl.imagicair.ldap.DatosLdap.processRequest(DatosLdap.java:35)
| cl.imagicair.ldap.DatosLdap.doGet(DatosLdap.java:68)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
| causa ra�z
|
| java.lang.ClassCastException: $Proxy141 cannot be cast to org.omg.CORBA.Object
| com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:212)
| javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
| cl.imagicair.ldap.DatosLdap.lookupLdapInfo2Bean(DatosLdap.java:99)
| cl.imagicair.ldap.DatosLdap.processRequest(DatosLdap.java:35)
| cl.imagicair.ldap.DatosLdap.doGet(DatosLdap.java:68)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
| javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115500#4115500
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115500
18 years, 3 months
[JBoss Seam] - How to control end of conversations/state of stateful beans
by trouby
Hey,
I find myself using @Begin(join=true) almost anywhere I want to start a conversation,
The main reason is that I cannot be sure that I'm out of a conversation,
If a user clicked on some button that started a conversation, how can I control the end of the conversation?
I have somehow to force the user to press a button that ends the conversation as they never do that :-) (I can think of ways somehow make to disable all other buttons) or wait for the timeout but this is not a solution,
What is the suggestion? or just use @Begin(join=true) anywhere?
Second question is regarding stateful beans,
If I understand correctly, stateful ejbs are bounded to CONVERSATION context by default, if that is correct, I have the following scenario:
1)A stateful bean with a method annotated with @Begin
2)some forms inputs bounded to the statefulbean properties
3)a method in the same stateful bean annotated with @End
What could be the reason that the bounded data posted from the forms is not there within the method that is annotated with @End?
Many thanks,
Asaf.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4115497#4115497
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4115497
18 years, 3 months