[jBPM Users] - Process Variables
by TejJBPM
Hi
I created a new instance of a process and set some variables to it using
// Create a new process instance with the new variables
| Map<String,Object> variables = new HashMap<String,Object>();
| variables.put("employee", "mike");
| variables.put("requestType", "m");
| variables.put("requestDetails","details");
|
| ProcessInstance processInstance = executionService.startProcessInstanceByKey("m",variables);
Now how i do access these variables. I dont see any method at the processinstance level to get all the variables based on process instance id.
Also, Can I add more process variables when the process is moving between task to task. basically I want the process to remember some of the variables until it is completed..I dont know whether i framed the question correctly enough!!
Thanks in advance
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267297#4267297
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267297
16 years, 4 months
[jBPM Users] - Re: JBPM 4.2 - Manage JBPM users - recommended way? How to u
by dejanmr
Thanks for the hint kukeltje,
But, I could not make it work. I have EAR application, on jboss 5.1,a and JBPM service installed with provided ant. I have deployed my custom process, and custom jbpm.cfg.xml, and I can see on database they are stored in (what I believe are) proper blobs. When I start process, it all seem to be fine. But, it seems like my custom class is being ignored (taskService.findGroupTasks returns empty set, although it shouldn't), and debugging this I see my custom class is never been called, or even created.
1) When I put dummy class name, I got error on process deployment, so it looks like my change is being processed in some way.
2) When I try to change jbpm.cfg.xml within \jbpm\jbpm-service.sar\ I got error, obviously because this deployment can not see my custom class, which is in another ear.
3) When I move jbpm-service.sar to my ear, and include it in application.xml, I got cast exception with JuelScriptEngine and javax class. There was jira issue regarding this, but in another context and it is resolved.
What am I doing wrong? What would be correct way of doing this.
Note: My custom class is dependent on lots of stuff, and can not be easy moved to lib or another folder where jbpm-service.sar can see it.
Thanks.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267296#4267296
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267296
16 years, 4 months
[jBPM Users] - Re: JBPM4 Process Image
by sebastian.s
Hello TejJBPM,
1.) if you want to show a process image in the jBPM-console you have to deploy the image as well because it is not generated by the jBPM runtime.
2.) the jBPM-console shows the current state of the process. The console uses the deployed image and puts an arrow (DHTML etc.) on the process image at the appropiate position. The co-ordinates for this are determined via the API and the information originates from the process definition file (g="").
So if you want to show the status in your own application you have to do some image manipulation or do it in a similar way as the console does. It is not that hard. Search for thread in which I was asking certain questions about this.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267288#4267288
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267288
16 years, 4 months
[jBPM Users] - Re: How to use timers?
by mauromol
Thank you Martin, you actually helped me and I got it to work!!
I'm going to summarize it up because I think that certain things are not so intuitive for a "jBPM scheduler"-newbie like me.
First of all, the default implementation of the scheduler service, provided by jBPM, is DbSchedulerServiceFactory, which uses the database to store information about scheduled actions associated with timers. This means that a database is needed even to write a simple JUnit test case that uses timers and this justifies the need to deploy your process definition (it's needed to store the related timers and timer jobs in the database, as well). I would assume that a different scheduler service implementation could be made to avoid the use of a database, however let's talk about the default implementation.
Even if a database is needed, there's no need to extend AbstractDbTestCase, which provides many methods to create and clean the schema and to interact with the database. In fact, in the simplest case, jBPM (thanks to Hibernate) will create automatically an in-memory database for you when you go to deploy your process definition and/or schedule a timer action. In this case, however, you should take care of the db lifecycle, however I think (but I may be wrong) that if you destory the jbpmConfiguration (by calling close) the in-memory db will be destroyed too...
Anyway, in my case I was running an only test method, so it's not so important how the db is handled between multiple test methods invocations.
In my previous example (TRIAL 2) timer actions were correctly saved in the database by the DbSchedulerServiceFactory, but they were not executed because no JobExecutor thread was started. The JobExecutor thread is actually a thread that periodically reads from the database, searching for saved timer actions (jobs) and executes them.
So, if I change my test case by calling jbpmConfiguration.startJobExecutor() just after the configuration creation, I make sure that the "scheduler" is started. Actually, I would rather say that there is no scheduler to start, but that the default scheduler service implementation expects that a JobExecutor thread is present to execute timer actions. In other words, the JobExecutor is itself part of the default scheduler service implementation. I think that this only sentence would be enough to say that my original problem is not so stupid as kukeltje says and that the documentation could be drastically improved on this subject (I'm also wondering what is http://docs.jboss.com/jbpm/v3.2/userguide/html_single/#schedulerdeployment all about!?).
Anyway, this is not enough, because another action is needed in order to make the JobExecutor run timer actions in my test case: just after the signal invocation, that moves my process instance to the waiting state (with attached timer), I have to close the jBPM context in order to commit things (the deployed process definition, the process instance state and the related saved timers and jobs), otherwise the JobExecutor, which works on another thread, wouldn't find anything to executoe. Having the whole scenario cleared, this sounds reasonable and obvious, but I think it might not be so straight away for a first time user that is writing a simple JUnit test case. Using the AbstractDbTestCase class mentioned by Martin, this would be automatically achieved because the method processJobs(long) does a "commit" before starting the JobExecutor.
Thank you again Martin and please correct me if I've written something wrong.
Anyway, if this is considered to be a simple answer to a basic question (as kukeltje said)... well, I'm wondering why kukeltje couldn't write it himself: he would have certainly spent much less time that writing his two previous smart posts, as Martin's kind answer demonstrated.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4267259#4267259
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4267259
16 years, 4 months