[JBoss jBPM] - How to inject a Seam component in a Decision Node ?
by freejohn22
Hi all !
I have a simple Seam POJO which manages my task :
@Name("SeamBean")
| public class SeamBean
| {
|
| private int items;
|
| public int getItems()
| {
| return items;
| }
|
| public void seItems(int items) {
| this.items = items;
| }
|
|
| @CreateProcess(definition="simple")
| public void startProcess() { }
|
| @StartTask @EndTask
| public void done() {}
|
| }
Now I need to inject this component in a JBPM Decision node:
public class MyDecisionNode implements DecisionHandler {
|
| @In(scope=ScopeType.BUSINESS_PROCESS)
| SeamBean seamBean;
|
| public String decide(ExecutionContext executionContext) throws Exception {
|
| System.out.println(seamBean); // NULL !
| }
|
| }
|
Unfortunately the component is injected as null (I've tried also without declaring the scope = BUSINESS_PROCESS).
Any idea how to fix it ?
thanks a lot
john
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183848#4183848
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183848
15 years, 11 months
[JBoss jBPM] - Re: jbpm configuration resource 'jbpm.cfg.xml' is not availa
by ruchika
Yes, I have put 'jbpm.cfg.xml' in lib of my java project.
Let me explain you whole scenario:
I have developed business process using eclipse.
Now I have java project in which I have class trying to access this process.
For your reference I am putting snipet of code below:
....
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance("D:\\eclipse_new\\eclipse-SDK-3.4.1-win32\\eclipse\\workspace\\TestEvenNumberjDPL\\src\\lib\\jbpm.cfg.xml");
//jbpmConfiguration.parseResource("D:\\eclipse_new\\eclipse-SDK-3.4.1-win32\\eclipse\\workspace\\TestEvenNumberjDPL\\src\\lib\\jbpm.cfg.xml");
//jbpmConfiguration.parseXmlString("D:\\eclipse_new\\eclipse-SDK-3.4.1-win32\\eclipse\\workspace\\TestEvenNumberjDPL\\src\\lib\\jbpm.cfg.xml");
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
ProcessDefinition definition = ProcessDefinition.parseXmlResource("D:/eclipse_new/eclipse-SDK-3.4.1-win32/eclipse/workspace/Even-number-manipulation/src/main/jpdl/add-even-numbers/processdefinition.xml");
ProcessInstance instance = new ProcessInstance(definition);
.....
I have a lib folder consisting all requied jar and 'jbpm.cfg.xml'.
I am not sure whether this is correct way or not.
Can you please suggest me the required steps?
Regards,
Ruchika
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183759#4183759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183759
15 years, 11 months
[JBoss jBPM] - Re: jbpm configuration resource 'jbpm.cfg.xml' is not availa
by ruchika
Hello,
As suggested by you I printed the classpath and and found file is present there.
What else I need to have to access it from external stanalone application?
Some specific directory structure or something else?
I am getting below error:
log4j:WARN No appenders could be found for logger (org.jbpm.JbpmConfiguration).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.jbpm.JbpmException: couldn't parse jbpm configuration from resource 'D:\eclipse_new\eclipse-SDK-3.4.1-win32\eclipse\workspace\TestEvenNumberjDPL\src\lib\jbpm.cfg.xml'
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:292)
at EvenNumbersTest.main(EvenNumbersTest.java:15)
Caused by: org.jbpm.JbpmException: jbpm configuration resource 'D:\eclipse_new\eclipse-SDK-3.4.1-win32\eclipse\workspace\TestEvenNumberjDPL\src\lib\jbpm.cfg.xml' is not available
at org.jbpm.JbpmConfiguration.getInstance(JbpmConfiguration.java:286)
... 1 more
Regards,
Ruchika
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183752#4183752
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183752
15 years, 11 months