7 Replies Latest reply on May 31, 2016 2:25 PM by imphilippesimo

    How to use JBPM6 with eclipse link?

    buenavida

      Eclipse link requires the annotation "temporal" for date attributes in a mapping class. The models in JBPM6 don't use this annotation for their date properties.

      Can't I use JBPM6 in combination with eclipse link?

        • 1. Re: How to use JBPM6 with eclipse link?
          salaboy21

          Hi Andreas,

          Can you please post the errors of the offending classes so I can take a look on them?

           

          Cheers

          • 2. Re: How to use JBPM6 with eclipse link?
            buenavida

            Hallo Mauricio!

             

            The class SessionInfo is affected for example. EclipseLink throws the following exception.

             

            Internal Exception: Exception [EclipseLink-7212] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.ValidationException

            Exception Description: The attribute [startDate] from the entity class [class org.drools.persistence.info.SessionInfo] does not specify a temporal type. A temporal type must be specified for persistent fields or properties of type java.util.Date and java.util.Calendar.

             

            This exception is thrown for all mapping classes which contains an attribute of type date, time or timestamp, because EclipseLink requires the @Temporal annotation for this types.

             

            Greetings

            Andi

            • 3. Re: How to use JBPM6 with eclipse link?
              swiderski.maciej

              Alternatively you could provide orm.xml files to add/override anything on the jBPM entities that EclipseLink requires.

               

              HTH

              • 4. Re: How to use JBPM6 with eclipse link?
                buenavida

                Is there anybody who has overridden the JBPM6 mapping classes for eclipse link usage?

                 

                I currently work on it but I have problems with the embeddable objects, e.g. DelegationImpl.

                 

                If I include DelegationImpl like

                     <embeddable class="org.jbpm.services.task.impl.model.DelegationImpl" />

                 

                I get the exception

                Caused by: java.util.NoSuchElementException

                  at java.util.ArrayList$Itr.next(Unknown Source)

                  at org.eclipse.persistence.internal.jpa.metadata.MetadataDescriptor.getPrimaryKeyField(MetadataDescriptor.java:1040)

                  at org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.getReferencedField(MetadataAccessor.java:434)

                  at org.eclipse.persistence.internal.jpa.metadata.accessors.MetadataAccessor.getReferencedField(MetadataAccessor.java:422)

                • 5. Re: How to use JBPM6 with eclipse link?
                  buenavida

                  I found the issue already. The problem was that the embeddable object was not embedded by an entity.

                  In my case this means that TaskImpl was missing in my mapping file. After adding TaskImpl which embeds

                  DelegationImpl the exception was not thrown any more.

                  • 6. Re: How to use JBPM6 with eclipse link?
                    salaboy21

                    Hi Andreas,

                    It is really good to hear that you get it working. It will be really nice if you can write a wiki about what did you do, so other users can use that as reference if they want to use Eclipse Link as well. If you have a personal blog you can do create an article there or just use the Wiki features of the forums that will be awesome.

                     

                    Regards

                    • 7. Re: How to use JBPM6 with eclipse link?
                      imphilippesimo

                      Hi Andreas,

                      i'm very glad that someone has succeeded in configuring jPBM with EclipseLink, so i will be very thankful i you can post how you managed to come across this.

                      Thanks