14 Replies Latest reply on Nov 5, 2013 4:55 AM by Vladimir Belyakof

    JBPM. Skip task (not work timer)

    Vladimir Belyakof Newbie

      Hello. used jbpm 6. I need to implement: user has the task if it does not start for some time, it is necessary to cancel the job. I am using the following approach. But it does not work when the process is run multiple times. Perhaps it is a mistake jbpm or I do something wrong. I just can `t come up with custom implementation of the timer. Please help me Безымянный.png

        • 1. Re: JBPM. Skip task (not work timer)
          Maciej Swiderski Master

          there was an issue with boundary events in 5.4 that removed the proper event listeners after canceling the task. It was fixed in version 6 and should work properly. How do you start your process? Do you use jbpm-console or use your custom code where jbpm is embedded?

           

          HTH

          • 2. Re: JBPM. Skip task (not work timer)
            Vladimir Belyakof Newbie

            I use for start the code in this jsvitak's example :

            https://github.com/jsvitak/jbpm-6-examples/tree/master/rewards-basic

             

            The problem occurs when I run the process several times.

             

            Please tell me how I can fix this problem.

            • 3. Re: JBPM. Skip task (not work timer)
              Maciej Swiderski Master

              Vladimir, that was in fact bug (left over after improving transaction handling for human task) and was fixed two days ago. Would you mind testing it with recent snapshot?

               

              HTH

              • 4. Re: JBPM. Skip task (not work timer)
                Vladimir Belyakof Newbie

                Thanks for the information. Please tell me how I must use the latest version of the libraries. I collect project from Maven. I think I should just specify a different version of a library in pom.xml, But I do not know what kind of library i must to change and what version is the latest.

                • 5. Re: JBPM. Skip task (not work timer)
                  Maciej Swiderski Master

                  it should be enough to change version to 6.0.0-SNAPSHOT and that will bring all the latest changes including the fix.

                   

                  HTH

                  • 6. Re: JBPM. Skip task (not work timer)
                    Vladimir Belyakof Newbie

                    I changed version to 6.0.0-SNAPSHOT, but lost annotation org.kie.commons.services.cdi.Startup. I used javax.ejb.Startup, but app failed deployed.

                    • 7. Re: JBPM. Skip task (not work timer)
                      Maciej Swiderski Master

                      that annotation has been moved to UberFire as part of the split of KIE and UberFire projects. Instead of startup you can now use jbpm equivalent of it: @BootOnLoad it has exactly same meaning but slightly simplified as it does not need to have different phases as it's needed in UberFire. Please update you META-INF/services/javax.enterprise.inject.spi.Extension file and replace:

                      org.kie.commons.services.cdi.StartupBeanExtension

                      with:

                      org.jbpm.shared.services.cdi.BootOnLoadExtension

                       

                      and that should solve the problem.

                       

                      HTH

                      • 8. Re: JBPM. Skip task (not work timer)
                        Vladimir Belyakof Newbie

                        Thank. I'm not sure that properly understood, but in my application folder META-INF is not exist  file services/javax.enterprise.inject.spi.Extension. I can just use the Annotation org.jbpm.shared.services.cdi.BootOnLoadExtension but the application still can not be deployed

                        • 9. Re: JBPM. Skip task (not work timer)
                          Maciej Swiderski Master

                          if you don't have this file in META-INF/services then the annotation is useless as it is there for CDI extension and if there is no extension defined it won't take any effect.

                           

                          Could you attach server log with failures you receive during deployment? That might help to track what's wrong and fix it.

                           

                          HTH

                          • 10. Re: JBPM. Skip task (not work timer)
                            Vladimir Belyakof Newbie

                            I'm sorry I wrote wrong. I simple replace the annotated 'Startup' on org.jbpm.shared.services.cdi.BootOnLoad (incorrectly stated in the previous post BootOnLoadExtension) But I really do not know how to do something about what you are saying.

                             

                             

                            Thus at the moment  annotated does not really seem  works.

                            Attach a log:

                             

                            {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {

                                "jboss.persistenceunit.\"rewards-basic-6.0.0-SNAPSHOT.war#com.sample.rewards\"" => "org.jboss.msc.service.StartException in service jboss.persistenceunit.\"rewards-basic-6.0.0-SNAPSHOT.war#com.sample.rewards\": javax.persistence.PersistenceException: [PersistenceUnit: com.sample.rewards] class or package not found

                                Caused by: javax.persistence.PersistenceException: [PersistenceUnit: com.sample.rewards] class or package not found

                                Caused by: java.lang.ClassNotFoundException: org.jbpm.services.task.impl.model.TaskEventImpl from [Module \"org.hibernate:main\" from local module loader @cd3509c (finder: local module finder @5513858 (roots: C:\\jbpm\\jboss-eap-6.1\\modules,C:\\jbpm\\jboss-eap-6.1\\modules\\system\\layers\\base))]",

                                "jboss.deployment.unit.\"rewards-basic-6.0.0-SNAPSHOT.war\".WeldBootstrapService" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"rewards-basic-6.0.0-SNAPSHOT.war\".WeldBootstrapService: Failed to start service

                                Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: java.lang.ClassNotFoundException: org.jbpm.services.task.lifecycle.listeners.JPATaskLifeCycleEventListener from [Module \"deployment.rewards-basic-6.0.0-SNAPSHOT.war:main\" from Service Module Loader]; location: <class>org.jbpm.services.task.lifecycle.listeners.JPATaskLifeCycleEventListener</class> in vfs:/C:/jbpm/jboss-eap-6.1/bin/content/rewards-basic-6.0.0-SNAPSHOT.war/WEB-INF/beans.xml@10

                                Caused by: java.lang.ClassNotFoundException: org.jbpm.services.task.lifecycle.listeners.JPATaskLifeCycleEventListener from [Module \"deployment.rewards-basic-6.0.0-SNAPSHOT.war:main\" from Service Module Loader]"

                            }}}}

                            • 11. Re: JBPM. Skip task (not work timer)
                              Maciej Swiderski Master

                              ok, the issue here is because of move of some of the classes from jbpm-human-task-core into jbpm-human-task-audit. So to fix this error do following:

                              • add jbpm-human-task-audit to your pom.xml
                              • edit persistence.xml and replace org.jbpm.services.task.impl.model.TaskEventImpl with org.jbpm.services.task.audit.TaskEventImpl
                              • edit beans.xml and remove org.jbpm.services.task.lifecycle.listeners.JPATaskLifeCycleEventListener

                              That should resolve the issues for the deployment. And with the annotation don't think you need it at the moment so you can remove it for now. Just to make sure app is working and then when you need it you can add the annotation and extension definition.

                               

                              HTH

                              • 12. Re: JBPM. Skip task (not work timer)
                                Vladimir Belyakof Newbie

                                Ok thanks. Now the application is deployed. But I can not start the process. I think that the persistence.xml needs to be corrected. At the moment in Eclipse have error: Mapping file cannot be resolved for lines:

                                     <mapping-file> META-INF/JBPMorm.xml </ mapping-file>

                                     <mapping-file> META-INF/Taskorm.xml </ mapping-file>

                                May be a problem not only in these lines.

                                My log file: https://drive.google.com/file/d/0B6aJ6H5VNJ4XRUs4WFFYX2JoMjg/edit?usp=sharing

                                • 13. Re: JBPM. Skip task (not work timer)
                                  Maciej Swiderski Master

                                  looks like some inconsistencies in db. Would it be possible to drop data base and recreate it once again? I believe that after adding new entries in the persistence.xml db is not updated for it. What value do you use for hibernate auto ddl property in persistence.xml?

                                   

                                  HTH

                                  • 14. Re: JBPM. Skip task (not work timer)
                                    Vladimir Belyakof Newbie

                                    Thank you so much for your help! Removing old database has really helped. The timer is now actually works properly. True, after rebooting the server, it behaves a little strange. Tasks are in the list remain active, but the transition is not carried out on them. After first start of the process, they disappear.