30 RecordTimeWorkflowSessionBean { /** Answers a reference to the newly created Activity bean. */ public RecordTimeWorkflow create(String username) throws RemoteException, CreateException; } is the implementation class for the RecordTimeWorkflow session bean. Most of this code should be somewhere between familiar and monotonous, by this point. However, there is one new wrinkle, as the ejbCreate method finds a User entity bean based on the username parameter. This bean reference is kept for the duration of the stateful session. The RecordTimeWorkflow session bean wraps the data for a timecard into a custom TimecardDTO object. package ; import import import import import import import import. | 30 RecordTimeWorkflowSessionBean Answers a reference to the newly created Activity bean. public RecordTimeWorkflow create String username throws RemoteException CreateException is the implementation class for the RecordTimeWorkflow session bean. Most of this code should be somewhere between familiar and monotonous by this point. However there is one new wrinkle as the ejbCreate method finds a User entity bean based on the username parameter. This bean reference is kept for the duration of the stateful session. The RecordTimeWorkflow session bean wraps the data for a timecard into a custom TimecardDTO object. package import . import . import . import import . import . import . import . import . The RecordTimeWorkflow allows client objects to record their time. RecordTimeWorkflowBean is the actual session bean implementation. public class RecordTimeWorkflowBean extends BasicSessionBean private UserLocal user public void ejbCreate String username throws CreateException try creating RecordTimeWorkflowBean with user - n username Context initialContext getInitialContext UserLocalHome userHome UserLocalHome EjbReferenceNames. n USER_HOME Collection users username Iterator userIterator RecordTimeWorkflowSessionBean 31 if UserLocal done creating RecordTimeWorkflowBean with user - username catch NamingException e throw new CreateException User Bean Not Found catch FinderException e throw new CreateException User username Not Found public void ejbPostCreate String username .