1 package hero.entity; 2 3 import hero.interfaces.BnNodeLightValue; 4 import hero.interfaces.BnNodePK; 5 import hero.interfaces.BnNodeValue; 6 import hero.interfaces.BnProjectLocal; 7 import hero.interfaces.BnNodePerformerAssignLocal; 8 import hero.interfaces.BnRoleLocal; 9 import hero.interfaces.BnUserLocal; 10 import hero.interfaces.InvalidValueException; 11 import hero.util.BonitaServiceLocator; 12 import hero.util.BonitaServiceException; 13 14 import java.util.ArrayList ; 15 import java.util.Date ; 16 import java.util.Collection ; 17 18 import javax.ejb.CreateException ; 19 import javax.ejb.EJBException ; 20 import javax.ejb.EntityBean ; 21 import javax.ejb.EntityContext ; 22 import javax.ejb.RemoveException ; 23 24 231 public abstract class BnNodeBean 232 implements EntityBean 233 { 234 235 239 public EntityContext mContext; 240 241 245 246 250 267 public abstract String getId(); 268 269 275 public abstract void setId( String pId ); 276 277 289 public abstract int getType(); 290 291 298 public abstract void setType( int pType ); 299 300 312 public abstract int getState(); 313 314 321 public abstract void setState( int pState ); 322 323 335 public abstract boolean getAnticipable(); 336 337 344 public abstract void setAnticipable( boolean pAnticipable); 345 346 358 public abstract String getName(); 359 360 366 public abstract void setName( String pName ); 367 368 380 public abstract String getDescription(); 381 382 389 public abstract void setDescription( String pDescription ); 390 391 403 public abstract String getActivityPerformer(); 404 405 412 public abstract void setActivityPerformer( String pActivityPerformer ); 413 414 415 425 public abstract NodeState getTransition(); 426 427 434 public abstract void setTransition( NodeState transition ); 435 436 437 447 public abstract EdgeState getActivation(); 448 449 456 public abstract void setActivation( EdgeState activation ); 457 458 470 public abstract Date getStartDate(); 471 472 479 public abstract void setStartDate( Date pStartDate ); 480 481 493 public abstract Date getEndDate(); 494 495 502 public abstract void setEndDate( Date pEndDate ); 503 504 516 public abstract Collection getDeadlines(); 517 518 525 public abstract void setDeadlines( Collection pDeadlines ); 526 527 539 public abstract Collection getRelativeDeadlines(); 540 541 548 public abstract void setRelativeDeadlines( Collection pDeadlines ); 549 550 551 561 public abstract String getCreator(); 562 563 570 public abstract void setCreator( String pCreator ); 571 572 582 583 public abstract String getExecutor(); 584 585 592 public abstract void setExecutor( String pExecutor ); 593 594 607 public abstract BnRoleLocal getBnRole(); 608 609 616 public abstract void setBnRole(BnRoleLocal role); 617 618 630 public abstract BnNodePerformerAssignLocal getBnNodePerformerAssign() ; 631 632 638 public abstract void setBnNodePerformerAssign( BnNodePerformerAssignLocal pPerformerAssign); 639 640 653 public abstract BnProjectLocal getBnProject(); 654 655 662 public abstract void setBnProject(BnProjectLocal pProject); 663 664 673 public abstract Collection getOutBnEdges(); 674 675 681 public abstract void setOutBnEdges(Collection pEdges); 682 683 692 public abstract Collection getInBnEdges(); 693 694 701 public abstract void setInBnEdges(Collection pEdges); 702 703 712 public abstract Collection getInBnAgentEdges(); 713 714 720 public abstract void setInBnAgentEdges(Collection pAgentEdges); 721 722 731 public abstract Date getCreationDate(); 732 733 739 public abstract void setCreationDate(Date pDate); 740 741 758 public abstract Collection getBnProperties(); 759 760 766 public abstract void setBnProperties(Collection pPrp); 767 768 785 public abstract Collection getBnHooks(); 786 787 793 public abstract void setBnHooks(Collection pHook); 794 795 796 813 public abstract Collection getBnInterHooks(); 814 815 821 public abstract void setBnInterHooks(Collection pHook); 822 823 827 public abstract BnNodeValue getBnNodeValue(); 828 829 833 public abstract void setBnNodeValue(BnNodeValue v); 834 835 839 public abstract BnNodeLightValue getBnNodeLightValue(); 840 841 845 public abstract void setBnNodeLightValue(BnNodeLightValue v); 846 847 848 853 public boolean isExecuting() { 854 return (this.getState()==hero.interfaces.Constants.Nd.EXECUTING || 855 this.getState()==hero.interfaces.Constants.Nd.ANTICIPATING); 856 } 857 858 863 public boolean isTerminated() { 864 return (this.getState()==hero.interfaces.Constants.Nd.TERMINATED || 865 this.getState()==hero.interfaces.Constants.Nd.FINISHED); 866 } 867 868 873 public boolean isCancelled() { 874 return (this.getState()==hero.interfaces.Constants.Nd.DEAD); 875 } 876 877 878 879 883 898 public BnNodePK ejbCreate(BnNodeValue nd ) 899 throws 900 InvalidValueException, 901 EJBException , 902 CreateException 903 { 904 setBnNodeValue(nd); 905 try { 906 BonitaServiceLocator serviceLocator = BonitaServiceLocator.getInstance(); 907 this.setId(hero.interfaces.BnNodeUtil.generateGUID(this)); 908 this.setDeadlines(new ArrayList ()); 909 this.setRelativeDeadlines(new ArrayList ()); 910 911 } catch (BonitaServiceException e) { 912 throw new CreateException (e.getMessage()); 913 } 914 return null; 916 } 917 918 933 public BnNodePK ejbCreate(String name, int type ) 934 throws 935 InvalidValueException, 936 EJBException , 937 CreateException 938 { 939 this.setName(name); 940 this.setType(type); 941 this.setState(hero.interfaces.Constants.Nd.READY); 942 this.setAnticipable(true); 943 this.setTransition(NodeState.make(type,true)); 944 this.setActivation(EdgeState.make(type)); 945 this.setDeadlines(new ArrayList ()); 946 this.setRelativeDeadlines(new ArrayList ()); 947 this.setId(hero.interfaces.BnNodeUtil.generateGUID(this)); 948 949 return null; 951 } 952 953 public void setEntityContext( EntityContext lContext ) 954 { 955 mContext = lContext; 956 } 957 958 public void unsetEntityContext() 959 { 960 mContext = null; 961 } 962 963 public void ejbActivate() 964 { 965 } 966 967 public void ejbPassivate() 968 { 969 } 970 971 public void ejbLoad() 972 { 973 } 974 975 public void ejbStore() 976 { 977 } 978 979 public void ejbRemove() 980 throws 981 RemoveException 982 { 983 } 984 985 } 986 | Popular Tags |