Interface IProcessStarter
Starts the process that belongs to the start event element this bean was configured on and will execute the first task of it.
- Since:
- 11.2
- API:
- This is a public API.
-
Method Summary
Modifier and TypeMethodDescriptionStarts the process in the context of the given session.Starts the process in the context of the given user.start()
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.Same asstart()
but the method will return immediately without executing the process.withParameter
(String name, Object value) The process will be started with the given parameter.withParameters
(Map<String, Object> parameters) The process will be started with the given parameters.withReason
(String startReason) Provide a reason why the process is started.
-
Method Details
-
asSession
Starts the process in the context of the given session.
You can create a session using the method
IProcessStartEventBeanRuntime.createSession()
or IProcessStartEventBeanRuntime#createSession(String, String). Ensure that you destroy the session after you have used it usingIProcessStartEventBeanRuntime.destroySession(ISession)
.If you want to execute the process in the context of a user it is better to use method
asUser(String)
.- Parameters:
session
- session- Returns:
- process starter for further processing
- See Also:
- API:
- This public API is available in Java.
-
asUser
Starts the process in the context of the given user.
This method will create a session and logs the given user into the session. Then starts the process and afterward destroys the session again.
- Parameters:
userName
- name of the user- Returns:
- process starter for further processing
- See Also:
- API:
- This public API is available in Java.
-
withReason
Provide a reason why the process is started. The reason will be visible in the firing statistic
- Parameters:
startReason
- reason why the process is started- Returns:
- process starter for further processing
- See Also:
-
IProcessStartEventBeanFiring.getFiringReason()
- API:
- This public API is available in Java.
-
withParameters
The process will be started with the given parameters.
- Parameters:
parameters
-- Returns:
- process starter for further processing
- See Also:
- API:
- This public API is available in Java.
-
withParameter
The process will be started with the given parameter.
- Parameters:
name
- name of the parameter- Returns:
- process starter for further processing
- See Also:
- API:
- This public API is available in Java.
-
start
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 provided session or user. If no session or user is provided the process will be started in the context of the system user session. Use the method
asSession(ISession)
orasUser(String)
to provide a specific session or user.The started
task
andcase
of the started process can be get from the response returned by the method.- Returns:
- process start event response
- Throws:
RequestException
- See Also:
- API:
- This public API is available in Java.
-
startAsync
Future<IProcessStartEventResponse> startAsync()Same as
start()
but the method will return immediately without executing the process. However, a background job is started that will execute the process.The method returns a
Future
that can be used to wait until the process is executed and to get theresponse
.Use this method if you expect a lot of events in a short period and do not want to block the calling thread. E.g., because the calling thread should read the next events from a queue.
- Returns:
- Future with the response if the process was started successfully or the exception if the process failed.
- See Also:
- API:
- This public API is available in Java.
-