[jboss-jira] [JBoss JIRA] Resolved: (JBPM-945) Miss MailAction hibernate mapping file!

Ronald van Kuijk (JIRA) jira-events at lists.jboss.org
Tue Apr 10 03:30:58 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBPM-945?page=all ]

Ronald van Kuijk resolved JBPM-945.
-----------------------------------

    Resolution: Duplicate Issue

Duplicate of JBPM-929

> Miss MailAction hibernate mapping file!
> ---------------------------------------
>
>                 Key: JBPM-945
>                 URL: http://jira.jboss.com/jira/browse/JBPM-945
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2
>         Environment: Windows XP SP2
> Java JDK 1.5.0_10
> Eclipse 3.2.1
>            Reporter: David Chan
>         Assigned To: Tom Baeyens
>
> A process definition contains a node with type 'mail' like below:
> <?xml version="1.0" encoding="UTF-8"?>
> <process-definition
>   xmlns="urn:jbpm.org:jpdl-3.2"  name="mail">
>    <start-state name="start">
>       <transition name="a" to="task1">
>       	<mail name="starter" actors="ws" subject="TT" text="NN"></mail>
>       </transition>
>    </start-state>
>    <end-state name="end1"></end-state>
>    <task-node name="task1">
>       <task name="task1"></task>
>       <transition name="b" to="end1"></transition>
>    </task-node>
> </process-definition>
> when I  use JBPMContext to store the definition into DB,  an exception will be thrown:
> aused by: org.hibernate.HibernateException: instance not of expected entity type: org.jbpm.graph.action.MailAction is not a: org.jbpm.graph.def.Action
> It's very clear that Hibernate can't know how to persist the class 'org.jbpm.graph.action.MailAction', in other words, there's no mapping file against to this class. So I created this file 'MailAction.hbm.xml', the content is very simple:
> <?xml version="1.0"?>
> <!DOCTYPE hibernate-mapping PUBLIC
> 	"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
> 	"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
> <hibernate-mapping default-access="field">
>   <subclass name="org.jbpm.graph.action.MailAction" extends="org.jbpm.graph.def.Action" discriminator-value="M"/>
> </hibernate-mapping>
> open the Hibernate configuration file and insert the mapping entry of MailAction.
> .....
> <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/>
> .....
> now run the process again, there's no problem!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list