[JBoss jBPM] - Modeling simple process(tasks)
by dlipski
Hi, I'm using jBPM for few days, i've read whole documentation and i have problem with modeling very simple process.
First short process description:
Supplier creates order after that, order can be accepted or rejected by shop employee. But diffrent employees have different permissions: some can only accept ,some reject, others can do both. After accepting process go's to accepted state, after rejecting go's to rejected state.
As i understand documentation permissions can be applied only to tasks so i have to create to tasks acceptOrder and rejectOrder and assign them to some task node for ex. orderCreated.
This node should have two transitions: goToAccepted and goToRejected. Now it's very easy to get all user tasks (getTaskMgmtSession().findTaskInstances(#userId#)).
But there is one problem how i can know witch transistion I should take after completing one of these tasks ? Of course in this simple process i know witch but it must be handcoded outside of workflow (in the client). How to model such cases ? How to link tasks with transistions witch should be taken after completing them.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958039#3958039
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958039
19 years, 9 months
[Beginners Corner] - Re: Managed Connection Pools
by jaikiran
Have you tried using the max-pool-size setting on your datasource:
<min-pool-size>5</min-pool-size>
| <max-pool-size>100</max-pool-size>
By default, i guess the max-pool-size is 20(not sure though)
Here you will find the details:
http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources
anonymous wrote : I get a new connection object when I call the init method of each of my servlets (there are about 20), that is the only connection object I use for that servlet (I pass it as a parameter to the various factory classes I use within the servlet to do database access).
Is this really required to be done this way. Cant you create a new connection whenever you need it? If you are going by the approach you mention, then the Connection will be held by the servlet during its entire lifetime(i.e. until destroy() is called, where you can call Connection.close()). This would mean that the Connection will *NOT* be released till the servlet is destroyed.
Ideally, you can lookup the datasource object in your init() method and maintain that datasource object through out the lifetime of the servlet. Then whenever an connection is required, use this datasource object and create a new connection.
Something like:
MyServlet.java:
init() {
|
| DataSource ds = null;
| String sourceName = "";
|
| try
| {
| ctx = new InitialContext();
|
| if(ctx == null )
| throw new NamingException("Error 'Db.getConnection' - No Context");
|
| sourceName = this.getDbName(ctx);
|
| ds = (DataSource)ctx.lookup(sourceName);
| }
| catch (NamingException e)
| {
| MtrErr.writeExc(MtrErr.OTHER_SOURCE,this.getClass().toString(),"getConnection",e);
| }
| catch (Exception e)
| {
| MtrErr.writeExc(MtrErr.OTHER_SOURCE,this.getClass().toString(),"getConnection",e);
| }
|
|
| }
|
|
| doGet() {
| Connection conn = null;
| try {
| conn = this.ds.getConnection();
| //use this connection object
|
| } finally {
| //Dont forget to close the connection
| if (conn != null) {
| conn.close();
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3958034#3958034
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3958034
19 years, 9 months