|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.netscape.pm.model.HistoryEventFactory
Creates a history event object, used to record historical information about
the progress of a process instance. History events that are created from
this factory class are not automatically logged; events must be bound to
a process instance in order to be logged properly. The method
off the addHistoryEventIProcessInstance interface must be used for this
purpose.
public void doGet( HttpServletRequest req, HttpServletResponse res )
throws ServletException, IOException
{
res.setContentType( "text/html; charset=ISO-8859-4" );
javax.naming.Context cxt = new javax.naming.InitialContext();
String jndiName = "java:comp/env/" + IPMApplication.DEFAULT_JNDI_ROOT
+ "/" + localName;
IPMApplicationHome home = (IPMApplicationHome) cxt.lookup( jndiName );
IPMApplication app = home.create();
long instanceId = Long.parseLong( req.getParameter(
IUIParameters.INSTANCE_ID ) );
String forkId = req.getParameter( IUIParameters.FORK_ID );
String nodeName = req.getParameter( IUIParameters.NODE_NAME );
IWorkItemPK pk = WorkItemPKFactory.create( instanceId,
forkId,
nodeName );
pk.setEditable( true );
IWorkItem wi = app.findWorkItem( pk );
IProcessInstance pi = wi.getProcessInstance();
IHistoryEvent he = HistoryEventFactory.create( wi, IHistoryEvent.LOG,
"a log message",
"a log comment" );
pi.addHistoryEvent( he );
pi.setData( "name", req.getParameter( "name" ) );
wi.save();
wi.release( true );
res.getWriter().flush();
res.getWriter().close();
}
IHistoryEvent| Constructor Summary | |
HistoryEventFactory()
|
|
| Method Summary | |
static IHistoryEvent |
create(IWorkItem wi)
Creates an instance of a history event from the given work item. |
static IHistoryEvent |
create(IWorkItem wi,
int eventType)
Creates an instance of a history event from the given work item and event type. |
static IHistoryEvent |
create(IWorkItem wi,
int eventType,
java.lang.String eventId)
Creates an instance of a history event from the given work item, event type and event id. |
static IHistoryEvent |
create(IWorkItem wi,
int eventType,
java.lang.String eventId,
java.lang.String comment)
Creates an instance of a history event from the given work item, event type, event id, and comment string. |
static IHistoryEvent |
create(IWorkItem wi,
java.lang.String eventId,
java.lang.String comment)
Creates an instance of a history event from the given work item, event id, and comment string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HistoryEventFactory()
| Method Detail |
public static IHistoryEvent create(IWorkItem wi)
throws PMException
USER_ACTION, and the event id set to the value
of the work item's conclusion.
Once a history event has been created, its properties cannot be
modified; hence if the developer wants to modify the event id or
comment logged in the history log, one of the other
create methods should be used.
wi - the current work itemPMException - if there is a problem retrieving the process
instance associated with the given work item.IHistoryEvent.USER_ACTION,
IWorkItem
public static IHistoryEvent create(IWorkItem wi,
int eventType)
throws PMException
conclusion.
Once a history event has been created, its properties cannot be
modified; hence if the developer wants to modify the event id or
comment logged in the history log, one of the other
create methods should be used.
wi - the current work itemeventType - the event type of the history eventPMException - if there is a problem retrieving the process
instance associated with the given work item.IHistoryEvent.USER_ACTION,
IHistoryEvent.AUTOMATED_STEP,
IHistoryEvent.MANAGEMENT_EVENT,
IHistoryEvent.EXCEPTION_EVENT,
IWorkItem
public static IHistoryEvent create(IWorkItem wi,
int eventType,
java.lang.String eventId)
throws PMException
Once a history event has been created, its properties cannot be
modified; hence if the developer wants to modify the event comment
logged in the history log, one of the other create
methods should be used.
wi - the current work itemeventType - the event type of the history eventeventId - the event id of the history eventPMException - if there is a problem retrieving the process
instance associated with the given work item.IHistoryEvent.USER_ACTION,
IHistoryEvent.AUTOMATED_STEP,
IHistoryEvent.MANAGEMENT_EVENT,
IHistoryEvent.EXCEPTION_EVENT,
IHistoryEvent.getEventId(),
IWorkItem
public static IHistoryEvent create(IWorkItem wi,
java.lang.String eventId,
java.lang.String comment)
throws PMException
LOG.
Once a history event has been created, its properties cannot be
modified; hence if the developer wants to modify the event type
of the history event, one of the other create methods
should be used.
wi - the current work itemeventId - the event id of the history eventcomment - the history comment stringPMException - if there is a problem retrieving the process
instance associated with the given work item.IHistoryEvent.LOG,
IWorkItem
public static IHistoryEvent create(IWorkItem wi,
int eventType,
java.lang.String eventId,
java.lang.String comment)
throws PMException
wi - the current work itemeventType - the event type of the history eventeventId - the event id of the history eventcomment - the history comment stringPMException - if there is a problem retrieving the process
instance associated with the given work item.IHistoryEvent.LOG,
IWorkItem
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||