SMILA (incubation) API documentation

org.eclipse.smila.processing.bpel
Class ODEWorkflowProcessor

java.lang.Object
  extended by org.eclipse.smila.processing.bpel.ODEWorkflowProcessor
All Implemented Interfaces:
WorkflowProcessor

public class ODEWorkflowProcessor
extends java.lang.Object
implements WorkflowProcessor

SMILA Workflow Processor that uses the Apache ODE BPEL engine to orchestrate SMILA pipelets in BPEL processes.

Author:
jschumacher

Field Summary
static java.lang.String WORKFLOW_STORE
          the store to persist the workflow data.
 
Fields inherited from interface org.eclipse.smila.processing.WorkflowProcessor
NAMESPACE_PROCESSOR, WORKFLOW_DEFINITION, WORKFLOW_NAME, WORKFLOW_READONLY, WORKFLOW_TIMESTAMP
 
Constructor Summary
ODEWorkflowProcessor()
          create processor.
 
Method Summary
protected  void activate(ComponentContext context)
          OSGi Declarative Services service activation method.
protected  void deactivate(ComponentContext context)
          OSGi Declarative Services service deactivation method.
 void deleteWorkflowDefinition(java.lang.String workflowName)
           
 Blackboard getBlackboard(java.lang.String id)
          get blackboard service for request.
 MessageHelper getMessageHelper()
           
 AnyMap getWorkflowDefinition(java.lang.String workflowName)
          get the definition for a given workflow name.
 java.util.List<java.lang.String> getWorkflowNames()
          get the pipeline names of the active BPEL processes.
 java.lang.String[] process(java.lang.String workflowName, Blackboard blackboard, java.lang.String[] recordIds)
          process records on Blackboard service.
 void setClusterConfigService(ClusterConfigService ccs)
          set new ClusterConfigService.
 void setObjectStoreService(ObjectStoreService objectStore)
          method for DS to set a service reference.
 void setPipeletException(java.lang.String requestId, java.lang.Exception ex)
          store a pipelet exception for better error reporting if the engine finally fails.
 void setWorkflowDefinition(java.lang.String workflowName, AnyMap workflowDefinition)
           
 void setZooKeeperService(ZooKeeperService zks)
          set new ZooKeeperService.
 void synchronizeWorkflowDefinition(java.lang.String workflowName, boolean isDeleted)
          reload the workflow definition from persistence and deploy it, or undeploy it.
 void unsetClusterConfigService(ClusterConfigService ccs)
          remove an ClusterConfigService.
 void unsetObjectStoreService(ObjectStoreService objectStore)
          method for DS to unset a service reference.
 void unsetZooKeeperService(ZooKeeperService zks)
          remove an ZooKeeperService.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKFLOW_STORE

public static final java.lang.String WORKFLOW_STORE
the store to persist the workflow data.

See Also:
Constant Field Values
Constructor Detail

ODEWorkflowProcessor

public ODEWorkflowProcessor()
create processor. BPEL server is initialized in activate method.

Method Detail

process

public java.lang.String[] process(java.lang.String workflowName,
                                  Blackboard blackboard,
                                  java.lang.String[] recordIds)
                           throws ProcessingException
Description copied from interface: WorkflowProcessor
process records on Blackboard service.

Specified by:
process in interface WorkflowProcessor
Parameters:
workflowName - name of workflow to execute on Ids
blackboard - blackboard to use for processing
recordIds - Ids of records to process.
Returns:
Ids of result records.
Throws:
ProcessingException - error during processing.
See Also:
org.eclipse.smila.processing.WorkflowProcessor#process(java.lang.String, org.eclipse.smila.datamodel.id.Id[])

getWorkflowNames

public java.util.List<java.lang.String> getWorkflowNames()
get the pipeline names of the active BPEL processes. The pipeline name is the local part of the EPR service name.

Specified by:
getWorkflowNames in interface WorkflowProcessor
Returns:
pipeline names of the active BPEL processes, or null, if engine is not active yet.

