API Java WorkflowService et visibilité des Workflow via JBPM

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

API Java WorkflowService et visibilité des Workflow via JBPM

Bonjours à tous,

Je viens vous solliciter pour votre précieuse aide pour la gestion de workflows depuis les API alfresco Java.

En effet j'ai un souci sur la visibilité de mes workflows que je récupère dans une IHM pour une meilleur gestion.

Je ne vois pas les workflows déployés via JBPM. et je ne vois seulement ceux déployés via activiti.

J'avais déjà eu ce problème pour la lecture via la console des workflows que j'avais réglé en modifiant le fichier alfreco-globale.properties .

J'ai donc voulu essayé de faire pareil sous java grâce à ce code :

workflowAdminService.setEngineEnabled(ENGINE_ID, true);
   workflowAdminService.setEngineEnabled("activiti", true);

Ps : avec des SOP j'ai bien verifié que mes les modifs étaient bien prises en compte  "  workflowAdminService.isEngineEnabled(ENGINE_ID) " etc..

Cependant cela ne fonctionne pas..

Je ne vois toujours uniquement que les workflows déployés via activiti.

Mon Log :

15:34:33,864 [AWT-EventQueue-0] INFO  JpdlXmlReader : process xml information: no swimlane or assignment specified for task '<task xmlns="urn:jbpm.org:jpdl-3.1" name="pubwf:wait" blocking="false" signalling="true" priority="normal"><timer duedate="#{pubwf_scheduledPublishDate}" transition="toPublish"><action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript" config-type="field" accept-propagated-events="true">
                    <script accept-propagated-events="true">
                        logger.log("Checking dependencies for PUblishing  Event: "+ pubwf_publishingEvent);
                    </script>
                </action></timer></task>'
