[jboss-user] [jBPM] - Re: Persistence and Transaction Management

2013-07-18 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Persistence and Transaction Management"

To view the discussion, visit: https://community.jboss.org/message/828773#828773

--
Pure local transactions and local transactions *with spring* are unfortunately 
very different things. Both are true. 

5.4.x supports local transactions +using a spring transaction manager+, but 
does not support "pure" local transactions with a normal transaction manager.
--

Reply to this message by going to Community
[https://community.jboss.org/message/828773#828773]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-10 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/807374#807374

--
Hi Sandra, 

With regards to an object in the classpath of your war, I mean the following: 

1. Include the class in the war. 
2. Add a jar with the class to the library of your server.1. For JBoss AS 7 
(standalone), that would be in the standalone/lib directory.
2. For JBoss AS 5/EAP 5 (default profile), that would be in the 
server/default/lib directory. 


Also, I'm (slowly) making an example for you here:  
https://github.com/mrietveld/jbpm-more-examples 
https://github.com/mrietveld/jbpm-more-examples. 

If you have an example of a BPMN2 file that you could pass to me (with which 
you would like to use dynamic assignment/process variables), that would be 
great!
--

Reply to this message by going to Community
[https://community.jboss.org/message/807374#807374]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-05 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806737#806737

--
I am lucky enough to spend most of my time working on jBPM -- and it is indeed 
awesome!

One approach to your problem is to switch from "pass-by-value" to 
"pass-by-reference" for your variable assignment. In other words, instead of 
passing the primitive values (String, int, etc.), you can pass an object 
containing these values as a parameter. If you want to retrieve the values 
later, you simply make sure that your code keeps a reference to the object so 
that you can retrieve and modify the (possibly changed) values. 

This means the following: 
1. Making sure that the object used is in the classpath -- you need to put in 
the classpath of the application server or your war. 
2. Correctly referencing and extracting the information from your object -- 
whether that's in your WorkItemHandler implementation or a scriptTask.

Because of persistence, the object also needs to be serialized. Hmm.. I'll make 
a example of this today/tomorrow and post a link for you here.
--

Reply to this message by going to Community
[https://community.jboss.org/message/806737#806737]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-05 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806655#806655

--
Argh -- Sandra, how do you make the java code look pretty (with colors, etc.. 
)? It didn't work for me. :/
--

Reply to this message by going to Community
[https://community.jboss.org/message/806655#806655]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-05 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806653#806653

--
Interesting.. well, if you can keep a secret ;D, the metadata that Shobhit was 
asking about is +actually available+. The jBPM parser parses and stores that 
information and it's available at (process instance) runtime. Actually, I'm 
pretty sure it's even available directly from the knowledge base. Of course, 
the minute we start trying hat metadata, the BPM engine is no longer a black 
box... I'll make a quick code example and post it on this thread in the next 
couple days. 


But back to your process variable question: unfortunately, the only way to set 
process variables in a process is at the very beginning, with the following 
method: 

{code}ksession.startProcess(String processId, Map 
parameters){code}

The String key in the parameters Map should match the name of the.. (searching 
brain for bpmn2 knowledge... ) property element in the process element. The 
property's itemSubjectDef should reference a itemDefintiion element defined 
with the correct data type ("java.lang.String", for example) above/outside the 
process element in your BPMN2. 

At the moment, definining or adding a process variable (that you want to access 
outside of the engine) is only possible at process instance creation -- with 
the method described above. At least, as far as I know..  I'll check with some 
of the other dev's to make sure.
--

Reply to this message by going to Community
[https://community.jboss.org/message/806653#806653]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-05 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806645#806645

--
Having written what I've written above (about +not fooling around with tx's and 
the engine+), if you are really, really, really, really, really, really sure 
that you want to go down that road, you can do the following: 

Start and  end the JTA transaction yourself. 

It's that simple: the core persistence mechanism in Drools/jBPM checks to see 
if there's an active transaction first before starting one -- and it also keeps 
track of whether or not it started a transaction. That way, it will  not commit 
the transaction if it has also not started the transaction. 

However, as Elmer Fudd used to say, +be vewy, vewy+ careful when you're doing 
this. Open the tx, do your thing with the engine and close the tx immediately: 
+remember that the process instance state is saved *only* when the transaction 
commits*.*+ If you do 2 or more actions that modify the process instance, 
you'll +probably+ be okay. If you modify the processs instance state +and+ 
"reach into the engine" to do weird things, good luck! 

Some of the other core committers to the jBPM project would disagree with me 
about this: they might say "Ahh, Marco's being a wimp -- there are no problems 
with tx's. Go ahead and have a transaction party!". They will be right 99% of 
the time -- but if you get into complicated (high load/performance) situations 
with jBPM and user-controlled tx's, I'd wouldn't bet on it.
--

Reply to this message by going to Community
[https://community.jboss.org/message/806645#806645]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-05 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806641#806641

--
There are one or two things you can do to keep the tx from closing -- but you 
don't want to go down that road. I've been there, and it just gets complexer 
and ends up in code that's harder to maintain. 

(If you are really, really, really sure that you still want to do it after 
reading this, let me know and I can explain it.)

The main reason you don't want to fool around with tx's when working with jBPM 
is that jBPM is designed to have full control over transactions -- or in other 
words, when some of the drools/jbpm developers initially designed the 
persistence mechanism, they designed it only thinking about the use case where 
drools/jbpm had control over the tx's: later, some changes were made to make it 
possible for the users to do that, but the design of the core persistence 
mechanism (the SingleSessionCommandService) doesn't really play nice with that. 
With Drools/jBPM 6, we've expanded some of the possibilities, and hopefully 
we'll add even more in the coming year, but, in my very humble opinion, I don't 
think we're at a point yet where we can encourage users to take tx control away 
from the engine. 

In short, once you take control of the tx with jBPM, you're getting into 
"hacking" territory and you'll be more and more on your own, so to speak. 

So, having said that, I'm getting back to my original question: why do you want 
the node instance information? One of the anti-patterns that's emerged with BPM 
is "reaching into the engine": you're always better of treating the engine as a 
black box because it makes it easier to migrate to new versions of the engine 
(or other engines) in the long run. It's the same principle as webservices -- 
or even just information encapsulation.
--

Reply to this message by going to Community
[https://community.jboss.org/message/806641#806641]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: getProcess in ProcessInstanceImpl throws a NullPointerException

2013-04-04 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: getProcess in ProcessInstanceImpl throws a NullPointerException"

To view the discussion, visit: https://community.jboss.org/message/806565#806565

--
h4. What's probably happening is that the code you're calling is happening 
outside of a transaction. 

You've posted the code above, so you can see that the NPE is probably happening 
because the ProcessInstanceImpl.kruntime field is null. 

The kruntime field in the ProcessInstanceImpl is set to null as soon as the 
transaction is closed. This has to do with making sure that jBPM doesn't cache 
old copies of processinstances. 

So, in this case, when you call 
wpi.getNodeInstances()
the transaction has already ended (it ended within the 
ksession.getProcessInstance() method). 

May I ask why you want a list of NodeInstances? There may be other ways to get 
the information that you're looking for. Also, at the moment that you're 
looking for the node instances, there shouldn't be any or otherwise you're 
betting on a race condition. 


--

Reply to this message by going to Community
[https://community.jboss.org/message/806565#806565]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

[jboss-user] [jBPM] - Re: Installing jbpm 5.3 with guvnor 5.4 issue under jboss 5.1

2012-11-07 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Installing jbpm 5.3 with guvnor 5.4 issue under jboss 5.1"

To view the discussion, visit: https://community.jboss.org/message/775312#775312

--
Just to clarify for others reading this post in the future: 

The problem described in this post is between Guvnor 5.4 and JBoss AS 5. (jBPM 
happens to be involved but is not related to this problem). 

The answer might be described here: 

 https://community.jboss.org/docs/DOC-18273 
https://community.jboss.org/wiki/DeployDrools-Guvnor540CR1ToJboss-eap-512
--

Reply to this message by going to Community
[https://community.jboss.org/message/775312#775312]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Migrating from jbpm 3 to jbpm 5 - how to handle task instances

2012-10-26 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Migrating from jbpm 3 to jbpm 5 - how to handle task instances"

To view the discussion, visit: https://community.jboss.org/message/772543#772543

--
By the way, it appears that the jbpm migration integration with designer is 
minimal -- it looks like you're better off using the jbpmmigration project 
outside of designer, and then importing the bpmn2 results into Designer. 

Obviously, bugs are always appreciated, if you should run into them (for the 
migration project):  https://issues.jboss.org/browse/JBPM 
https://issues.jboss.org/browse/JBPM ("migration" component).
--

Reply to this message by going to Community
[https://community.jboss.org/message/772543#772543]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Migrating from jbpm 3 to jbpm 5 - how to handle task instances

2012-10-26 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Migrating from jbpm 3 to jbpm 5 - how to handle task instances"

To view the discussion, visit: https://community.jboss.org/message/772537#772537

--
I haven't worked with any projects that have gone through this 
transition/migration, but I know both the jBPM 3 and 5 code (or at least, they 
end up fighting for space in my brain.. :/ ). 

If I were planning an upgrade, I would do the following: 

1. Do a "prepratory" migrade of your jBPM 3 process definitions to "BPMN2 
friendly" process definitions. That means essentially that for all of those 
extended ActionHandler (or DecisionHandler, AssignmentHandler, etc. ) classes 
in your process definitions and PAR's, you should migrate as much of the 
(java-code) logic in any of those  handlers to the JPDL. That's really the 
biggest difference between JPDL/jBPM 3 and BPMN2/JBPM 5: the first is much more 
developer oriented, where BPMN2/JBPM 5 forces users to be write more 
transparent business processes. This step will mean that you will be able to 
migrate more of your jBPM 3 processes to BPMN2 (jBPM 5). 

2. Once you've gotten this done, I would look at Eric Schabell's jbpmmigration 
project: this is available in the jBPM (5) Designer. What's designer? Designer 
is the web-based BPMN2 editor, which you can access via Guvnor. Yes, we're 
working on making Designer standalone as quickly as possible, but it's not 
there yet. But, in short, this is what you do: 

a. Download a jBoss AS (preferably AS 7, since it's SOO much faster.)
b. Download a Guvnor AS7 compatible war (like 5.4.0.Final, jboss-as-7.0.war:  
https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.drools~guvnor-distribution-wars~5.4.0.Final
 
https://repository.jboss.org/nexus/index.html#nexus-search;gav~org.drools~guvnor-distribution-wars~5.4.0.Final~~
 (click on the jboss-as-7.0.war link). 
c. Download a Designer AS7 compatible war (like 2.4.0.Beta1, jboss7.war:  
https://repository.jboss.org/nexus/index.html#nexus-search;quick~jbpm-designer 
https://repository.jboss.org/nexus/index.html#nexus-search;quick~jbpm-designer 
(click on jboss7.war link.. )
d. Add wars to standalone/deployment (and touch .dodeploy)
e. Start server up
f. Open guvnor: and create a new BPMN process
g. Use jbpmmigration capability in Designer

You can also use the jbpmmigration capability outside of designer, I'll have to 
ping Eric about that. 

3. Once you've converted your process(es), I would indeed run both in parallel, 
in two different ways: 
a. Obviously, you have to let the jBPM 3 processes finish, and start using the 
JBPM 5 processes. There's no other way to do that except have both 
simultaneously running in production. 
b. I'm assuming you have  (D)TAP environments? (Devel, Test, Accept, 
Production). In that case, depending on the size of your system(s) and how 
critical the systems are, it might be worth it to setup some sort of parallel 
processing, where production handles the jBPM 3 processes and accept _also_ 
handles the same process instance (request), but with jBPM 5. Depending on the 
number of (Human) tasks involved, this would of course require some sort of 
infrastructure so that both jBPM 3 tasks and jBPM 5 (human) tasks are 
completed/handled by the same user interaction. (Hopefully, that makes sense? 
If not, please ask). 

Re the jbpm migration project: 
 http://www.schabell.org/2011/10/jbpm-migration-tooling-available-in.html 
http://www.schabell.org/2011/10/jbpm-migration-tooling-available-in.html
 http://www.schabell.org/2011/10/jbpm-web-designer-integrates-jbpm.html 
http://www.schabell.org/2011/10/jbpm-web-designer-integrates-jbpm.html
 http://www.schabell.org/2012/01/released-jbpm-migration-tooling-v010.html 
http://www.schabell.org/2012/01/released-jbpm-migration-tooling-v010.html
--

Reply to this message by going to Community
[https://community.jboss.org/message/772537#772537]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jbpm5.3 on jboss-as-7.1.1.Final shows ERROR [org.drools.persistence.SingleSessionCommandService] (http--127.0.0.1-8080-6) Could not commit session: java.lang.RuntimeException

2012-07-11 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jbpm5.3 on jboss-as-7.1.1.Final shows ERROR 
[org.drools.persistence.SingleSessionCommandService] (http--127.0.0.1-8080-6) 
Could not commit session: java.lang.RuntimeException: Could not find session 
data for id 1"

To view the discussion, visit: https://community.jboss.org/message/747378#747378

--
Hi Nurlan, 

Let's see if the form will let me post today.  :)  

It looks like this is being caused by the following problem: 

> Caused by: java.lang.IllegalArgumentException: Could not connect task client 
> Mina(127.0.0.1:9123)
>   at 
> org.jbpm.integration.console.TaskClientFactory.newAsyncInstance(TaskClientFactory.java:109)
>   https://community.jboss.org/message/747077#747077 
> jbpm-gwt-core-5.3.0.Final.jar:5.3.0.Final
>   at 
> org.jbpm.integration.console.StatefulKnowledgeSessionUtil.registerWorkItemHandler(StatefulKnowledgeSessionUtil.java:329)
>   https://community.jboss.org/message/747077#747077 
> jbpm-gwt-core-5.3.0.Final.jar:5.3.0.Final
>   at 
> org.jbpm.integration.console.StatefulKnowledgeSessionUtil.initializeStatefulKnowledgeSession(StatefulKnowledgeSessionUtil.java:158)
>   https://community.jboss.org/message/747077#747077 
> jbpm-gwt-core-5.3.0.Final.jar:5.3.0.Final
And unfortunately, I've been running into this problem more and more frequently 
recently, and I haven't figured out exactly what's causing it yet -- mostly 
because I haven't had time to look at it. :/ 

Ahh.. looking in the code, it turns out that there's a property in your 
*jbpm.console.properties* file called: 
> jbpm.console.task.service.strategy
Try settting this to "Local". 

(Apparently, the jbpm.console.properties file is in the 
standalone/configuration file in your jboss AS 7 directory. )
--

Reply to this message by going to Community
[https://community.jboss.org/message/747378#747378]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: AS 7.1.2, JBPM 5.3 persistence : Getting Large Objects may not be used in auto-commit mode exception

2012-07-10 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: AS 7.1.2, JBPM 5.3 persistence : Getting Large Objects may not be used in 
auto-commit mode exception"

To view the discussion, visit: https://community.jboss.org/message/747144#747144

--
Vimal, yes, jBPM removes the data from the ProcessInstanceInfo table once the 
process instance has completed. 

if you're looking for historical information about processes, you're better off 
relying on logging (BAM).
--

Reply to this message by going to Community
[https://community.jboss.org/message/747144#747144]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JBPM + Oracle integration

2012-06-29 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM + Oracle integration"

To view the discussion, visit: https://community.jboss.org/message/745178#745178

--
Kavin, 

I've seen this error before: 

  
java:global/jbpm-gwt-console-server/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations
  
java:app/jbpm-gwt-console-server/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations
  
java:module/EjbSynchronizations!org.jboss.seam.transaction.LocalEjbSynchronizations
  java:global/jbpm-gwt-console-server/EjbSynchronizations
  java:app/jbpm-gwt-console-server/EjbSynchronizations
  java:module/EjbSynchronizations

It has to do with incompatibilities -- but can be gotten rid of by uncommenting 
some lines in your standalone.xml. 

I believe the line even references "ejbsynchronizations", although 
unfortunately I can't remember exactly what it was.
--

Reply to this message by going to Community
[https://community.jboss.org/message/745178#745178]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Problem with jBPM5.3 and (needed) activated jpa in standalone.xml

2012-06-18 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Problem with jBPM5.3 and (needed) activated jpa in standalone.xml"

To view the discussion, visit: https://community.jboss.org/message/742426#742426

--
Hi, 

See  
https://github.com/droolsjbpm/jbpm/blob/5.3.0.Final/jbpm-persistence-jpa/src/main/resources/META-INF/persistence-JPA2.xml
 
https://github.com/droolsjbpm/jbpm/blob/5.3.0.Final/jbpm-persistence-jpa/src/main/resources/META-INF/persistence-JPA2.xml
That's a persistence.xml configured to use JPA 2 and Hibernate 4 (which is what 
AS 7 uses by default, I believe). 

JPA is the specification for how Java should interact with "persistence", which 
basically means interacting with a database. 

JPA 1 is a couple years old, and with JBoss AS 7, the default way to do things 
has moved to JPA 2. Within the context of an application on an application 
server, you can just think of it as a type of dependency.
--

Reply to this message by going to Community
[https://community.jboss.org/message/742426#742426]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JTA with britonix and spring

2012-05-30 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JTA with britonix and spring"

To view the discussion, visit: https://community.jboss.org/message/738865#738865

--
It has been fixed in 5.3.
--

Reply to this message by going to Community
[https://community.jboss.org/message/738865#738865]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JBPM 5.1 data model

2012-04-25 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM 5.1 data model"

To view the discussion, visit: https://community.jboss.org/message/732231#732231

--
See the following pages: 

 
https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/jbpm/lastSuccessfulBuild/artifact/jbpm-distribution/target/jbpm-5.3.0-SNAPSHOT-docs-build/jbpm-docs/html/ch.core-persistence.html
 
https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/jbpm/lastSuccessfulBuild/artifact/jbpm-distribution/target/jbpm-5.3.0-SNAPSHOT-docs-build/jbpm-docs/html/ch.core-persistence.html
 
https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/jbpm/lastSuccessfulBuild/artifact/jbpm-distribution/target/jbpm-5.3.0-SNAPSHOT-docs-build/jbpm-docs/html/ch.human-tasks.html
 
https://hudson.jboss.org/hudson/view/Drools%20jBPM/job/jbpm/lastSuccessfulBuild/artifact/jbpm-distribution/target/jbpm-5.3.0-SNAPSHOT-docs-build/jbpm-docs/html/ch.human-tasks.html

Once 5.3 has been released, you will be able to find this documentation at the 
normal places ( http://www.jboss.org/jbpm/documentation 
http://www.jboss.org/jbpm/documentation). 

Marco
--

Reply to this message by going to Community
[https://community.jboss.org/message/732231#732231]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JBPM 5.1 data model

2012-02-02 Thread Marco Rietveld
Marco Rietveld [https://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM 5.1 data model"

To view the discussion, visit: https://community.jboss.org/message/713964#713964

--
Melih, 

Thanks very much! I've updated and documented the data model (using your model 
above as a basis), and added it to the documentation.
--

Reply to this message by going to Community
[https://community.jboss.org/message/713964#713964]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: No JTA TransactionManager found using Jpbm5 in a Jee container

2012-01-10 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: No JTA TransactionManager found using Jpbm5 in a Jee container"

To view the discussion, visit: http://community.jboss.org/message/645801#645801

--
You do need the "line below" specifying the transaction manager. 

Unfortunately, I haven't worked with weblogic, but found the following pages 
(WebLogic 10.3 api): 

 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/class-use/TransactionManager.html
 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/class-use/TransactionManager.html
 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/class-use/ClientTransactionManager.html
 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/class-use/ClientTransactionManager.html

However, this page ( 
http://www.ajaxlines.com/ajax/stuff/article/making_the_most_of_java_enum_example.php
 
http://www.ajaxlines.com/ajax/stuff/article/making_the_most_of_java_enum_example.php)
seems to imply that you can use the UserTransaction as the TransactionManager.. 
but I'd be a little surprised at that. It's worthy trying though. 

Lastly, looking at the spring code seems to imply that using the 
TransactionHelper is the right way to go: 
(Spring code:  
http://kickjava.com/src/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java.htm
 
http://kickjava.com/src/org/springframework/transaction/jta/WebLogicJtaTransactionManager.java.htm)

 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/ClientTxHelper.html#getTransactionManager%28%29
 
http://docs.oracle.com/cd/E12839_01/apirefs./e13941/weblogic/transaction/ClientTxHelper.html#getTransactionManager%28%29
--

Reply to this message by going to Community
[http://community.jboss.org/message/645801#645801]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Question about using Timer node

2011-12-19 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Question about using Timer node"

To view the discussion, visit: http://community.jboss.org/message/642176#642176

--
Yu, 

There are two things I can think of that might be happening: 
- the timer can not/will not fire if there is no (knowlege) session present and 
linked to the process instance. 
- in some cases, if the node before the timer node (or after) is not correct 
and fails, that exception is sometimes not shown and the process can silently 
die. 

Would you mind posting of the bpmn of the three nodes: the one before the 
timer, the timer node and the one after the timer? 

Thanks,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/642176#642176]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Question about using Timer node

2011-12-14 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Question about using Timer node"

To view the discussion, visit: http://community.jboss.org/message/641478#641478

--
Yu, 

Which version of jBPM are you using? 

Also, if you're using jBPM 5, what are you doing with the knowledgesession when 
the timer is waiting? 

Thanks,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/641478#641478]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jbpm4.4 failed to send email

2011-11-04 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jbpm4.4 failed to send email"

To view the discussion, visit: http://community.jboss.org/message/635150#635150

--
The jBPM 4 code doesn't know how to authorize you: 

   Caused by: com.sun.mail.smtp.SMTPSendFailedException: 553 You are not 
authorized to send mail, authentication is required

I'm pretty sure this is a bug in the jBPM 4.4 code -- I fixed the same issue in 
the jBPM 3 and jBPM 5 codebase: 

See JBPM-3386 for jBPM 3 and JBPM-3032 for jBPM 5. 

Unfortunately, I don't do anything with the jBPM 4 code.. My apologies!
--

Reply to this message by going to Community
[http://community.jboss.org/message/635150#635150]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: How to detect crashed process instance in jbpm 4.1 ?

2011-10-13 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: How to detect crashed process instance in jbpm 4.1 ?"

To view the discussion, visit: http://community.jboss.org/message/631561#631561

--
Elisabeth, 

Ah, indeed, I guess I missed that. 

I guess the other things I might suggest in this case are the following: 

- try to make all code in the actual jbpm 4 node/transition classes idempotent, 
and have any real operations be external to that code -- by placing the actual 
operations/actions in external webservices. 
- In general, you want to limit code to nodes and +not+ put it in transitions. 
Among a number of other reasons, these kind of situations are one reason why 
it's not a good idea. 

If you're able to do the above, then you can use the jBPM api to detect which 
processes are not running/active and restart them or otherwise discard the 
original process and restart a new process with the same initial information as 
the original process. 

Good luck!
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/631561#631561]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: How to detect crashed process instance in jbpm 4.1 ?

2011-10-12 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: How to detect crashed process instance in jbpm 4.1 ?"

To view the discussion, visit: http://community.jboss.org/message/631463#631463

--
What I've seen done with jbpm 3 (which jBPM 4 resembles), is that a webservice 
was built over the jBPM engine api. You can use the jBPM engine api to figure 
out what the status is of different process instances (your suggestsion touch 
on some of them). 

If you need help with the engine API, let me know. I'm pretty sure I know which 
methods you could use. 


Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/631463#631463]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: How to persist a timer

2011-10-06 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: How to persist a timer"

To view the discussion, visit: http://community.jboss.org/message/630381#630381

--
Mare, 

Thanks -- that's a good tip. 

Stefan, 

Thanks for submitting the Jira (and the test case) -- I've been looking at the 
problem this week and trying to find a solution for it. I've put most of the 
info on Jira. 

Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/630381#630381]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM Process Persistence Issue

2011-09-30 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM Process Persistence Issue"

To view the discussion, visit: http://community.jboss.org/message/629599#629599

--
Which database are you using? (or are you just using the defaul h2 
configuration?)
--

Reply to this message by going to Community
[http://community.jboss.org/message/629599#629599]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JBPM4 Migrating from Oracle to Postgres, Transaction Error on JBPM4_LOB

2011-09-30 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM4 Migrating from Oracle to Postgres,  Transaction Error on JBPM4_LOB"

To view the discussion, visit: http://community.jboss.org/message/629596#629596

--
I have bad news, Jeff..  :( 
(Well, sort of.. there may be hope, see the end of the message). 

The problem you're running into with jbpm 4 is that a database operation is 
being attempted with an object that, indeed, has a @LOB field -- which 
Postgresql handles with it's super cool (yay.. :/ ) "Large Object" facility[1]. 

See  http://jdbc.postgresql.org/documentation/84/binary-data.html 
http://jdbc.postgresql.org/documentation/84/binary-data.html

The important sentence on that page is the following: 
You must access Large Objects within an SQL transaction block. You can start a 
transaction block by calling setAutoCommit(false). 

And somewhere deep in the jbpm 4 code, that's exactly what's +not+ happening: 
jbpm 4 is creating, modifying or accessing an entity with a LOB field "outside" 
of a transaction. The code doesn't even have to modify the object/entity 
containing a LOB: even +retrieving+ an entity with a LOB field  will cause this 
problem.

The reason I happen to know about this is because I've been looking at this 
issue in jbpm *+5+* (with PostgreSQL, which is the only DB that has this)[2]. 
In jBPM 5, we're close to fixing the code so that it works. It's actually not 
that hard, I just have to be careful I don't break anything else while fixing 
it.  ;)   :/

Short of modifying the code in jBPM 4 yourself (it +is+ open source!), I don't 
think there's a solution for this. 

Wait, I take that back -- one of the possible solutions I looked into was 
modifying the mapping of the objects in question so that the LOB was stored as 
a byte array and not using the "Large Object" facility[1]. To tell the truth, 
though, I unfortunately just deleted the (git) stash and branch containing that 
stuff this week, after having not looked at it for a month. In short, I'm only 
about 85% sure that what I'm suggesting is possible -- and can't remember all 
the details of the solution.  

[Oh yeah, now I remember -- the byte [] field in PostgreSQL is limited (wrt to 
size), and while the limit is pretty high, because of.. how jBPM 5 is put 
together, it wasn't the better solution. I don't think that jBPM 4 will have as 
large @Lob/byte [] fields, but I would check the maximum size of the byte [] 
fields in your Oracle jbpm 4 database. If the max size of the @Lob/byte [] 
field in the Oracle db is larger than the max allowable size of the byte [] 
field in PostgreSQL, then at least you have a good reason that upper management 
will understand when you tell them why you can't migrate the system.  :)  ]

I'm not at all unfamilar with jbpm 4, but the trick is the following: 
* You need to have access (be able to modify) the persistence.xml in order to 
do this. * If necessary, you can replace the persistence.xml in the appropriate 
jbpm 4 jar. 

* You can +override+ the mappings that are present in the classes: * You will 
have to go through all the jbpm 4 code and find which entities these are. 
* Then you will have write entity-mapping xml files for these entities. * Make 
sure to include the xml-mapping-metadata-complete element in order to disable 
the anno's (including @Lob) in the java files. 
* This make take some trial an error: I use eclipse's debugging capabilities 
with a good unit test for this type of thing. 
* There are probably some other descriptions of how to do this, but see Pro JPA 
2, pp. 373-375 for the overriding anno's and pp. 385-398 for some basic 
entity-mapping xml info. * The order of elements is (bizarrely) important: make 
sure to verify your mapping (and the order of your xml elements) agains 
orm_1_0.xsd (or whichever schema you're using.)



* The mapping files you write for each entity must be referred to in your 
persistence.xml and if necessary, inserted in the appropriate jbpm 4 jar (see 
first bullet). 


Good luck, 
Marco

[1] The Large Object facility stores an id in the actual field of the entity, 
which then refers to a row/record in an +another+ table where the actual byte 
data is stored -- hence the need for transactions since multiple tables are 
involved. 

[2] Yes, the "Large Object" facility is unique -- unique like the way we made 
jokes about "special" people in middle school. ;D That said, there are actually 
worse databases out there with regards to (XA) transactions -- worse 
+commercial+ databases, that make me Sy.. , I mean sigh. /:)
--

Reply to this message by going to Community
[http://community.jboss.org

[jboss-user] [jBPM] - Re: jBPM 5.1 with SQL Server

2011-09-30 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM 5.1 with SQL Server"

To view the discussion, visit: http://community.jboss.org/message/629585#629585

--
Dominique, 

You're almost there!

See  
https://github.com/droolsjbpm/drools/blob/master/drools-persistence-jpa/src/test/java/org/drools/persistence/util/PersistenceUtil.java
 here for the all of the code from the following segment, but the following 
should work for SQL server: 

PoolingDataSource pds = new PoolingDataSource();

// The name must match what's in the persistence.xml!
pds.setUniqueName("jdbc/testDS1");

// 
pds.setClassName("com.microsoft.sqlserver.jdbc.SQLServerXADataSource");

// doesn't really matter
pds.setMaxPoolSize(3);

pds.getDriverProperties().put("user", "thisIsMyUsername");
pds.getDriverProperties().put("password", "thisIsMyPassword");

for (String propertyName : new String[] { "serverName", "portNumber", 
"databaseName" })

pds.getDriverProperties().put("serverName", "The.Server.Name.as.in.DNS.Name");
pds.getDriverProperties().put("portNumber", "portNumber);
pds.getDriverProperties().put("databaseName", "NameOfTheDatabase");

pds.getDriverProperties().put("URL", "jdbcUrl");
pds.getDriverProperties().put("selectMethod", "cursor");
pds.getDriverProperties().put("InstanceName", 
"ThisIsTheInstanceNameOfYourDatabase-sortOfLikeTheDatabaseName");

pds.init();

EntityManagerFactory emf = 
Persistence.createEntityManagerFactory("persistenceUnitName");

Also, the jta-data-source element should +not+ be commented out in your 
persistence.xml, obviously.
--

Reply to this message by going to Community
[http://community.jboss.org/message/629585#629585]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - jBPM 5 (and Drools) database testing

2011-09-29 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 (and Drools) database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
This article describes how to configure the jBPM project so that unit tests 
connect to a database or your choice instead of using the default H2 
(in-memory) database.


| * Overview of modifications (#overview)
* Explanation (#explanations)* The pom.xml  and maven settings (#pomAndSettings)
* Filtering and the datasource.properties and persistence.xml files (#filtering)
* Using PersistenceUtil in unit tests (#persistenceUtil)

* Summary (#summary)
* Appendix (#appendix) |


h3. Overview of modifications

The jbpm project root pom.xml  contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 
h5.  
http://community.jboss.org/servlet/JiveServlet/showImage/102-17071-9-16768/Untitl33ed.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/102-17071-9-16768/450-284/Untitl33ed.jpg
 
h5. A. The pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and persistence.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/persistence.xml

In the PersistenceUtil class, we read in the datasource.properties file. The 
test-compile and process-test-resources goals ensure that the filtered version 
of this file -- where all maven variables have been replaced with their 
assigned values -- is placed in the same class path as the rest of the test

[jboss-user] [jBPM] - Re: JBPM v5 & MySQL Persistence Problem

2011-08-29 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM v5 & MySQL Persistence Problem"

To view the discussion, visit: http://community.jboss.org/message/623003#623003

--
David, 

This is a half-guess, but have you tried adding the hibernate.connection 
properties you have in your "org.jbpm.task" persistence-unit to the first 
persistence-unit ("org.jbpm.persistence.jpa"). 

You're using hbm2ddl.auto = create in both units, so Hibernate should create 
the tables. This means that it's problem with the connection with the database. 

Another +possible+ idea is using the JDBC3 driver for mysql -- but again, 
that's also just a guess.
--

Reply to this message by going to Community
[http://community.jboss.org/message/623003#623003]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JBPM v5 & MySQL Persistence Problem

2011-08-25 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JBPM v5 & MySQL Persistence Problem"

To view the discussion, visit: http://community.jboss.org/message/623099#623099

--
David, 

As far as I know, you can't start a transaction +before+ initializing the data 
source: would it be possible to first initialize the data source and then start 
the transaction? (ut.begin() after ds1.init()).
--

Reply to this message by going to Community
[http://community.jboss.org/message/623099#623099]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - jBPM

2011-08-25 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] commented on 
the document

"jBPM"

To view all comments on this document, visit: 
http://community.jboss.org/docs/DOC-11184#comment-7317

--
Shiva, 

I don't think Oryx handles jPDL: Oryx was built specifically to be a BPMN 2.0 
editor. 

More importantly: would you mind posting your questions on the forum -- and 
+not+ posting them as a comment to this web page? It's a little confusing to 
the rest of us!

If you post your question to the forum, the likelihood that you will get a good 
and correct answer will go up!

You can find the forum here:  
http://community.jboss.org/en/jbpm?view=discussions 
http://community.jboss.org/en/jbpm?view=discussions

Thanks very much for this,
Marco
--

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JTA with britonix and spring

2011-08-23 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JTA with britonix and spring"

To view the discussion, visit: http://community.jboss.org/message/622502#622502

--
Sasi, 

Is drools-spring in your classpath? 

org.drools
drools-spring
5.2.1.Final

(The version may differ depending on which version of jBPM 5 you're using: see 
the pom.xml of your jbpm 5 jar and use the drools.version property value that's 
in that pom). 

Regards,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/622502#622502]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: No Task with ID 205 was found!

2011-08-22 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: No Task with ID 205 was found!"

To view the discussion, visit: http://community.jboss.org/message/622172#622172

--
Hi Xiaojun, 

One thing that I noticed is that you're using JTA for the first datasource -- 
but not for the second. I would try having both use JTA and seeing if that 
fixes the problem you're seeing -- especially if the datasource 
(java:comp/env/jdbc/testDS1) is referring to the same database 
(jdbc:mysql://192.168.89.199:3306/jbpm_db). 

Regards,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/622172#622172]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM-console - Oracle - start process

2011-08-22 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM-console - Oracle - start process"

To view the discussion, visit: http://community.jboss.org/message/622167#622167

--
Hi guys, 

Interesting.. 

*  
http://coderesource.org/messages-5-193123-java-sockets_and_objectinputstreams 
http://coderesource.org/messages-5-193123-java-sockets_and_objectinputstreams

The link above seems to suggest that the problem is 
unsynchronized/thread-*un*safe access to data within the mina server. 

I guess I would start by debugging the whole stack and seeing if I could pin 
down exactly which object/data is producing the exception. 

Regards,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/622167#622167]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM on GlassFish - HTTP status 500

2011-08-22 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM on GlassFish - HTTP status 500"

To view the discussion, visit: http://community.jboss.org/message/622163#622163

--
Mi+guel,+

(Sorry for misspelling your name!) 

It shouldn't be that much more different than installing it on jBoss. I don't 
have much experience with Glassfish but I took a quick look at how it works 
last week and given that it's also a java EE 5/6 compliant application server, 
I don't expect there to be that many problems installing jBPM on it. 

What I'm planning to do is to essentially look at what the jbpm-installer 
installs on the jBoss server and duplicate that on Glassfish and see if that 
works. (I would like to know how install jBPM on glassfish for myself!)

You can find the ant build file at the link below. The ant file has targets 
that execute all of the installer actions and thus install jBPM -- and some 
other helpful things -- on a Jboss server:
-  https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/build.xml 
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-installer/build.xml

I probably won't get around to doing this for another week or two. If you do 
run into any problems, please do post them on the forums!

Thanks,
Marco



+
+
--

Reply to this message by going to Community
[http://community.jboss.org/message/622163#622163]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM on GlassFish - HTTP status 500

2011-08-17 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM on GlassFish - HTTP status 500"

To view the discussion, visit: http://community.jboss.org/message/621587#621587

--
Michael, 

Which version of jBPM -- 3 , 4 or 5? 

Thanks,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/621587#621587]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM5 - Why do we have hibernate.cfg.xml within jbpm-bam

2011-08-16 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM5 - Why do we have hibernate.cfg.xml within jbpm-bam"

To view the discussion, visit: http://community.jboss.org/message/621209#621209

--
Narayan, 

I think that the persistence.xml files were included in the jbpm-bam module 
because it wasy the ... quickest and easiest (and most obvious) solution. 

That's +not+ to say that it was the best solution!! 

I've been looking at this as well and wondering about what a better way would 
be to set this up: if you could, I would be really interested in hearing what 
would have been a better solution!

Thanks very much,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/621209#621209]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: NPE caused by Bitronix transaction glitch or drools transaction issue?

2011-08-16 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: NPE caused by Bitronix transaction glitch or drools transaction issue?"

To view the discussion, visit: http://community.jboss.org/message/621201#621201

--
This might be a really stupid idea, but I'm wondering if this isn't an issue 
with the H2 database -- considering that's it's an in-memory database and not 
fully 2 phase compliant (I think?). 

If you wouldn't mind posting your code, I would actually like to look at this 
as well! I'm very interested in how transactions/persistence works in jBPM 5. 

Thanks!
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/621201#621201]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: JTA with britonix and spring

2011-08-16 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: JTA with britonix and spring"

To view the discussion, visit: http://community.jboss.org/message/621198#621198

--
Hi Sasi, 

This is happening because Spring +and+ Tomcat are fighting over who gets to use 
Bitronix. 

See  http://old.nabble.com/BTM,-Spring-and-Tomcat-td20917679.html 
http://old.nabble.com/BTM,-Spring-and-Tomcat-td20917679.html for more info. 

Good luck!
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/621198#621198]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Will jbpm 5 be integrated in jboss esb?

2011-08-16 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Will jbpm 5 be integrated in jboss esb?"

To view the discussion, visit: http://community.jboss.org/message/621196#621196

--
I'm fairly sure -- on the basis of what I've heard -- that jBPM 5 will be 
integrated with Switchyard, which is basically the new jBoss ESB. 

See  http://www.jboss.org/switchyard http://www.jboss.org/switchyard for more 
info!

(In fact, they've already started (and done lots) on jBPM integration:  
https://github.com/jboss-switchyard/components/tree/master/bpm 
https://github.com/jboss-switchyard/components/tree/master/bpm )

As for the "old" or "current" version of jBoss ESB, I think it's a better idea 
to look at Switchyard if you don't already have jBoss ESB setup. 

Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/621196#621196]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: jBPM on GlassFish - HTTP status 500

2011-08-12 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: jBPM on GlassFish - HTTP status 500"

To view the discussion, visit: http://community.jboss.org/message/620780#620780

--
For others who end up reading this thread, a workaround has been found for this 
problem: see the modified gravel jar attached to  
https://issues.jboss.org/browse/JBPM-3302 
https://issues.jboss.org/browse/JBPM-3302.
--

Reply to this message by going to Community
[http://community.jboss.org/message/620780#620780]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Deploying jBPM 5.1 on jBoss 6

2011-07-28 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Deploying jBPM 5.1 on jBoss 6"

To view the discussion, visit: http://community.jboss.org/message/618064#618064

--
Hi Chaitanya, 

The log above seems to imply that drools-guvnor.war is missing a dependency. 

I'm actually curious about your modifications to the persistence.xml, hibernate 
xml config and datasource files: would you mind posting those? 

As for the bug, was there anything else in the log? If possible, try to up the 
detail in your server log. 

Thanks,
Marco
--

Reply to this message by going to Community
[http://community.jboss.org/message/618064#618064]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Persistence and Transaction Management

2011-07-25 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Persistence and Transaction Management"

To view the discussion, visit: http://community.jboss.org/message/617412#617412

--
Marco P (and others), 

To some degree the following javadoc explains why it's necessary to have JTA in 
drools/jBPM: 

 
http://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/persistence/jpa/JPAKnowledgeService.html
 
http://docs.jboss.org/jbpm/v5.1/javadocs/org/drools/persistence/jpa/JPAKnowledgeService.html
--

Reply to this message by going to Community
[http://community.jboss.org/message/617412#617412]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - Re: Persistence and Transaction Management

2011-07-22 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] created the 
discussion

"Re: Persistence and Transaction Management"

To view the discussion, visit: http://community.jboss.org/message/617007#617007

--
Hi Marco, 

Thanks very much for posting all of this! 

Could you maybe clarify +why+ you want to use  application-managed persistence 
with jBPM? 


You probably know this, but for clarification: 
RESOURCE_LOCAL means that you want the entityManager (e.g. the persistence 
layer) to be managed by the application. Application-managed persistence is 
most often used by servlets, EJB's, and locally running java applications 
because these are in essence small programs that don't need the extra overhead 
that container-managed persistence brings with it. 

These programs usually open a persistence context/connection, get the stuff 
they need, commit the stuff they changed, and clean it all up: there is no 
usually no need for fine-grained control transactions. 

In my opinion, jBPM does need more fine grained control over transactions. It 
needs this because +when+ objects/data (and which objects/data) are persisted 
is a more complicated question. JTA gives you this control.  Furthermore, I 
think there might be cases when you want to commit some objects while leaving 
other objects in the persistence context (logging objects vs. process context 
information). 

In short, 1. jBPM needs to be sure that the persistence context is always 
available, which would be more work for jBPM with application-managed/ 
(container-managed persistence just works.. :-)) and 2. jBPM needs fine-grained 
control over transactions, which is easier with JTA. 

Does that make any sense? If I'm missing something, please point it out!
--

Reply to this message by going to Community
[http://community.jboss.org/message/617007#617007]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - couldn't parse process definition

2011-07-22 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] commented on 
the document

"couldn't parse process definition"

To view all comments on this document, visit: 
http://community.jboss.org/docs/DOC-17031#comment-7122

--
Cristóvão, 

Michael's right: this is the document section. *Would you mind deleting this 
article and, if necessary, posting your question to the forum?* 

That being said, the problem you're having is probably one of the following: 
- you might have to use /'s instead of \'s. 
- It looks like youŕe giving the absolute path, but it you aren't you need to. 

In short, while the error looks complex, it's simply saying that the File can't 
be found. Try doing a check on the file first (.exists(), maybe also opening it 
and checking that the inputStream returns something..?), and then feeding it to 
the (jpdl) parser.
--

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


Re: [jboss-user] [jBPM] - jBPM

2011-07-21 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] commented on 
the document

"jBPM"

To view all comments on this document, visit: 
http://community.jboss.org/docs/DOC-11184#comment-7114

--
I added a link to the jBPM 5 database testing document I wrote.
--

___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [jBPM] - jBPM 5 database testing

2011-07-21 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
*Note: the actual implementation of this has not yet been merged into the trunk 
of jBPM!* 
(The code for this can currently be found at  
https://github.com/mrietveld/jbpm/tree/crossDbTests 
https://github.com/mrietveld/jbpm/tree/crossDbTests)

This article describes how to configure the jBPM project so that unit tests 
connect to a database or your choice instead of using the default H2 
(in-memory) database.


| * Overview of modifications (#overview)
* Explanation (#explanations)* The pom.xml  and maven settings (#pomAndSettings)
* Filtering and the datasource.properties and persistence.xml files (#filtering)
* Using PersistenceUtil in unit tests (#persistenceUtil)

* Summary (#summary)
* Appendix (#appendix) |


h3. Overview of modifications

The jbpm project root pom.xml  contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 
h5.  
http://community.jboss.org/servlet/JiveServlet/showImage/102-17071-6-16768/Untitl33ed.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/102-17071-6-16768/450-284/Untitl33ed.jpg
 
h5. A. The pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and persistence.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/persistence.xml

In the PersistenceUtil class, we read in the datasource.properties file.

[jboss-user] [jBPM] - jBPM 5 database testing

2011-07-21 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
*Note: the actual implementation of this has not yet been merged into the trunk 
of jBPM!* 

In order to allow testing to be done on other databases (instead of H2), the 
following has been done: 

*  #overview Overview of modifications
*  #explanations Explanation*  #pomAndSettings The pom.xml  and maven settings
*  #filtering Filtering and the datasource.properties and persistence.xml files
*  #persistenceUtil Using PersistenceUtil in unit tests

*  #summary Summary
*  #appendix Appendix

h3. Overview of modifications

The jbpm pom.xml (artifact jbpm) now contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 
h5.  
http://community.jboss.org/servlet/JiveServlet/showImage/102-17071-5-16768/Untitl33ed.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/102-17071-5-16768/450-284/Untitl33ed.jpg
 
h5. A. The pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and persistence.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/persistence.xml

In the PersistenceUtil class, we read in the datasource.properties file. The 
test-compile and process-test-resources goals ensure that the filtered version 
of this file -- where all maven variables have been replaced with their 
assigned values -- is placed in the same class path as the rest of

[jboss-user] [jBPM] - jBPM 5 database testing

2011-07-21 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
*Note: the actual implementation of this has not yet been merged into the trunk 
of jBPM!* 

In order to allow testing to be done on other databases (instead of H2), the 
following has been done: 

* Overview of modifications
* Explanation* The pom.xml  and maven settings
* Filtering and the datasource.properties and persistence.xml files
* Using PersistenceUtil in unit tests

* How to test on other databases
* Appendix

h3. Overview of modifications

The jbpm pom.xml (artifact jbpm) now contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 
h5.  
http://community.jboss.org/servlet/JiveServlet/showImage/102-17071-4-16768/Untitl33ed.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/102-17071-4-16768/450-284/Untitl33ed.jpg
 
h5. A. The pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and persistence.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/persistence.xml

In the PersistenceUtil class, we read in the datasource.properties file. The 
test-compile and process-test-resources goals ensure that the filtered version 
of this file -- where all maven variables have been replaced with their 
assigned values -- is placed in the same class path as the rest of the test 
classes and jars (target/, namely). 

hibernate.xml is used b

[jboss-user] [jBPM] - jBPM 5 database testing

2011-07-20 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
*Note: the actual implementation of this has not yet been merged into the trunk 
of jBPM!* 

In order to allow testing to be done on other databases (instead of H2), the 
following has been done: 

- Overview of modifications
- Explanation 
- How to test on other databases

h3. Overview of modifications

The jbpm pom.xml (artifact jbpm) now contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 
 
http://community.jboss.org/servlet/JiveServlet/showImage/102-17071-3-16762/og.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/102-17071-3-16762/450-303/og.jpg
 
h5. A. Pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and hibernate.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/hibernate.xml

In the PersistenceUtil class, we read in the datasource.properties file. The 
test-compile and process-test-resources goals ensure that the filtered version 
of this file -- where all maven variables have been replaced with their 
assigned values -- is placed in the same class path as the rest of the test 
classes and jars (target/, namely). 

hibernate.xml is used by Hibernate when we instantiate an EntityManager. 

h5. C. Using the PersistenceUtil in unit tests: 

Lastly, when we write any unit tests that use persistence, instead

[jboss-user] [jBPM] - jBPM 5 database testing

2011-07-20 Thread Marco Rietveld
Marco Rietveld [http://community.jboss.org/people/marco.rietveld] modified the 
document:

"jBPM 5 database testing"

To view the document, visit: http://community.jboss.org/docs/DOC-17071

--
*Note: the actual implementation of this has not yet been merged into the trunk 
of jBPM!* 

In order to allow testing to be done on other databases (instead of H2), the 
following has been done: 

- Overview of modifications
- Explanation 
- How to test on other databases

h3. Overview of modifications

The jbpm pom.xml (artifact jbpm) now contains: 
** Properties to be used to connect to the database of choice
** A database profile that can be used in order to inject a dependency for the 
jdbc driver jar for the database
** An example profile, which has been commented out, which shows how do test 
without using a settings file
2. A org.jbpm.persistence.util.PersistenceUtil class has been added to the 
jbpm-persistence-jpa module. 

3. The jbpm-persistence-jpa module now also has a test-jar goal: the test-jar 
produced contains the PersistenceUtil class mentioned above. 

4. In the modules in which persistence is used during testing, the following 
modifications have been made: 
* A datasource.properties file has been added to the src/test/resources 
directory. 
* The pom.xml of the module has been modified so that filtering has been turned 
on for the src/test/resources directory. 

* The persistence.xml file in src/test/resources/META-INF has been modified so 
that the hibernate.connection.* properties use variables.


How all of these modifications fit together is explained in the following 
section. 
h3. Explanation

We essentially use maven to inject the values we want into the persistence 
configuration. 

Unfortunately, because XA datasource configuration is not uniform across 
different database vendors, there is also a utility class 
(org.jbpm.persistence.util.PersistenceUtil) which contains database specific XA 
datasource configuration and which we use to initiate and configure the XA 
datasource when testing. 

An explanation follows the diagram below: 

 
http://community.jboss.org/servlet/JiveServlet/showImage/16760/jBPM_Persistence_Mechanism.jpg
  
http://community.jboss.org/servlet/JiveServlet/downloadImage/16760/702-386/jBPM_Persistence_Mechanism.jpg
 
h5. A. Pom.xml and maven settings: 

Properties


The jbpm project root pom (jbpm artifact) contains a number of maven.* 
properties: a number of these settings are empty, and those that aren't are set 
to the h2 defaults. 

However, we can create a local settings.xml file and run the following: 
 mvn clean test -ssettings-db.xml -Pdatabase

(The -Pdatabase is explained below)

By filling a local settings.xml file with the jdbc values that we want for, for 
example, our local PostgreSQL database, we can then use those values later on 
when running our tests. 

Otherwise, we can also directly modify the pom.xml itself and fill the values 
in there. 

Using a profile to inject a dependency


The -Pdatabase option in the mvn command above tells maven to use the profile 
that has an id of "database". 

In the project root pom, we have also defined a "database" profile  that uses a 
dependency. By setting the maven.jdbc.driver.jar property (in either the 
pom.xml or the settings.xml file that you use) to the path of the appropriate 
jdbc driver class jar, we can then ensure that the database specific driver 
classes are available to our tests. 

[Depending on demand, we could also add properties to the pom.xml so that the 
groupId, artifactId, and version of the driver class jar (instead of a system 
path) are defined and used]
h5. B. Filtering and the datasource.properties and hibernate.xml files: 

In the pom.xml of the module in which the testing is done (for example, 
jbpm-persistence-jpa or jbpm-bam), the following has also been added to the 
 section of the module pom: 


...
  
    
  src/test/resources
  true
    
  
...


When maven runs the process-test-resources goal, it +filters+ all files in and 
under the src/main/resources directory. Any properties that have been defined 
in the (effective) pom.xml being processed by maven, will be replaced with the 
values that have been assigned to them. 

In this case, the following two files in src/main/resources that are filtered 
for us: 
* datasource.properties
* META-INF/hibernate.xml

In the PersistenceUtil class, we read in the datasource.properties file. The 
test-compile and process-test-resources goals ensure that the filtered version 
of this file -- where all maven variables have been replaced with their 
assigned values -- is placed in the same class path as the rest of the test 
classes and jars (target/, namely). 

hibernate.xml is used by Hibernate when we instantiate an EntityManager. 

h5. C. Using the PersistenceUtil in unit tests: 

Lastly, when we write any unit tests that use persi