Re: [jboss-user] [jBPM] - EventListener questions
by Jas Lam
Jas Lam [http://community.jboss.org/people/lamj1] replied to the discussion
"EventListener questions"
To view the discussion, visit: http://community.jboss.org/message/533587#533587
--------------------------------------------------------------
I am experiencing this same exact problem where I can not get a handle on the task when my event listener is triggered.
So I dig into jBPM code that handles the <notification/> tag. See section for description of this tag
h4. 6.2.6.6. e-mail support in tasks
http://docs.jboss.org/jbpm/v4/userguide/html_single/#task http://docs.jboss.org/jbpm/v4/userguide/html_single/#task
<task assignee="ssoa" form="tasks/downloadData.htm" g="155,11,123,60" name="DownloadData">
<notification/>
</task>
This would trigger the org.jbpm.jpdl.internal.activity.MailListener class to send out an email to the assigned user
To find the current task, the MailListener notify method has the following code:
EnvironmentImpl environment = EnvironmentImpl.getCurrent();
DbSession dbSession = environment.get(DbSession.class);
TaskImpl task = dbSession.findTaskByExecution(execution);
When i stepped through the code in debug mode. the +task+ variable is populated with the newly created task. I also noticed that no entry in the DB has been created for the task yet. Hence using query API won't return any task. It is looking great till this point.
THEN THE PROBLEM IS:
When i tried to insert the above Java code in implementing my listener.
TaskImpl task = dbSession.findTaskByExecution(execution); //RETURN NULL!!!
It always returns NULL.
As I stepped through debug mode. I noticed my listener code is invoked first before the MailListener notify method. I watched the +execution+ variable and they are the same when in MailListener and myListener. The execution variable already has an associating task. Not sure why dbSession.findTaskByExecution() kept returning NULL.
Thanks in advance for any help!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533587#533587]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
[EJB 3.0] - Why Seam-gen does not generate entities - PostgreSql, anyone uses Seam?
by Maynard Witten
Maynard Witten [http://community.jboss.org/people/maynard] created the discussion
"Why Seam-gen does not generate entities - PostgreSql, anyone uses Seam?"
To view the discussion, visit: http://community.jboss.org/message/533584#533584
--------------------------------------------------------------
I am using PostgreSql - connection can be established etc. - but when I am trying to generate entities and related CRUD web pages (I have tried both options - seam-gen commanline and Eclipse plugin) - I am getting working application but without any entities and related pages - as if there are not any tables in my schema. I am making connection to schema where I have 4 tables with different relationships. Where can I find any logs why it is so? There is no reported errors during the process. What should I do?
BTW - I could not have find how to post in Seam forum - it seems to be closed. So - a bit offtopic - anyone uses Seam? I am reading Seam in Action by Manning now and I think that Seam+EJB+JSF should be excellent combination, but I am afraid of low activity around Seam here. Maybe book is excellent and no the... I hope not.
Thanks in advance!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533584#533584]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [Beginner's Corner] - How do I enable pass-by-reference for EJB3 in JBoss AS container?
by Jerry Simone
Jerry Simone [http://community.jboss.org/people/jlsimone] replied to the discussion
"How do I enable pass-by-reference for EJB3 in JBoss AS container?"
To view the discussion, visit: http://community.jboss.org/message/533583#533583
--------------------------------------------------------------
I just now discovered that there might be an alternate solution to my particular problem, that is passing the initialization state to an EJB in the same JVM using pass by reference instead of pass by value. On another discussion thread, I was asking about initializing the state of of a stateful EJB. I was given an example solution/alternative which I have modified. The modified example is shown below.
interface MyLocal {
MyRemote create(String state);
}
interface MyRemote{
void doWork();
class MyBean implement MyRemote, MyLocal {
MyRemote create(String state) {
this.state = state;
return ctx.getBusinessObject(MyRemote.class);
}
void doWork(){
// do something
}
}
This example allows me to use EJBx to create EJBy in the same JVM. I use the local interface, initialize the state of EJBy, passing the state by reference. The create method of EJBy creates the remote interface which is ultimately passed back to the remote client.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533583#533583]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [EJB 3.0] - How to initialize the State of an EJB3 Stateful Bean
by Jerry Simone
Jerry Simone [http://community.jboss.org/people/jlsimone] replied to the discussion
"How to initialize the State of an EJB3 Stateful Bean"
To view the discussion, visit: http://community.jboss.org/message/533579#533579
--------------------------------------------------------------
Wow. I just discovered something. Not only does Carlo's example code initialize the state of the stateful EJB, I modified it to solve another problem that I was having. Here is my modified example below.
interface MyLocal { MyRemote create(String state);}
interface MyRemote{ void doWork(); class MyBean implement MyRemote, MyLocal { MyRemote create(String state) { this.state = state; return ctx.getBusinessObject(MyRemote.class); } void doWork(){ // do something }}
What I've done here is I have given the local interface the responsibility of creating the bean. This allows me to create one EJB from another EJB in the same JVM, passing the state to the second EJB by reference (instead of by value) via the local interface. This probem is described in a question I posted in another discussion thread. The link is http://community.jboss.org/thread/147136.
The link, above, describes a problem where I am using EJBx to create EJBy within the same JVM. After I create EJBy, I pass the remote interface for EJBy to the remote client. My problem was that I was using the remote interface (pass by value) to initailize the state of EJBy. But Carlo's modified example allows me to initialize EJBy using the local interface (pass by reference) and then have the create method return the remote interface that is needed by the remote client.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533579#533579]
Start a new discussion in EJB 3.0 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months
Re: [jboss-user] [jBPM] - New version of process with modification in java class : the change is not taken into account
by Maciej Swiderski
Maciej Swiderski [http://community.jboss.org/people/swiderski.maciej] replied to the discussion
"New version of process with modification in java class : the change is not taken into account"
To view the discussion, visit: http://community.jboss.org/message/533543#533543
--------------------------------------------------------------
> What do you mean exactly by : I do deploy directly to data base without container
I mean that I deploy my resources directly to data base using ant task, pretty the same as test cases do. So application server is not involved at all. I suspect that this is the case for you. That either classes or class loaders are cached somehow...
> What are the java classes used by jbpm? the classes in the database lobs or the classes contained in the jar copied to userlibs?
I would say that these that are stored in data base but as your case illustrates it is not always true. Since either way class loaders are involved it is probably issue with them. If classes are not available for application server (not placed in userlibs) then the only one is to load them from LOB.
Have you tried to stop the server, copy jar to user libs and start server again? Perhaps that would make a difference.
Attached eclipse project with your test case that I tried yesterday.
Cheers,
Maciej
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/533543#533543]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years, 3 months