<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Cannot instantiate abstract class or interface
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/dearest555">dearest555</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/640479#640479">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span style="font-size: 10pt;">&#160; Hi,</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt;">I 'm newbie in JBPM. I try to do assign handler but I got an error message.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt;"><p align="left">Caused by: <span style="text-decoration: underline;"><span style="color: #000080; font-size: 10pt; text-decoration: underline;"><span style="color: #000080; font-size: 10pt; text-decoration: underline;">org.hibernate.InstantiationException</span></span></span></p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><span style="font-size: 10pt;">&#160; <p>Cannot instantiate abstract class or interface: com.mmm.workflow.bom.Document</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt;">-file : process.jpdl.xml</span></p></span></span><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>package com.dear.workflow.task.assigment;</p><p>import org.apache.commons.lang.StringUtils;<br/>import org.jbpm.api.model.OpenExecution;<br/>import org.jbpm.api.task.Assignable;</p><p>import com.dear.common.bom.Employee;<br/>import com.dear.workflow.bom.Document;<br/>import com.trg.search.Search;</p><p>public class AssignByOrganization extends AssignmentBase {</p><p>&#160; public static String ORGANIZATION_TYPE_SUPERVISOR = "supervisor";<br/>&#160; public static String ORGANIZATION_TYPE_DIVMGR = "divmgr";<br/>&#160; public static String ORGANIZATION_TYPE_DEPTMGR = "deptmgr";</p><p>&#160; String type;<br/> /* (non-Javadoc)<br/>&#160; * @see org.jbpm.api.task.AssignmentHandler#assign(org.jbpm.api.task.Assignable, org.jbpm.api.model.OpenExecution)<br/>&#160; */<br/> public void assign(Assignable assignable, OpenExecution execution)<br/>&#160;&#160; throws Exception {<br/>&#160; String docRefId = (String)execution.getVariable("docRefId");<br/>&#160; Search search = new Search(Document.class);<br/>&#160; search.addFilterEqual("docRefId", docRefId);<br/>&#160; Document document = (Document)generalDAO.searchUnique(search);<br/>&#160; //Document document = (Document)execution.getVariable("document");<br/>&#160; Employee author = generalDAO.find(Employee.class, StringUtils.rightPad(document.getAuthor().getEmployeeId(), 10, " ").toUpperCase() ).getSupervisor(); <br/>&#160; //generalDAO.refresh(author);<br/>&#160; if(author != null)<br/>&#160; {<br/>&#160;&#160; if(type.equals(ORGANIZATION_TYPE_SUPERVISOR))<br/>&#160;&#160;&#160; assignable.setAssignee(author.getSupervisor().getEmployeeId());<br/>&#160;&#160; if(type.equals(ORGANIZATION_TYPE_DIVMGR))<br/>&#160;&#160;&#160; assignable.setAssignee(author.getDivisionManager().getEmployeeId());<br/>&#160;&#160; if(type.equals(ORGANIZATION_TYPE_DEPTMGR))<br/>&#160;&#160;&#160; assignable.setAssignee(author.getDepartmentManager().getEmployeeId());&#160;&#160; <br/>&#160; }<br/>&#160; </p><p> }<br/> </p><p>}</p><p><span style="color: #000080; font-size: 10pt;"></span></p><p><a class="jive-link-anchor-small">#</a></p></p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><p><span style=": ; color: #008080; font-size: 2;"><p align="left">&lt;</p></span><span style="color: #3f7f7f; font-size: 10pt;">task</span><span style="color: #000000; font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">g</span><span style="color: #000000; font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"186,155,123,52"</em></em><span style="color: #000000; font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="color: #000000; font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"Supervisor Review"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">assignment-handler</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">auto-wire</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"true"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">class</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"com.dear.workflow.task.assigment.AssignByOrganization"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">field</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"type"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">string</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">value</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"supervisor"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">/&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">field</span><span style="color: #008080; font-size: 10pt;">&gt;</span><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-size: 10pt;"> </span>&#160;</p><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">assignment-handler</span><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">notification</span><span style="color: #008080; font-size: 10pt;">/&gt;</span><p align="left" style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-size: 10pt;"> </span>&#160;</p><p align="left"><span style="color: #3f5fbf; font-size: 10pt;"><p align="left"><span style="color: #3f5fbf; font-size: 10pt;">&lt;!--<p align="left">&lt;reminder <span style="text-decoration: underline;">duedate</span>="2 minutes" repeat="10 seconds"/&gt; </p><p align="left">--&gt;</p></span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">transition</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">g</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"464,134:-36,-18"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"deny"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">to</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"notify deny"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">/&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;</span><span style="color: #3f7f7f; font-size: 10pt;">transition</span><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">g</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"5,-16"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">name</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"approve"</em></em><span style="font-size: 10pt;"> </span><span style="color: #7f007f; font-size: 10pt;">to</span><span style="font-size: 10pt;">=</span><em style="color: #2a00ff; font-size: 10pt;"><em style="color: #2a00ff; font-size: 10pt;">"Finance Review"</em></em><p align="left"><span style="color: #008080; font-size: 10pt;"><p align="left"><span style="color: #008080; font-size: 10pt;">/&gt;</span></p></span></p><span style="color: #008080; font-size: 10pt;">&lt;/</span><span style="color: #3f7f7f; font-size: 10pt;">task</span><p><span style="color: #008080; font-size: 10pt;">&gt;</span></p><p><span style="color: #008080;">-</span></p></p></p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/640479#640479">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>