getWorkflowDefinition

public AnyMap getWorkflowDefinition(java.lang.String workflowName)
                             throws ProcessingException
get the definition for a given workflow name.

Specified by:
getWorkflowDefinition in interface WorkflowProcessor
Parameters:
workflowName - The workflow name
Returns:
the any object with the definition
Throws:
ProcessingException - error reading the definition.

setWorkflowDefinition

public void setWorkflowDefinition(java.lang.String workflowName,
                                  AnyMap workflowDefinition)
                           throws ProcessingException
Specified by:
setWorkflowDefinition in interface WorkflowProcessor
Parameters:
workflowName - The workflow name
workflowDefinition - contains the workflow to add/update and deploy
Throws:
ProcessingException - error during deploy

deleteWorkflowDefinition

public void deleteWorkflowDefinition(java.lang.String workflowName)
                              throws ProcessingException
Specified by:
deleteWorkflowDefinition in interface WorkflowProcessor
Parameters:
workflowName - The workflow name to delete and undeploy
Throws:
ProcessingException - error during undeploy

synchronizeWorkflowDefinition

public void synchronizeWorkflowDefinition(java.lang.String workflowName,
                                          boolean isDeleted)
                                   throws ProcessingException
Description copied from interface: WorkflowProcessor
reload the workflow definition from persistence and deploy it, or undeploy it. This can be called to notify the processor that the definition has been changed by someone else, e.g. another cluster node.

Specified by:
synchronizeWorkflowDefinition in interface WorkflowProcessor
Parameters:
workflowName - the name of the workflow to reload.
isDeleted - true to undeploy workflow locally, false to deploy the currently persisted version.
Throws:
ProcessingException - if the workflow could not be reloaded for any reason.

getBlackboard

public Blackboard getBlackboard(java.lang.String id)
                         throws ProcessingException
get blackboard service for request.

Parameters:
id - request ID
Returns:
blackboard service.
Throws:
ProcessingException - no blackboard associated with id

setPipeletException

public void setPipeletException(java.lang.String requestId,
                                java.lang.Exception ex)
store a pipelet exception for better error reporting if the engine finally fails.

Parameters:
requestId - id of request
ex - exception thrown during pipelet execution.

getMessageHelper

public MessageHelper getMessageHelper()
Returns:
message helper that converts Processor/SearchMessages to XML and vice versa

activate

protected void activate(ComponentContext context)
OSGi Declarative Services service activation method. Initializes BPEL engine.

Parameters:
context - OSGi service component context.

deactivate

protected void deactivate(ComponentContext context)
OSGi Declarative Services service deactivation method. Shuts down BPEL engine.

Parameters:
context - OSGi service component context.

setObjectStoreService

public void setObjectStoreService(ObjectStoreService objectStore)
method for DS to set a service reference.

Parameters:
objectStore - ObjectStoreService reference.

unsetObjectStoreService

public void unsetObjectStoreService(ObjectStoreService objectStore)
method for DS to unset a service reference.

Parameters:
objectStore - ObjectStoreService reference.

setClusterConfigService

public void setClusterConfigService(ClusterConfigService ccs)
set new ClusterConfigService. To be called by DS runtime before activation.

Parameters:
ccs - new ClusterConfigService

unsetClusterConfigService

public void unsetClusterConfigService(ClusterConfigService ccs)
remove an ClusterConfigService. To be called by DS runtime after deactivation.

Parameters:
ccs - new ClusterConfigService

setZooKeeperService

public void setZooKeeperService(ZooKeeperService zks)
set new ZooKeeperService. To be called by DS runtime before activation.

Parameters:
zks - new ZooKeeperService

unsetZooKeeperService

public void unsetZooKeeperService(ZooKeeperService zks)
remove an ZooKeeperService. To be called by DS runtime after deactivation.

Parameters:
zks - new ZooKeeperService

SMILA (incubation) API documentation