Workflow Manual / Version 2404
Table Of ContentsThe Spring context is loaded at startup time and is shut down when the server is shut down. The Spring configuration can refer to the Workflow Server's Unified API connection, using the same name ("connection") as in the CAE. An action or expression may implement the interface com.coremedia.cap.workflow.plugin.CapConnectionAware. If it does so, the connection is injected before the action is executed or the expression is evaluated for the first time.
In order to use a bean in your action or expression proceed as follows:
Use the common Spring ways to add your custom configuration to the workflow server's Spring application context.
Let your customized actions or expressions extend com.coremedia.workflow.common.util.SpringAwareAction or com.coremedia.workflow.common.util.SpringAwareExpression respectively.
Get access to Spring beans inside your customized code using the
getSpringContext()
method, for example use
protected ActionResult execute(Process process) { InboxFactory inboxes = getSpringContext().getBean(InboxFactory.class); … }
The configured beans may implement the common Spring ways to receive life cycle events from the
workflow server's application context. Additionally, the beans may implement the interface
com.coremedia.workflow.common.util.WorkflowServerLifecycleAware,
if they want to initiate asynchronous operations. Such operations may start after the method
workflowServerStart()
is called and must be completed before the method
workflowServerStop()
returns. Only singleton beans receive these callbacks and
only if they implement the given interface.