Interface IProcessStartEventBeanRuntime
-
public interface IProcessStartEventBeanRuntime
Process start event bean runtime gives an event bean access to its environment- Since:
- 19.01.2007
- API:
- This is a public API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ISession
createSession()
Creates a new anonymous session.ISession
createSession(String userName, String password)
Creates a new session and authenticates/logs in the user with the given user name and password.void
destroySession(ISession session)
Destroys the given session.<T> T
executeAsSystem(Callable<T> callable)
Executes the code of theCallable.call()
method in the context of the ivy System security session.IProcessStartEventResponse
fireProcessStartEventRequest(ISession session, String firingReason, Map<String,Object> requestParameters)
Fires a start event request to the process engine.IProcessModelVersion
getProcessModelVersion()
Gets the process model version the process start event bean is associated toIProcessStart
getProcessStart()
Gets the start of the process from which cases are started when the process start event bean fires an event.Logger
getRuntimeLogLogger()
Gets a runtime log logger interface.IServerExtension
getServerExtension(String serverExtensionIdentifier)
Gets the server extension with the given server extension identifier.void
setPollTimeInterval(long timeInterval)
Sets the time interval the poll method of the process start event bean is called.
-
-
-
Method Detail
-
createSession
ISession createSession(String userName, String password) throws AuthenticationException, PersistencyException
Creates a new session and authenticates/logs in the user with the given user name and password.The created session can be used to fire events (see
fireProcessStartEventRequest(ISession, String, Map)
. The processes started by the events are executed in the context of the given session.The session must be destroyed by the event bean if it is no longer needed by calling the method
destroySession(ISession)
.- Parameters:
userName
- Name of the user the events should act aspassword
- Password of the user- Returns:
- session
- Throws:
PersistencyException
- if persistency access failsAuthenticationException
- if user cannot be authorized- See Also:
createSession()
- API:
- This public API is available in Java.
-
createSession
ISession createSession() throws AuthenticationException, PersistencyException
Creates a new anonymous session. The event bean can use the methodsISession.authenticateSessionUser(String, ch.ivyteam.security.Password)
orISession.authenticateSessionUser(ch.ivyteam.ivy.security.IUser, String)
to authenticate/log in a user if necessary.The created session can be used to fire events (see
fireProcessStartEventRequest(ISession, String, Map)
. The processes started by the events are executed in the context of the given session.The session must be destroyed by the event bean if it is no longer needed by calling the method
destroySession(ISession)
.- Returns:
- session
- Throws:
PersistencyException
- if persistency access failsAuthenticationException
- if user cannot be authorized- See Also:
createSession(String, String)
- API:
- This public API is available in Java.
-
destroySession
void destroySession(ISession session) throws PersistencyException
Destroys the given session.- Parameters:
session
- the session to destroy- Throws:
PersistencyException
- if persistency access fails- See Also:
createSession()
,createSession(String, String)
- API:
- This public API is available in Java.
-
fireProcessStartEventRequest
IProcessStartEventResponse fireProcessStartEventRequest(ISession session, String firingReason, Map<String,Object> requestParameters) throws RequestException
Fires a start event request to the process engine. The process engine will start the process that belongs to the start event element this bean was configured on and will execute the first task of it. If no Exception is thrown by the method the process has been started successfully (e.g. the first task of the process was executed successfully).
The process will be started in the context of the given session. If no session is provided the process will be started in the context of the system user session. Use the method
createSession()
orcreateSession(String, String)
to create sessions and authenticate users to the session.- Parameters:
session
- session in which the request is handled. Can be null if no session is neededfiringReason
- the reason why the event bean firesrequestParameters
- Map with the request parameters. The values are associated to the process data if there is a field in the data that has the same name as the key.- Returns:
- the response
- Throws:
RequestException
- if request fails- API:
- This public API is available in Java.
-
getRuntimeLogLogger
Logger getRuntimeLogLogger()
Gets a runtime log logger interface. With that interface a event bean can log information to the runtime log- Returns:
- runtime log logger interface
- API:
- This public API is available in Java.
-
getProcessModelVersion
IProcessModelVersion getProcessModelVersion()
Gets the process model version the process start event bean is associated to- Returns:
- process model version
- API:
- This public API is available in Java.
-
getProcessStart
IProcessStart getProcessStart()
Gets the start of the process from which cases are started when the process start event bean fires an event.- Returns:
- process start
- API:
- This public API is available in Java.
-
setPollTimeInterval
void setPollTimeInterval(long timeInterval)
Sets the time interval the poll method of the process start event bean is called. If the paramater timeInterval is 0 or smaller the poll method will never be called.- Parameters:
timeInterval
- the time interval in milli seconds- API:
- This public API is available in Java.
-
executeAsSystem
<T> T executeAsSystem(Callable<T> callable) throws Exception
Executes the code of theCallable.call()
method in the context of the ivy System security session. If you like to call ivy API methods from your own threads you have to put your code in aCallable
and execute it by calling this method otherwise you get security exceptions when calling the API methods.- Type Parameters:
T
- the type of the result- Parameters:
callable
- the callable to execute in the context of the ivy System security session.- Returns:
- result of the callable
- Throws:
Exception
- if the callable throws an exception- API:
- This public API is available in Java.
-
getServerExtension
IServerExtension getServerExtension(String serverExtensionIdentifier)
Gets the server extension with the given server extension identifier. For more information about server extensions seeIServerExtension
- Parameters:
serverExtensionIdentifier
- the server extension identifier- Returns:
- server extension identifier or null if no server extension is installed with the given identifier.
- API:
- This public API is available in Java.
-
-