[jBPM] - Re: A bit more needed in the debug output?
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"Re: A bit more needed in the debug output?"
To view the discussion, visit: http://community.jboss.org/message/627544#627544
--------------------------------------------------------------
Hi,
Very interesting. I traced into jBPM 5.1 to the point where it validates my ActionNode. It seems that if you ue theh java dialect then you do not get theh benefit of validation!!!!
if (actionString == null) {
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has empty action."));
} else if( "mvel".equals( droolsAction.getDialect() ) ) {
try {
ExpressionCompiler compiler = new ExpressionCompiler(actionString);
compiler.setVerifying(true);
ParserContext parserContext = new ParserContext();
//parserContext.setStrictTypeEnforcement(true);
compiler.compile(parserContext);
List<ErrorDetail> mvelErrors = parserContext.getErrorList();
if (mvelErrors != null) {
for (Iterator<ErrorDetail> iterator = mvelErrors.iterator(); iterator.hasNext(); ) {
ErrorDetail error = iterator.next();
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + error.getMessage() + "."));
}
}
} catch (Throwable t) {
errors.add(new ProcessValidationErrorImpl(process,
"Action node '" + node.getName() + "' [" + node.getId() + "] has invalid action: " + t.getMessage() + "."));
}
}
So this should be a documented warning to users who write their action code in java? I assume at some point the java gets compiled and this is where my error is picked up. I am going to rewrite in mvel and see how that goes.
I also note that theh action nod enam eis given for mel debug output. Since mvel takes a superset of Java, why not use it to determine the error with any java code as well?!?
} else if( "mvel".equals( droolsAction.getDialect() ) || "java".equals(droolsAction.getDialect() ) ) {
Thx.
Ed.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627544#627544]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[jBPM] - jBPM5 signalEvent data not propagated to a rule
by Miljenko Norsic
Miljenko Norsic [http://community.jboss.org/people/mnorsic] created the discussion
"jBPM5 signalEvent data not propagated to a rule"
To view the discussion, visit: http://community.jboss.org/message/627530#627530
--------------------------------------------------------------
Hi,
I have a small example that uses jBPM and drools task, as shown on picture:
http://community.jboss.org/servlet/JiveServlet/showImage/2-627530-17020/S... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-627530-170...
Basically, I'd want to trigger a signal that is going to continue with a rule task and end process. I want my event to carry data, so I've added data to a signal:
Event event = new Event();
event.setData("some data");
processInstance.signalEvent("Signal", event);
In a rule task I want to use this data from signal in LHS side:
$event : Event() from $p.getVariable("event")
This is not working and rule is not triggered.
At the same time, I can print this variable on RHS side, and it is obviuos that it exists.
Am I missing something in a rule, or this construct is not supported by Drools?
I have attached my Eclipse project as a reference.
Thanks,
Miljenko
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627530#627530]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[jBPM] - A bit more needed in the debug output?
by olddave
olddave [http://community.jboss.org/people/olddave] created the discussion
"A bit more needed in the debug output?"
To view the discussion, visit: http://community.jboss.org/message/627478#627478
--------------------------------------------------------------
Hi,
I run my Processes from a RESTful service provided by BPM console server
Across many processes after doing a getDefinitionsJSON() it calls this
KnowledgePackage kpackage: getSession().getKnowledgeBase().getKnowledgePackages()
which returns none because they have all failed with lots of these
[ERROR 13:41:19.202 BST] qtp451360643-61:CommandDelegate - Process Compilation error The left-hand side of an assignment must be a variable
The left-hand side of an assignment must be a variable
The proplem I have is I cannot think of anywhere I am doing assigments. Can I make a change somewhere that at least gives me the Node name where these are occuring? Otherwise you have no clue about where these are.
Thx.
Ed.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627478#627478]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[jBPM] - jBPM with SQL Server
by Dominique Paquin
Dominique Paquin [http://community.jboss.org/people/paqman] created the discussion
"jBPM with SQL Server"
To view the discussion, visit: http://community.jboss.org/message/627487#627487
--------------------------------------------------------------
Hello all,
I have been working on trying to integrate jBPM in out current product we are developping. I have been successful in running hte in-memory version of the project but I now need to store my process states in a data base for later recovery.
I'm using SQL Server 2005
My problem is in seting up the connection. I was able to setup a connection simply using our javax.persistence.EntityManagerFactory (which has a org.apache.commons.dbcp.BasicDataSource in it) and giving it as argument like this (with a JTA transaction manager):
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, this.dataEntityManagerFactory);
env.set(EnvironmentName.TRANSACTION_MANAGER, new JtaTransactionManager());
and later calling
JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
But when I start a process, I have a crash due to a missing TransactionManager.
...
Caused by: org.springframework.transaction.CannotCreateTransactionException: No JTA UserTransaction available - programmatic PlatformTransactionManager.getTransaction usage not supported
at org.springframework.transaction.jta.JtaTransactionManager.doGetTransaction(JtaTransactionManager.java:770)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:335)
at org.drools.container.spring.beans.persistence.DroolsSpringTransactionManager.begin(DroolsSpringTransactionManager.java:49)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:120)
... 65 more
So I tried to feed it the transaction manager we have already existing in our product, org.springframework.transaction.PlatformTransactionManager,
env.set(EnvironmentName.TRANSACTION_MANAGER, platformTransactionManager);
but the code craches a bit further with:
2011-09-20 09:12:52,409 [525023568@qtp-1417375004-4] [ERROR] [org.drools.persistence.SingleSessionCommandService] - Could not commit session
java.lang.NullPointerException
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)
at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)
...
...
...
Caused by: java.lang.NullPointerException
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:125)
... 65 more
This is the persistence.xml file I use:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0" xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm=" http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance" xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.jbpm.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<!-- jta-data-source>jdbc/processInstanceDS</jta-data-source -->
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.BTMTransactionManagerLookup"/>
</properties>
</persistence-unit>
</persistence>
I obviously can't post my code since this is part of a huge project but if you have specific questions, I can answer them. Help would be appreciated, be it with comments on what I posted above or a Dummy's guide on how to run jBPM with SQL Server :)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627487#627487]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months
[JNDI and Naming] - Reference cannot be cast to DataSource w/ standalone app client
by Steve Maring
Steve Maring [http://community.jboss.org/people/stevemaring] created the discussion
"Reference cannot be cast to DataSource w/ standalone app client"
To view the discussion, visit: http://community.jboss.org/message/627473#627473
--------------------------------------------------------------
I am trying to unit test some JPA2 DAO classes I wrote using Maven. The persistence.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="lifesmartEntityManager" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<non-jta-data-source>*MyDS*</non-jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.show-sql" value="true" />
</properties>
</persistence-unit>
</persistence>
I have deployed the DataSource to a running instance of AS 6.1.0.Final and confirmed that the global JNDIView has:
+- *MyDS* (class: javax.sql.DataSource)
When I try to run my tests, which rely on Hibernate EntityManager to lookup and associate the DataSource with the persistence-unit, I get:
08:05:12,185 ERROR [DatasourceConnectionProvider] Could not find datasource: *MyDS*
*java.lang.ClassCastException: javax.naming.Reference cannot be cast to javax.sql.DataSource*
at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:75)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:143)
at org.hibernate.ejb.InjectionSettingsFactory.createConnectionProvider(InjectionSettingsFactory.java:51)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:91)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2833)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2829)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1840)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:48)
I am certain that it is not truly a naming problem, because when I change the name to something bogus in the persistence.xml and run the test again, the error is different:
08:25:34,525 ERROR [DatasourceConnectionProvider] Could not find datasource: *YourDS*
javax.naming.NameNotFoundException: *YourDS* not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
Some have suggested this is really a classpath issue and I have started adding standalone remote client oriented libs in a bit of a shotgun approach. So far, nothing has helped. My test classpath, at this point, contains these declared artifacts, and the dependencies declared in their poms:
slf4j-log4j12
testng
jnp-client
jboss-remoting
jbosssx-client
jboss-security-spi
hibernate-validator
jboss-logging
jboss-ejb3-vfs-spi
jboss-ejb3-core
jboss-kernel
jboss-dependency
jboss-classloading-vfs
jboss-classloading
jboss-classloader
jboss-service-binding-core
jboss-metadata-client
jboss-transaction-api_1.1_spec
jboss-jmx
jboss-integration
jboss-vfs
jboss-reflect
jboss-common-core
jboss-serialization
hibernate-jpa-2.0-api
hibernate-entitymanager
I am, perhaps, still missing an artifact?
-Steve Maring
Tampa, FL
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/627473#627473]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 2 months