[JBoss jBPM] - Signaling Transition from a Java State
by waterloo
Hi all,
I need to signal a transition from a Java state and I don't know how to gain access to the current process instance.
In fact I have a highly specialized Java Class (the CommandHandler class) that handles all states in the process. Each type of state executes a different method in the CommandHandler class, which has a set of specific parameters.
It's like:
- jpdl
<java class="CommandHandler"
| g="281,211,80,40" method="doSomething" name="0">
| <arg>
| <string value="0" />
| </arg>
| <arg>
| <string value="13" />
| </arg>
| <arg>
| <string value="" />
| </arg>
| <transition g="-46,-18" name="to 1" to="1" />
| <transition g="-46,-18" name="to 13" to="13" />
| </java>
-java
| void doSomething(String curLabel, String gotoLabel, String expr) {
| ......
| }
When executing doSomething, I need to signal a transition either to 1 or 13 but I don't know how to do it since I don't have any link with the runtime within a Java state.
Any help will be appreciated.
cheers
tco
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247635#4247635
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247635
16 years, 8 months
[JBoss jBPM] - Integration problem of jBPM 4, Spring and Hibernate
by KeithWong123
I would like to integrate Spring and jBPM 4 (with Hibernate) but find the following problems. Can anybody help to indicate what is wrong? Or are there any working example which demonstrate how to do the integration?
The problem is:
Program:
*******************************************
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.env.SpringContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import Service.ProductManager;
public class Test{
private static ProductManager pm;
public static void main(String args[]){
ApplicationContext ac = new ClassPathXmlApplicationContext(new String[] {"applicationContext-test.xml"});
EnvironmentFactory environmentFactory = (EnvironmentFactory) new PvmEnvironment(new JbpmConfiguration());
Environment environment = environmentFactory.openEnvironment();
environment.setContext(new SpringContext(ac));
}
}
Console output:
*******************************************
Exception in thread "main" org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.jbpm.spring.cfg.SpringConfigurationFactoryBean] for bean with name 'jbpmConfiguration' defined in class path resource [applicationContext-test.xml]; nested exception is java.lang.ClassNotFoundException: org.jbpm.spring.cfg.SpringConfigurationFactoryBean
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1138)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:522)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1174)
at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:754)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:422)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:93)
at Test.main(Test.java:17)
Caused by: java.lang.ClassNotFoundException: org.jbpm.spring.cfg.SpringConfigurationFactoryBean
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:249)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:381)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1135)
... 9 more
This is my applicationContent.xml:
*******************************************
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
classpath:hibernate.cfg.xml
<bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
*******************************************
Looking forward for your reply.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4247570#4247570
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4247570
16 years, 8 months