Creates a new instance of a {@link WorkflowService
WorkflowService}.
This API does not specify how a workflow service factory or workflow service should be implemented. If, however, the implementation is J2EE/EJB based, the following additional rules apply to achieve common bahaviour for J2EE based implementations.
In the J2EE environment, clients usually obtain the connection to a server from a directory service represented by an {@link javax.naming.InitialContext InitialContext} instance. This instance need not be the default initial context available to the client (think of a servlet running in a servlet container that wants to access the workflow engine running in an application server on a different machine).
In an environment that uses an {@link javax.naming.InitialContext InitialContext} to obtain the connection to the server(as described above), the following ordered lookup procedure must be implemented to determine this initial context.
- If the property "
javax.naming.InitialContext" has been set, use it as initial context. if property "javax.naming.InitialContext.Environment" has been set, use it to obtain the initial context (see {@link #setProperty(String,Object) setProperty}. - If a default
InitialContext is available during the execution of newInstance (i.e. "new InitialContext() succeeds), and entries java:comp/env/de.danet.an.workflow.api.WorkflowService.NAMING_CONTEXT_FACTORY and java:comp/env/de.danet.an.workflow.api.WorkflowService.NAMING_CONTEXT_URL exist, use them to obtain the initial context. - If defined, execute vendor specific procedures to obtain an initial context.
- If a default
InitialContext is available during the execution of newInstance use it (i.e. do not try to obtain another initial context (this is the common situation where a servlet based client and the workflow engine run in one application server).
@return the workflow service.
@throws FactoryConfigurationError if not all required resourcescan be obtained.