15:34:35,189 [AWT-EventQueue-0] WARN  DeclarativeRegistry : Unable to register script classpath:alfresco/webscripts/classpath/folder1/subfolder1/folder1_subfolder1_file2.desc.xml due to error: 05270005 Failed to parse web script description document classpath/folder1/subfolder1/folder1_subfolder1_file2.desc.xml ; 05270004 Unable to establish HTTP Method from web script description: naming convention must be <name>.<method>.desc.xml
15:34:35,190 [AWT-EventQueue-0] WARN  DeclarativeRegistry : Unable to register script classpath:alfresco/webscripts/classpath/folder1/subfolder2/folder1_subfolder2_file2.desc.xml due to error: 05270007 Failed to parse web script description document classpath/folder1/subfolder2/folder1_subfolder2_file2.desc.xml ; 05270006 Unable to establish HTTP Method from web script description: naming convention must be <name>.<method>.desc.xml
15:34:35,191 [AWT-EventQueue-0] WARN  DeclarativeRegistry : Unable to register script classpath:alfresco/webscripts/documents/samples2/sample3.get.desc.xml due to error: 05270009 Failed to parse web script description document documents/samples2/sample3.get.desc.xml ; 05270008 Invalid schema type reference samples.sample1.status1
15:34:35,192 [AWT-EventQueue-0] WARN  DeclarativeRegistry : Unable to register package description document classpath:alfresco/webscripts/documents/samples2/package-desc.xml due to error: 05270001 Failed to parse package description document documents/samples2/package-desc.xml ; 05270000 Expected <package> root element - found <package1>
15:34:35,192 [AWT-EventQueue-0] WARN  DeclarativeRegistry : Unable to register schema description document classpath:alfresco/webscripts/documents/schemas/samples.sample2.schema-desc.xml due to error: 05270003 Failed to parse schema description document documents/schemas/samples.sample2.schema-desc.xml ; 05270002 Expected <schema> root element - found <schema1>
———————————-ENGINE : true
———————————-ENGINE : true
———————————-ENGINE : true
———————————-ENGINEjava.util.HashMap$KeyIterator@5299ef35
15:34:35,769 [AWT-EventQueue-0] INFO  MessageServiceImpl : Messages cache destroyed (all locales)
15:34:35,770 [AWT-EventQueue-0] INFO  MessageServiceImpl : Empty message service initialised
15:34:35,787 [AWT-EventQueue-0] INFO  MessageServiceImpl : Message bundles (x 0) loaded for locale fr_FR
setup workfloowd
entré try
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 2f3f0921-3c5e-45ac-97e5-7b4084b4b780bpmn20.xml
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 2f3f0921-3c5e-45ac-97e5-7b4084b4b780activitiAdhoc.png
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 31390cdc-619f-4974-829e-c7427c13bf20activitiReview.png
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 31390cdc-619f-4974-829e-c7427c13bf20bpmn20.xml
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 6d312b52-c48d-4e6c-9df9-a71fc7ca130ebpmn20.xml
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 6d312b52-c48d-4e6c-9df9-a71fc7ca130eactivitiReviewPooled.png
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 5b0ddfc6-200e-4c9f-be36-9fde78bcae67activitiParallelReview.png
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 5b0ddfc6-200e-4c9f-be36-9fde78bcae67bpmn20.xml
27 juin 2012 15:34:38 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:38 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:38 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource f4496827-ffa6-49b5-8a80-368a876643ecbpmn20.xml
27 juin 2012 15:34:38 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource f4496827-ffa6-49b5-8a80-368a876643ecactivitiParallelGroupReview.png
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 82719fa7-6bfb-4d1a-b469-51eb9f6f8ce3bpmn20.xml
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 8855172d-9e18-441d-8e05-4e00e8be4f0dbpmn20.xml
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
27 juin 2012 15:34:39 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 920bd836-15b3-4c98-9580-8b2e754360b0bpmn20.xml
27 juin 2012 15:34:40 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
27 juin 2012 15:34:40 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiAdhoc
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiReview
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiReviewPooled
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiParallelReview
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiParallelGroupReview
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiInvitationModerated
test id jbpm : : jbpm$7699
workflow name—–>activiti$activitiInvitationNominated
test id jbpm : : jbpm$7699
workflow name—–>activiti$publishWebContent
initiated successfully
org.alfresco.service.cmr.workflow.WorkflowException: 05270000 Invalid Global Id ''
   at org.alfresco.repo.workflow.BPMEngineRegistry.getGlobalIdParts(BPMEngineRegistry.java:210)
   at org.alfresco.repo.workflow.BPMEngineRegistry.getEngineId(BPMEngineRegistry.java:223)
   at org.alfresco.repo.workflow.WorkflowServiceImpl.startWorkflow(WorkflowServiceImpl.java:397)
   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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy69.startWorkflow(Unknown Source)
   at src.gestionWorkflows.WorkflowDefinition.Workflow.doExample(Workflow.java:181)
   at src.gestionWorkflows.WorkflowDefinition.Workflow.execute(Workflow.java:138)
   at src.interfaceAltiva.IHM_Principale.jBAddWorkflowsMouseClicked(IHM_Principale.java:189)
   at src.interfaceAltiva.IHM_Principale.access$0(IHM_Principale.java:176)
   at src.interfaceAltiva.IHM_Principale$1.mouseClicked(IHM_Principale.java:66)
   at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
   at java.awt.Component.processMouseEvent(Component.java:6293)
   at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
   at java.awt.Component.processEvent(Component.java:6055)
   at java.awt.Container.processEvent(Container.java:2039)
   at java.awt.Component.dispatchEventImpl(Component.java:4653)
   at java.awt.Container.dispatchEventImpl(Container.java:2097)
   at java.awt.Component.dispatchEvent(Component.java:4481)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4575)
   at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4245)
   at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4166)
   at java.awt.Container.dispatchEventImpl(Container.java:2083)
   at java.awt.Window.dispatchEventImpl(Window.java:2482)
   at java.awt.Component.dispatchEvent(Component.java:4481)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:648)
   at java.awt.EventQueue.access$000(EventQueue.java:84)
   at java.awt.EventQueue$1.run(EventQueue.java:607)
   at java.awt.EventQueue$1.run(EventQueue.java:605)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
   at java.awt.EventQueue$2.run(EventQueue.java:621)
   at java.awt.EventQueue$2.run(EventQueue.java:619)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:618)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Je n'arrives pas à cerner si mon problème vient de la pile INFO suivante :
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource 2f3f0921-3c5e-45ac-97e5-7b4084b4b780bpmn20.xml
27 juin 2012 15:34:37 org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage

