001: /*
002: * Copyright (c) 2002-2003 by OpenSymphony
003: * All rights reserved.
004: */
005: package com.opensymphony.workflow.spi.ejb;
006:
007: import com.opensymphony.ejb.ExceptionlessEntityAdapter;
008:
009: import javax.ejb.CreateException;
010:
011: /**
012: * EJB implementation for workflow entries.
013: *
014: * @ejb.bean
015: * type="CMP"
016: * view-type="local"
017: * name="WorkflowEntry"
018: * reentrant="False"
019: * schema="WorkflowEntry"
020: * primkey-field="id"
021: *
022: * @ejb.pk class="java.lang.Long" extends="java.lang.Object"
023: *
024: * @ejb.persistence table-name="OS_WFENTRY"
025: *
026: * @ejb.home local-extends="javax.ejb.EJBLocalHome"
027: *
028: * @ejb.interface local-extends="javax.ejb.EJBLocalObject"
029: *
030: * @ejb.ejb-external-ref
031: * ref-name="ejb/SequenceGenerator"
032: * type="Session"
033: * view-type="remote"
034: * link="SequenceGenerator"
035: * home="com.opensymphony.module.sequence.SequenceGeneratorHome"
036: * business="com.opensymphony.module.sequence.SequenceGenerator"
037: *
038: * @ejb.env-entry
039: * name="sequenceName"
040: * type="java.lang.String"
041: * value="WorkflowEntryEJB"
042: *
043: * @ejb.permission unchecked="true"
044: * @ejb.transaction type="Supports"
045: *
046: * @author <a href="mailto:hani@formicary.net">Hani Suleiman</a>
047: * @author <a href="mailto:plightbo@hotmail.com">Pat Lightbody</a>
048: */
049: public abstract class WorkflowEntryEJB extends
050: ExceptionlessEntityAdapter {
051: //~ Methods ////////////////////////////////////////////////////////////////
052:
053: public abstract void setId(Long id);
054:
055: /**
056: * @ejb.pk-field
057: * @ejb.interface-method
058: * @ejb.persistence column-name="ID"
059: */
060: public abstract Long getId();
061:
062: /**
063: * @ejb.interface-method
064: */
065: public abstract void setState(int state);
066:
067: /**
068: * @ejb.interface-method
069: * @ejb.persistence column-name="STATE"
070: */
071: public abstract int getState();
072:
073: public abstract void setWorkflowName(String workflowName);
074:
075: /**
076: * @ejb.interface-method
077: * @ejb.persistence column-name="NAME"
078: */
079: public abstract String getWorkflowName();
080:
081: /**
082: * @ejb.create-method
083: */
084: public Long ejbCreate(String workflowName) throws CreateException {
085: try {
086: Long id = new Long(nextLong());
087: setId(id);
088: setWorkflowName(workflowName);
089: setState(0);
090:
091: return null;
092: } catch (Exception e) {
093: throw new CreateException(e.getMessage());
094: }
095: }
096:
097: public void ejbPostCreate(String workflowName)
098: throws CreateException {
099: }
100: }
|