org.apache.oozie.workflow
Interface WorkflowLib

All Known Implementing Classes:
DBLiteWorkflowLib, LiteWorkflowLib

public interface WorkflowLib

The workflow library provides application parsing and storage capabilities for workflow instances.

The implementation is responsible for doing the store operations in a transactional way, either in autocommit or within the scope of a transaction.


Method Summary
 void close()
          Close store.
 void commit()
          Commit changes to store.
 WorkflowInstance createInstance(WorkflowApp app, org.apache.hadoop.conf.Configuration conf)
          Create a workflow instance.
 WorkflowInstance createInstance(WorkflowApp app, org.apache.hadoop.conf.Configuration conf, String wfId)
          Create a workflow instance with the given wfId.
 void delete(String id)
          Delete a workflow instance from storage.
 WorkflowInstance get(String id)
          Load a workflow instance from storage.
 void insert(WorkflowInstance instance)
          Insert a workflow instance in storage.
 WorkflowApp parseDef(String wfXml, org.apache.hadoop.conf.Configuration jobConf)
          Parse a workflow application definition.
 void update(WorkflowInstance instance)
          Update a workflow instance in storage.
 

Method Detail

parseDef

WorkflowApp parseDef(String wfXml,
                     org.apache.hadoop.conf.Configuration jobConf)
                     throws WorkflowException
Parse a workflow application definition.

Parameters:
wfXml - string containing the workflow definition.
jobConf - job configuration
Returns:
the parse workflow application.
Throws:
WorkflowException - thrown if the definition could not be parsed.

createInstance

WorkflowInstance createInstance(WorkflowApp app,
                                org.apache.hadoop.conf.Configuration conf)
                                throws WorkflowException
Create a workflow instance.

Parameters:
app - application to create a workflow instance of.
conf - job configuration.
Returns:
the newly created workflow instance.
Throws:
WorkflowException - thrown if the instance could not be created.

createInstance

WorkflowInstance createInstance(WorkflowApp app,
                                org.apache.hadoop.conf.Configuration conf,
                                String wfId)
                                throws WorkflowException
Create a workflow instance with the given wfId. This will be used for re-running workflows.

Parameters:
app - application to create a workflow instance of.
conf - job configuration.
wfId - Workflow ID.
Returns:
the newly created workflow instance.
Throws:
WorkflowException - thrown if the instance could not be created.

insert

void insert(WorkflowInstance instance)
            throws WorkflowException
Insert a workflow instance in storage.

Parameters:
instance - of the workflow instance to insert.
Throws:
WorkflowException - thrown if the instance could not be inserted.

get

WorkflowInstance get(String id)
                     throws WorkflowException
Load a workflow instance from storage.

Parameters:
id - ID of the workflow instance to load.
Returns:
the loaded workflow instance.
Throws:
WorkflowException - thrown if the instance could not be loaded.

update

void update(WorkflowInstance instance)
            throws WorkflowException
Update a workflow instance in storage.

Parameters:
instance - workflow instance to update.
Throws:
WorkflowException - thrown if the instance could not be loaded.

delete

void delete(String id)
            throws WorkflowException
Delete a workflow instance from storage.

Parameters:
id - ID of the workflow instance to delete.
Throws:
WorkflowException - thrown if the instance could not be deleted.

commit

void commit()
            throws WorkflowException
Commit changes to store.

Throws:
WorkflowException - thrown if the commit could not be done.

close

void close()
           throws WorkflowException
Close store. It rollbacks if there was no commit.

Throws:
WorkflowException - thrown if the close could not be done.


Copyright © 2012 Apache Software Foundation. All Rights Reserved.