[jboss-user] [JBoss jBPM] - Re: Duplication of processDefinition

npe do-not-reply at jboss.com
Wed Apr 23 10:53:55 EDT 2008


Hi,

Thanks for the reply. I didn't know about deep copy and all this stuff so I had a look at it. I tried to use this library : http://sourceforge.net/projects/beanlib/
in order to create a process Definition copy. 

Then, I bumped into a problem quite unexpected : 
In process definition there are two setters for startState : 

  |   public void setStartState(Node startState) {
  |     this.startState = startState;
  |   }
  | 
and 

  |   public void setStartState(StartState startState) {
  |     if ( (this.startState!=startState)
  |          && (this.startState!=null) ){
  |       removeNode(this.startState);
  |     }
  |     this.startState = startState;
  |     if (startState!=null) {
  |       addNode(startState);
  |     }
  |   }
  | 

The thing is that the getStartState returns a node (actually I really don't understand why a node and not a StartState and why the startState property is a node and not a StartState as well... ) and so processDefinition is not exactly a bean and the library I tried to use fail to copy because it tries to do : 


  | newObject.setStartState(oldObject.getStartState()); 
  | 
with the method taking a startState.


I am really wondering what are the technical reasons of such a thing.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146215#4146215

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4146215



More information about the jboss-user mailing list