[jBPM Users] - jbpm 4.1 and struts - architeture solution
by Josh86
Hi everybody,
i intend to combine jbpm 4.1 with struts (and spring). I think, that is in itself a good thing.
But now i think about how to integrate human tasks inside my web application. The problem is, that for a special human task type, which is defined in the jpdl file, a special page with information on it should be shown, when the user has selected one task from her/his task list page and want to complete this task.
Maybe i could define the following page in the tasklist jsp, but for many different task types, it would be very confusing and in case a new task is defined in the jpdl file, this jsp have to be changed,
I have heard of freemarker templates, but is this possible to integrate with struts?
i hope you get my problem and can help me to find a good expandable architeture solution for this (or an example would be nice ;))
Thanks for your answers,
Josh
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253286#4253286
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253286
16 years, 7 months
[jBPM Users] - Re: How to trigger Sub-process from custom state recursively
by ekobir
Hi Ronald
Thanks for advice... I re-implemented ForEachFork and ForEachJoin for jbpm4 by using the code in ForkActivity and JoinActivity. Instead of using sub-process I used "group".
I tried to execute "groups" concurrently in the fork by labeling them with "continue=async".
But it created a lot of database level problems.
Then, I decided to test this with original JBPM functionality but again I got exceptions.
My question is --> Is there a way to execute "groups" async with Fork-Join or Do you suggest something else?
Please check following information.
| <?xml version="1.0" encoding="UTF-8"?>
|
| <process name="testForkJoin" xmlns="http://jbpm.org/4.0/jpdl">
|
| <start name="start1" g="255,53,48,48">
| <transition name="to state1" to="state1" g="-63,-22" />
| </start>
|
| <custom g="198,134,157,52" name="state1" class="com.actions.RandomActivity">
| <transition to="fork1" g="-52,-22" />
| </custom>
|
| <fork name="fork1" g="252,291,48,48">
| <transition name="to state2" to="state2" g="-63,-22" />
| <transition name="to state3" to="state3" g="-63,-22" />
| </fork>
|
| <group name="state2">
| <start>
| <transition to="state4" />
| </start>
|
| <custom g="198,134,157,52" name="state4" class="com.actions.RandomActivity" continue="async">
| <transition to="groupDone1" g="-52,-22" />
| </custom>
|
| <end name="groupDone1" />
| <transition to="join1" />
| </group>
|
| <group name="state3" continue="async">
| <start>
| <transition to="state5" />
| </start>
|
| <custom g="198,134,157,52" name="state5" class="com.actions.RandomActivity" continue="async">
| <transition to="groupDone2" g="-52,-22" />
| </custom>
|
| <end name="groupDone2" />
| <transition to="join1" />
| </group>
|
|
| <join name="join1" g="256,461,48,48">
| <transition name="to end1" to="end1" g="-54,-22" />
| </join>
| <end name="end1" g="263,568,48,48" />
| </process>
|
and Simple RandomActivity
| public void execute(ActivityExecution ae) throws Exception {
| System.out.println("in random activity");
| for(int i=0; i < 10; i++){
| Thread.sleep(10);
| System.out.println(Thread.currentThread().getName()+":"+i);
| }
| }
|
anonymous wrote :
| Here is the exception
|
| SEVERE: Could not synchronize database state with session
| org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [org.jbpm.pvm.internal.model.ExecutionImpl#3]
| at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1792)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2435)
| at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2335)
| at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2635)
| at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
| at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
| at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
| at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
| at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
| at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027)
| at org.jbpm.pvm.internal.tx.HibernateSessionResource.prepare(HibernateSessionResource.java:54)
| at org.jbpm.pvm.internal.tx.StandardTransaction.commit(StandardTransaction.java:106)
| at org.jbpm.pvm.internal.tx.StandardTransaction.complete(StandardTransaction.java:65)
| at org.jbpm.pvm.internal.tx.StandardTransactionInterceptor.execute(StandardTransactionInterceptor.java:61)
| at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:54)
| at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:55)
| at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.startProcessInstanceByKey(ExecutionServiceImpl.java:70)
| at com.playphone.alexander.afp.workFlowProcessor.TestWorkFlow.testForkJoinGroup(TestWorkFlow.java:63)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at junit.framework.TestCase.runTest(TestCase.java:154)
| at junit.framework.TestCase.runBare(TestCase.java:127)
| at junit.framework.TestResult$1.protect(TestResult.java:106)
| at junit.framework.TestResult.runProtected(TestResult.java:124)
| at junit.framework.TestResult.run(TestResult.java:109)
| at junit.framework.TestCase.run(TestCase.java:118)
| at junit.framework.TestSuite.runTest(TestSuite.java:208)
| at junit.framework.TestSuite.run(TestSuite.java:203)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
| at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
| at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
| at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
| at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:597)
| at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
| at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
|
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253284#4253284
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253284
16 years, 7 months
[JBoss Tools Users] - Re: How to create a JDBC connection
by Oliver Roell
Now I have tried the old school approach:
| Context context = new InitialContext();
| DataSource ds = (DataSource) context.lookup("java:OracleDS");
|
It works. After fighting some hours with JBoss it really works.
But something must be wrong with my first dependency injection attempt.
The following annotations are all invalid and create null-values:
| @Resource(name="jdbc/OracleDS", mappedName="java:OracleDS")
| private DataSource ds1;
|
| @Resource(name="java:OracleDS")
| private DataSource ds2;
|
| @Resource(name="java/OracleDS")
| private DataSource ds3;
|
| @Resource(name="jdbc:OracleDS")
| private DataSource ds4;
|
| @Resource(name="jdbc/OracleDS")
| private DataSource ds5;
|
Does anybody know what's wrong with the Resource-annotations?
Do they work only within EJBs and not in servlets?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253282#4253282
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253282
16 years, 7 months
[jBPM Users] - Re: Handling failure of automated activities
by emp.tyres
Thanks for the replies -
"kukeltje" wrote : 1: Exception handling like in jBPM 3 is still on the todo list (look in Jira).
Actually, I was more trying to understand what options are there to recover the process after an UNhandled exception - assuming a job fails due to an automatic action throwing an exception, what state will it end in, and how can we recover it (change the offending variable, restart the failed activity, etc.)? I understand this is not trivial, but it is still very important for us as we are orchestrating a large number of systems on a critical process.
"kukeltje" wrote : For technical retries to external systems etc, I do not think jBPM should reinvent (reimplement) the wheel (like they are doing in drools with reinventing workflow) but leverage what is already there, JBoss ESB or JMS or your custom code/custom node. For business level retries, what you describe is an option. Might require a custom node though.
Agreed - I am a bit worried at implementing a wait / loop / wait / loop custom node, though (e.g: is now after given date? if so, proceed, alse thread.sleep(10000) and then re-enter activity through self-looping transaction) - I tried it and it technically works, but does it risk hanging the whole PVM? And would it behave correctly with persistence assuming e.g. JBoss is restarted? [I can provide the code if you think it could be useful for a test case]
[BTW, this was triggered by "duedatetime" in timers throwing a org.jbpm.api.JbpmException: no 'jbpm.duedatetime.format' in current environment, adding the string to the jbpm.cfg.xml does not solve it - I could not find any JIRA for it - anyone had any success in using duedatetime?]
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4253281#4253281
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4253281
16 years, 7 months