JBoss Community

Cannot instantiate abstract class or interface

created by dearest555 in jBPM - View the full discussion

  Hi,

 

I 'm newbie in JBPM. I try to do assign handler but I got an error message.

 

 

Caused by: org.hibernate.InstantiationException

 

 

Cannot instantiate abstract class or interface: com.mmm.workflow.bom.Document

 

-file : process.jpdl.xml

 

 

 

 

package com.dear.workflow.task.assigment;

import org.apache.commons.lang.StringUtils;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.task.Assignable;

import com.dear.common.bom.Employee;
import com.dear.workflow.bom.Document;
import com.trg.search.Search;

public class AssignByOrganization extends AssignmentBase {

  public static String ORGANIZATION_TYPE_SUPERVISOR = "supervisor";
  public static String ORGANIZATION_TYPE_DIVMGR = "divmgr";
  public static String ORGANIZATION_TYPE_DEPTMGR = "deptmgr";

  String type;
/* (non-Javadoc)
  * @see org.jbpm.api.task.AssignmentHandler#assign(org.jbpm.api.task.Assignable, org.jbpm.api.model.OpenExecution)
  */
public void assign(Assignable assignable, OpenExecution execution)
   throws Exception {
  String docRefId = (String)execution.getVariable("docRefId");
  Search search = new Search(Document.class);
  search.addFilterEqual("docRefId", docRefId);
  Document document = (Document)generalDAO.searchUnique(search);
  //Document document = (Document)execution.getVariable("document");
  Employee author = generalDAO.find(Employee.class, StringUtils.rightPad(document.getAuthor().getEmployeeId(), 10, " ").toUpperCase() ).getSupervisor();
  //generalDAO.refresh(author);
  if(author != null)
  {
   if(type.equals(ORGANIZATION_TYPE_SUPERVISOR))
    assignable.setAssignee(author.getSupervisor().getEmployeeId());
   if(type.equals(ORGANIZATION_TYPE_DIVMGR))
    assignable.setAssignee(author.getDivisionManager().getEmployeeId());
   if(type.equals(ORGANIZATION_TYPE_DEPTMGR))
    assignable.setAssignee(author.getDepartmentManager().getEmployeeId());  
  }
 

}

}



#

 

 

 

 

 

 

 

 

 

 

<

task g="186,155,123,52" name="Supervisor Review"

>

<assignment-handler auto-wire="true" class="com.dear.workflow.task.assigment.AssignByOrganization"

>

<field name="type"

>

<string value="supervisor"

/>

</field>

 

</assignment-handler

>

<notification/>

 

<!--

<reminder duedate="2 minutes" repeat="10 seconds"/>

-->

<transition g="464,134:-36,-18" name="deny" to="notify deny"

/>

<transition g="5,-16" name="approve" to="Finance Review"

/>

</task

>

-

Reply to this message by going to Community

Start a new discussion in jBPM at Community