etc..


"  test id jbpm : : jbpm$7699  "  correspond à mon workflow courant qui à été déployé correctement. Je le cherche parmis la liste de workflow que je récupère, seulement il n'y a que des activiti..

"   Invalid Global Id ''   "  c'est normale car une fois récupéré mon id de la liste correspondant à l'id du workflow qui vient d'être créé, je l’exécute. Mais le problème n'est pas là ^^


Merci pour ceux qui accorderons un peu de leur temps à mon problème !
1 Reply
Highlighted
Member II

Re: API Java WorkflowService et visibilité des Workflow via JBPM

Yes !

J'ai solutionné mon problème !

Je vais vous faire part de la solution ^^ :

Alors
Je ne sais pas pourquoi mais ce code ne fonctionne pas :
workflowAdminService.setEngineEnabled(JBPMEngine.ENGINE_ID, true);
   workflowAdminService.setEngineEnabled("activiti", true);

Donc j'ai trouvé une alternative surement plus robuste qui est la suivante :

Il faut déjà que vous récupériez une objet de cette API  : WorkflowAdminServiceImpl

Pour créer un objet de l'API : WorkflowTestHelper

Cette dernière permet par exemple de definir le moteur pour la création des workflows, dans mon cas JBPM.

Donc grâce àc e bout de code :
protected WorkflowAdminServiceImpl adminImpl;



   adminImpl= getWorkflowAdminService();
   testHelper = new WorkflowTestHelper(adminImpl, JBPMEngine.ENGINE_ID, false);
    testHelper.setVisible(true);


EDIT :  " getWorkflowAdminService(); " est tout simplement la méthode qui me permet de récup l'objet définit de la manière suivante :

this.workflowAdminService = (WorkflowAdminServiceImpl) ctx.getBean(WorkflowAdminServiceImpl.NAME); 


j'obtiens bien la liste des workflows déployés avec jbpm et ceux d'activiti ( grâce au booléen false).
Je rajoute que cette méthode de base ne liste pas les différentes versions des workflows.
Log :

test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiAdhoc
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiReview
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiReviewPooled
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiParallelReview
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiParallelGroupReview
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiInvitationModerated
test id jbpm : : jbpm$7720
workflow name—–>activiti$activitiInvitationNominated
test id jbpm : : jbpm$7720
workflow name—–>activiti$publishWebContent
test id jbpm : : jbpm$7720
workflow name—–>jbpm$WorkFlowTest
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wf:adhoc
jbpm$1
test id jbpm : : jbpm$7720
workflow name—–>jbpm$TEEEEEEEEEEEEEEST
test id jbpm : : jbpm$7720
workflow name—–>jbpm$inwf:invitation-nominated
test id jbpm : : jbpm$7720
workflow name—–>jbpm$imwf:invitation-moderated
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wf:review
test id jbpm : : jbpm$7720
workflow name—–>jbpm$workflowTestHandler
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wf:parallelreview
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wcmwf:changerequest
test id jbpm : : jbpm$7720
workflow name—–>jbpm$workflowTest
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wf:reviewpooled
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wf:parallelgroupreview
test id jbpm : : jbpm$7720
workflow name—–>jbpm$TeestProccess
test id jbpm : : jbpm$7720
workflow name—–>jbpm$publishWebContent
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wcmwf:submit
test id jbpm : : jbpm$7720
workflow name—–>jbpm$wcmwf:submitdirect


Bon codage à vous Smiley Wink
Je reste à votre disposition si vous avez du mal sur ce point.