[JBoss-user] [JBoss jBPM] - Using hibernate annotation with jBPM

2006-03-22 Thread tibocu
Hi,

I just spend a few houres to figure how to use Hibernate Annotaiton with jBPM.
 
Here is the receipt (can probably be improved):

1-- Create an implementation of the db persistence service:
-

package com.btc.fwk.jbpm;

   [Cut imports]

public class PersistenceService extends DbPersistenceServiceFactory {
private static final Log _log = 
LogFactory.getLog(PersistenceService.class);

private Configuration _configuration;

public PersistenceService() {
super();
_log.info(Creating Persistence Service);
}

public synchronized Configuration getConfiguration() {
_log.info(Creating AnnotationConfiguration);

if (_configuration == null) {
String hibernateCfgXmlResource = null;
if (JbpmConfiguration.Configs

.hasObject(resource.hibernate.cfg.xml)) {
hibernateCfgXmlResource = 
JbpmConfiguration.Configs

.getString(resource.hibernate.cfg.xml);
}
String hibernatePropertiesResource = null;
if 
(JbpmConfiguration.Configs.hasObject(resource.hibernate.properties)) {
hibernatePropertiesResource = 
JbpmConfiguration.Configs.getString(resource.hibernate.properties);
}

_configuration = new AnnotationConfiguration();
_log.info(XML configuration file =  + 
hibernateCfgXmlResource);
_log.info(Resource file =  + 
hibernatePropertiesResource);

_configuration.configure(hibernateCfgXmlResource);

if( hibernatePropertiesResource != null ) {
_log.debug(Setting Persistence hibernate 
properties from  + hibernatePropertiesResource);

Properties properties = new Properties();

InputStream is = null;
try {
is = 
PersistenceService.class.getClassLoader().getResourceAsStream(hibernatePropertiesResource);

properties.load(is);
} catch(Exception e) {
_log.error(e);
_log.debug(Hibernate properties  + 
hibernatePropertiesResource +  not found);
} finally {
if( is != null )
try {
is.close();
} catch (IOException e) {
_log.error(e);
}
}

_configuration.setProperties(properties);
}
}

return _configuration;
}
}


2-- Declare the service
---
In jbpm.cfg.xml:

  jbpm-context
!--

--


3-- Declare the annotated classes
-


Declare the annotated classes into the hibernate.cfg.xml file.




Hope this help

Thibault Cuvillier
http://www.btcweb.com


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3931848#3931848

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3931848


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Mandatory default transition

2006-03-10 Thread tibocu
After looking on the signal() source code, it looks that the default transition 
is mandatory for a node in order to be able to call signal(String).

I'd like to use only named transitions and events.

Is there is any reason?




View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929306#3929306

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929306


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Re: Executing processes on remote machines

2006-03-10 Thread tibocu
You can use WebServices to access remotely to your servers.
Just call your web services from your jbp ActionHandler.

my 2 cts 

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929308#3929308

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929308


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Re: Some question of a Beginner in JBPM

2006-03-10 Thread tibocu
jBPM is just a Java API. You can use it in a J2SE Java application, in a J2EE 
Web application or inside of an EJB Container.

I'm not sure to understand your question, but if you just want to try some 
application code in Eclipse, you don't need a server. You the JBoss IDE and 
create  jBPM project.

taskInstance.setActorId directly assign the task to an actor.
AssignmentHandler may call setActorId, but the class first need to find an 
actorId. An example of AssignementHandler can be a Task Dispatcher which assign 
dynamically the tasks according to the workload of an actor set.

I don't get you for your last question.

Thibault Cuvillier


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929310#3929310

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929310


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Re: Mandatory default transition

2006-03-10 Thread tibocu
This problem occurs for signal(String name), but not for signal(Trnasition t).


View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929313#3929313

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929313


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - jBPM + EntityManager

2006-03-09 Thread tibocu
Hi,

Is it possible to develop the applicaiton code with EJB3 entities annotations 
and using jBPM ?

EntityManager and jBPM must share the same Hibernate Session and cache.

Should I hack the EntityManagerImpl to use the SessionFactory build by jBPM ?

Thibault

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929021#3929021

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929021


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - TaskNode ClassCastException

2006-03-09 Thread tibocu

I run a trivial example.

The token is located on a TaskNode. I checked.

1 Token token = processInstance.getRootToken();
2 Node node = token.getNode();
3 TaskNode taskNode = (TaskNode)node;

The node is not a TaskNode, but an hibernate proxy, and I get the following 
exception on line 3:
java.lang.ClassCastException: org.jbpm.graph.def.Node$$EnhancerByCGLIB$$cdd399be

J2SE 5 application
jBpm 3.1

Any idea ?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929034#3929034

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929034


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Re: TaskNode ClassCastException

2006-03-09 Thread tibocu
Strange,

If of write:
1 Token token = processInstance.getRootToken();
2 Node node = processDefinition.getNode(token.getNode().getName());
3 TaskNode taskNode = (TaskNode)node;

It works !

It looks that the Node returned by the token is not correctly instanciated.

Something I didn't get or a bug ?

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929051#3929051

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929051


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [JBoss jBPM] - Re: TaskNode ClassCastException

2006-03-09 Thread tibocu
Fixed by writing:

1 Token token = processInstance.getRootToken();
2 TaskNode taskNode = (TaskNode)jbpmContext.
getSession().
   load(TaskNode.class, 
token.getNode().getId());

See:
http://www.jboss.com/index.html?module=bbop=viewtopict=73123



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3929055#3929055

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3929055


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - presistence.xml with j2se

2006-03-05 Thread tibocu
Hi,

I run a j2se application with jax.persistence, but I cannot get the 
EntityManagerFactory declared in the persistence.xml file.

My code:
factory = Persistence.createEntityManagerFactory(em);

I get: No Persistence provider for EntityManager named em

The persistence.xml file is located in src/META-INF/persistence.xml

The application is compiled in the classes directory, with the 
META-INF/persistence.xml copied.

The application is not packaed in a jar.

Shoudl works ?

Tks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3927974#3927974

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3927974


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] [EJB 3.0] - presistence.xml with j2se

2006-03-05 Thread tibocu
Hi,

I run a j2se application with jax.persistence, but I cannot get the 
EntityManagerFactory declared in the persistence.xml file.

My code:
factory = Persistence.createEntityManagerFactory(em);

I get: No Persistence provider for EntityManager named em

The persistence.xml file is located in src/META-INF/persistence.xml

The application is compiled in the classes directory, with the 
META-INF/persistence.xml copied.

The application is not packaed in a jar.

Shoudl works ?

Tks

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=3927973#3927973

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3927973


---
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnkkid=110944bid=241720dat=121642
___
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user