[jBPM] - Signal a wait state and suspend related running subprocesses
by Stefano Cancedda
Stefano Cancedda [http://community.jboss.org/people/festano1] created the discussion
"Signal a wait state and suspend related running subprocesses"
To view the discussion, visit: http://community.jboss.org/message/563527#563527
--------------------------------------------------------------
Hi All,
I'm trying to realize a complex use case with Jbpm 4, and I'm lookin for some advises and answers.
My requisites are to implements some kind of "phases" inside a business process (which models an authorization issuing system
for a governative trade organization) that can be "modular" and pluggable to the basis of some normative & legal factors.
I've move to the use of sub-processes in order to implement this, using a dynamic el expression to decide in runtime what process definition of
instantiate as sub-process, via parameterizing the jpdl sub-process' key attribute.
So the structure is composed by a main process, that groups these phases, and many other subprocesses which can can be
authored by external system and business designers.
Another requisite is that in one phase (es: when an integration request is started) the main process is paused,
a timer is started (the pause cannot be longer than a business value, and users must be notified if the suspension is reaching it's limit),
and then resumed.
For authoring sub-process I don't find seamless to design for any subprocess some kind of a "suspension" state
(this would be always present, and redundant), so I'm thinking to enforce the suspension state at the level of the main process:
Hi All,
I'm trying to realize a complex use case with Jbpm 4, and I'm lookin for some advises and answers.
My requisites are to implements some kind of "+phases+" inside a business process (which models an authorization issuing system for a governative trade organization) that must be "modular" and +pluggable+ to the basis of some normative & legal factors.
I've move to the use of sub-processes in order to implement this, using a dynamic +el expression+ to decide in runtime what process definition of instantiate as sub-process, via parameterizing the jpdl sub-process' key attribute.
So the structure is composed by a main process, that groups these phases, and many other subprocesses which can can be
authored by external system and business designers.
Another requisite is that in one phase (es: when an integration request is started) the main process is paused,
a timer is started (the pause cannot be longer than a business value, and users must be notified if the suspension is reaching it's limit),
and then resumed.
For authoring sub-process I don't find seamless to design for any subprocess some kind of a "suspension" state
(this would be always present, and redundant), so I'm thinking to enforce the suspension state at the level of the main process:
http://community.jboss.org/servlet/JiveServlet/showImage/2-563527-9328/pr... http://community.jboss.org/servlet/JiveServlet/downloadImage/2-563527-932...
I cannot use the execution suspension of the main process, because of the timer's requisite (execution "*suspended*" state, also suspend timers and notifications),and I cannot +end+ the sub-process because formally, at the end of the "wait" period it must progress where the sub-process was left.
The problem is that when signaling the main execution to the "Suspend" state, there is a running sub-process instance that invalidate the operation:
0.0.1. EXCEPTION ###########################################10:42:32,067 INF | http://community.jboss.org/message/563527#563527 Signal a wait state and suspend related running subprocesses exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd(a)3ce40org.jbpm.api.JbpmException: execution[MainProcess.50026] has running subprocess: execution[SubProcessRequisitesEvaluation.340002] in state inactive-scope at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1090) at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:427) at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61) at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35) at org.jbpm.pvm.internal.svc.DefaultCommandService.execute(DefaultCommandService.java:42) at org.jbpm.pvm.internal.tx.SpringCommandCallback.doInTransaction(SpringCommandCallback.java:45) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130) at org.jbpm.pvm.internal.tx.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:49) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53) at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40) at org.jbpm.pvm.internal.svc.RetryInterceptor.execute(RetryInterceptor.java:56) at org.jbpm.pvm.internal.svc.ExecutionServiceImpl.signalExecutionById(ExecutionServiceImpl.java:93)
I've tried to suspend the sub-process activity execution and resume the main-process activity that maps the sub-process execution (the one in "inactive-scope" state) but it have no effect:
... ExecutionImpl execution = (ExecutionImpl) executionService.findExecutionById(processId);logger.info( "MAIN-PROCESS STATE= " + processId + " " + execution.getState() );if(execution.getSubProcessInstance() != null){ logger.info( "SUB_PROCESS STATE= " + execution.getSubProcessInstance().getId() + " " + execution.getSubProcessInstance().getState() ); if(Execution.STATE_INACTIVE_SCOPE.equalsIgnoreCase(execution.getSubProcessInstance().getState())){ ExecutionImpl state = execution.getSubProcessInstance().findActiveExecutionIn(activeState); state.suspend(); execution.getSubProcessInstance().suspend(); logger.info( "SUB_PROCESS STATE= " + execution.getSubProcessInstance().getId() + " " + execution.getSubProcessInstance().getState() ); logger.info( "SUB_PROCESS ACTIVITY STATE " + state + " " + state.getState() ); execution.resume(); logger.info( "MAIN-PROCESS STATE " + execution + " " + execution.getState() ); }} executionService.signalExecutionById(processId, transitionName, variables);
this is the log:
INFO ProcessServiceBean - Active state: EVALUATIONINFO ProcessServiceBean - MAIN-PROCESS STATE= MainProcess.50026 active-rootINFO ProcessServiceBean - SUB_PROCESS STATE= SubProcessRequisitesEvaluation.340002 inactive-scopeINFO ProcessServiceBean - SUB_PROCESS STATE= SubProcessRequisitesEvaluation.340002 suspendedINFO ProcessServiceBean - SUB_PROCESS ACTIVITY STATE= execution[SubProcessRequisitesEvaluation.340002.TaxCompliance.340005] suspendedINFO ProcessServiceBean - MAIN-PROCESS STATE execution[MainProcess.50026] active-root### EXCEPTION ###########################################12:05:39,201 INF | http://community.jboss.org/message/563527#563527 Signal a wait state and suspend related running subprocesses exception while executing command org.jbpm.pvm.internal.cmd.SignalCmd(a)ebd0beorg.jbpm.api.JbpmException: execution[MainProcess.50026] has running subprocess: execution[SubProcessRequisitesEvaluation.340002] in state suspended at org.jbpm.pvm.internal.model.ExecutionImpl.checkActive(ExecutionImpl.java:1090) at org.jbpm.pvm.internal.model.ExecutionImpl.signal(ExecutionImpl.java:427) at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:61) at org.jbpm.pvm.internal.cmd.SignalCmd.execute(SignalCmd.java:35
So, I'm wondering if the behaviour of Jbpm is wrong or if it's supposed to work in this way (namely: "cannot signal parent execution id subprocess are suspended"), or BTW if there is a common way to implement this set of requisites.
thank you in advance for any help you can give me!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/563527#563527]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
Authentication with credentials and without for the same URL
by Tim Terlegård
I would like JBoss AS to handle authentication, but I would like to
handle the authorization programmatically.
If a client passes username/password I would like JBoss to
authenticate this request and pass the principal+roles to the servlet.
If the client doesn't pass any credentials I would still like the
servlet to be invoked but without any principal or roles. How can one
do this?
If I don't have any <security-constraint> in web.xml it doesn't seem
like authentication is triggered. I don't get any principal in my
servlet. If I have a <security-constraint> I must supply a role and
that won't work for unauthenticated users. Is there a way to trigger
authentication without having a <security-constraint> in web.xml?
Thanks,
Tim
14 years, 2 months
[JBoss Tools] - Seam Generate Entities : classe not found
by Philippe Leménager
Philippe Leménager [http://community.jboss.org/people/cinephil] created the discussion
"Seam Generate Entities : classe not found"
To view the discussion, visit: http://community.jboss.org/message/563486#563486
--------------------------------------------------------------
Hello Seamians ! :)
I've encountered some difficulties to create a Seam Web Project for Tomcat 6 using JBoss Tools but I've finally succeded and could see the "Welcome to Seam" page. You can see the operations on my http://blog.developpez.com/cinephil/p9314/java/jboss-seam/creer-un-projet... blog (in French).
Next step, I've a simple test MySQL database with only one very simple table called users.
I've used the JBoss Tools command "Seam Generate Entities" and a Users.java class has been created in src/org.domain.projettest.entity.
There was an error signaled at the @Entity annotation in the class : "This mapped class is not specified in persistence unit “hibernate”" and I've found the solution on http://edemmorny.wordpress.com/2009/04/28/using-eclipse-dali-with-hiberna... Edem Morny's Tech Blog to resume the error.
But now my project is not accessible. I have these errors in the console :
GRAVE: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.jboss.seam.servlet.SeamListener
org.jboss.seam.InstantiationException: Could not instantiate Seam component: entityManagerFactory
...
Caused by: javax.persistence.PersistenceException: [PersistenceUnit: projettest] class or package not found
at org.hibernate.ejb.Ejb3Configuration.addNamedAnnotatedClasses(Ejb3Configuration.java:1093)
...
Caused by: java.lang.ClassNotFoundException: org.domain.projettest.entity.Users
What's wrong ?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/563486#563486]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months
[JBoss Web Services] - Error: Unsupported Java encoding for writing wsdl file: 'ISO8859_15'.
by Hugo Silva
Hugo Silva [http://community.jboss.org/people/ghostcompt] created the discussion
"Error: Unsupported Java encoding for writing wsdl file: 'ISO8859_15'."
To view the discussion, visit: http://community.jboss.org/message/563478#563478
--------------------------------------------------------------
Hello,
I'm having problems publishing a Web Service on JBoss AS 4.2.3 with *jbossws-native-3.1.1.GA*
This is the code:
@WebService
public interface ZDepTestWSInterface { @WebMethod Integer getZValue(@WebParam(name="value") Integer value);}
@Stateless@WebService(endpointInterface="hugo.deptest.a.api.ZDepTestWSInterface")public class ZDepWS implements ZDepTestInterfaceRemote, ZDepTestWSInterface { public Integer getZValue(Integer value) { return value + 2; } }
@WebService
public interface ZDepTestWSInterface {
@WebMethod
Integer getZValue(@WebParam(name="value") Integer value);
}
I'm deploying on a Linux machine.
If the locale is en_US.UTF-8 everything works ok.
But if the locale is pt_PT@euro, i get the following exception:
---
org.jboss.ws.WSException: Cannot publish wsdl to: /home/jboss/jboss-4.2.3.GA/server/all/data/wsdl/ZTest.ear/ZTest-EJB.jar/ZDepWSService2420312176256736548.wsdl
at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:142)
at org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect.start(PublishContractDeploymentAspect.java:50)
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:129)
at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:95)
at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:88)
...
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=CONFIGURATION_ERROR: Unsupported Java encoding for writing wsdl file: 'ISO8859_15'.
at com.ibm.wsdl.xml.WSDLWriterImpl.writeWSDL(Unknown Source)
at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlImports(WSDLFilePublisher.java:188)
at org.jboss.wsf.stack.jbws.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:125)
... 35 more
---
This only happens if i use the endpointInterface on the WebService annotation.
If i expose the getZValue as a WebMethod on the Staless bean class everything works ok.
I don't know what is wrong. Can you please help ?
Thank you
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/563478#563478]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
14 years, 2 months