3 Replies Latest reply on Sep 1, 2006 9:50 AM by Yonghong Luo

    About task consignable

    Yonghong Luo Newbie

      I used the jbpm as workflow engine in my project,but I find it don't offer the features what I needed,such as task consignable. task transfer etc.,
      1.Task consignable
      when a actor can't handle his task(example be on bussiness trip),he can consign the task to other actor.
      2.Task Transfer
      when a company reorgnized,transfer a actor's all task to other actor.
      Is it requires that I implement it and how to do?
      thanks!

        • 1. Re: About task consignable(my implement)
          Yonghong Luo Newbie

          --add a table,record the information about task consign.
          CREATE TABLE JBPM_EXT_CONSIGN
          (
          CONSIGN_ID NUMBER(20) NOT NULL,
          CONSIGNER_ID NUMBER(20) NOT NULL,
          CONSIGNEE_ID NUMBER(20) NOT NULL,
          START_DATE DATE NOT NULL,
          END_DATE DATE NOT NULL,
          DEFINITION_ID NUMBER(20) NOT NULL,
          STATUS NUMBER(1) DEFAULT 1 NOT NULL,
          NOTE VARCHAR2(4000 BYTE)
          )

          package com.tf.canna.jbpm.bean;

          import java.io.Serializable;

          /**
          * A class that represents a row in the JBPM_EXT_CONSIGN table. ??????????
          *
          * @hibernate.class
          */
          public class Consign implements Serializable {

          /**
          * The value of the consignId association.
          *
          * @hibernate.property length="20"
          * @return long
          *
          */
          private long consignId;

          /**
          * The value of the consignerId association.
          *
          * @hibernate.property length="20"
          * @return long
          *
          */
          private long consignerId;

          private String consignerName;

          /**
          * The value of the consigneeId association.
          *
          * @hibernate.property length="20"
          * @return long
          *
          */
          private long consigneeId;

          private String consigneeName;

          /**
          * The value of the startDate association.
          *
          * @hibernate.property length="0"
          * @return java.util.Date
          *
          */
          private java.util.Date startDate;

          /**
          * The value of the endDate association.
          *
          * @hibernate.property length="0"
          * @return java.util.Date
          *
          */
          private java.util.Date endDate;

          /**
          * The value of the definitionId association.
          *
          * @hibernate.property length="20"
          * @return long
          *
          */
          private long definitionId;

          private ProcessDefinitionBean processDefinition;

          private int status;

          /**
          * default constructor
          */
          public Consign() {
          }

          /**
          * Return the value of the consign_id column.
          *
          * @return long
          */
          public long getConsignId() {
          return consignId;
          }

          /**
          * Set the value of the consign_id column.
          *
          * @param consignId
          */
          public void setConsignId(long newConsignId) {
          this.consignId = newConsignId;
          }

          /**
          * Return the value of the consigner_id column.
          *
          * @return long
          */
          public long getConsignerId() {
          return consignerId;
          }

          /**
          * Set the value of the consigner_id column.
          *
          * @param consignerId
          */
          public void setConsignerId(long newConsignerId) {
          this.consignerId = newConsignerId;
          }

          /**
          * Return the value of the consignee_id column.
          *
          * @return long
          */
          public long getConsigneeId() {
          return consigneeId;
          }

          /**
          * Set the value of the consignee_id column.
          *
          * @param consigneeId
          */
          public void setConsigneeId(long newConsigneeId) {
          this.consigneeId = newConsigneeId;
          }

          /**
          * Return the value of the start_date column.
          *
          * @return java.util.Date
          */
          public java.util.Date getStartDate() {
          return startDate;
          }

          /**
          * Set the value of the start_date column.
          *
          * @param startDate
          */
          public void setStartDate(java.util.Date newStartDate) {
          this.startDate = newStartDate;
          }

          /**
          * Return the value of the end_date column.
          *
          * @return java.util.Date
          */
          public java.util.Date getEndDate() {
          return endDate;
          }

          /**
          * Set the value of the end_date column.
          *
          * @param endDate
          */
          public void setEndDate(java.util.Date newEndDate) {
          this.endDate = newEndDate;
          }

          /**
          * Return the value of the definition_id column.
          *
          * @return long
          */
          public long getDefinitionId() {
          return definitionId;
          }

          /**
          * Set the value of the definition_id column.
          *
          * @param definitionId
          */
          public void setDefinitionId(long newDefinitionId) {
          this.definitionId = newDefinitionId;
          }

          /**
          * Implementation of the equals comparison on the basis of equality of the
          * primary key values.
          *
          * @param other
          * @return boolean
          */
          public boolean equals(Object other) {
          if (this == other) {
          return true;
          }

          if (other != null && other instanceof Consign) {
          Consign castOther = (Consign) other;
          return castOther.getConsignId() == consignId;
          }
          return false;
          }

          /**
          * Implementation of the hashCode method conforming to the Bloch pattern
          * with the exception of array properties (these are very unlikely primary
          * key types).
          *
          * @return int
          */
          public int hashCode() {
          int result = 17;
          result = result * 37 + (new Long(this.consignId)).hashCode();

          return result;
          }

          public String getConsigneeName() {
          return consigneeName;
          }

          public void setConsigneeName(String consigneeName) {
          this.consigneeName = consigneeName;
          }

          public String getConsignerName() {
          return consignerName;
          }

          public void setConsignerName(String consignerName) {
          this.consignerName = consignerName;
          }

          public ProcessDefinitionBean getProcessDefinition() {
          return processDefinition;
          }

          public void setProcessDefinition(ProcessDefinitionBean processDefinition) {
          this.processDefinition = processDefinition;
          }

          public int getStatus() {
          return status;
          }

          public void setStatus(int status) {
          this.status = status;
          }

          public String toString() {
          StringBuffer sb = new StringBuffer(getClass().getName());
          sb.append(this.consignId);
          return sb.toString();
          }
          }


          <?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 package="com.tf.canna.jbpm.bean">



          s_consign



          <property name="consignerId" type="long" column="consigner_id" not-null="true" />
          <property name="consigneeId" type="long" column="consignee_id" not-null="true" />
          <property name="startDate" type="java.util.Date" column="start_date" not-null="true" />
          <property name="endDate" type="java.util.Date" column="end_date" not-null="true" />
          <property name="definitionId" type="long" column="definition_id" not-null="true" />


          <![CDATA[FROM Consign as consign]]>

          </hibernate-mapping>

          • 2. Re: About task consignable
            Ronald van Kuijk Master

            consign == assign to someone else, jbpm has an assign method in the api, so this is possible. I do not see a need for another table etc....

            task transfer == bulk reassign == loop over all tasks and reassign.

            So jBPM supports all you need afaik

            • 3. Re: About task consignable
              Yonghong Luo Newbie

              Thanks for your reply.
              May be what I say isn't enough clear,Sorry for my poor english!
              task transfer == bulk reassign == loop over all tasks and reassign.
              I quite agree with this point ?
              for consign,I think consign!=assign to someone else,JBPM has an assign method in the api,but it change the original actor to new actor,I don't want to change the original task actor?For example, at a actor be on business trip, temporarily entrust his task to other person.