org.wyona.yanel.core.api.attributes
Interface WorkflowableV1

All Known Implementing Classes:
NodeResource, XMLResource

public interface WorkflowableV1

DEV (not released yet, this interface still might change ...) <br/> A workflow is composed of states and transitions. Each revision of a workflowable resource has a state, which can be changed by performing transitions. Transitions may be bound to conditions or actions, but this is implementation specific. Further, a workflowable resource can be live, or not live. If it is live, it must provide a live-view. The workflow information of a resource can be stored in two types of properties: <ul> <li> workflow state: property which belongs to a revision. </li> <li> workflow variable: property which belongs to a resource (shared among all revisions). </li> </ul> Typically, the workflow state of a revision is something like draft/approved. A workflow variable may e.g. store the revision number of the live revision.


Method Summary
 void doTransition(java.lang.String transitionID, java.lang.String revision)
          Perform the transition with the given id to the indicated revision.
 View getLiveView(java.lang.String viewid)
          Gets the view of the live version of this resource.
 java.util.Date getWorkflowDate(java.lang.String revision)
          Gets the workflow date of the given revision, that is the date when the state has changed.
 java.lang.String getWorkflowIntrospection()
          Gets the introspection xml containing the workflow information.
 java.lang.String getWorkflowState(java.lang.String revision)
          Gets the workflow state of the given revision.
 java.lang.String getWorkflowVariable(java.lang.String name)
          Gets the workflow variable with the given name.
 boolean isLive()
          Indicates whether this resource is live or not.
 void removeWorkflowVariable(java.lang.String name)
          Removes the workflow variable with the given name.
 void setWorkflowState(java.lang.String state, java.lang.String revision)
          Sets the workflow state of the given revision, for example a "review" status
 void setWorkflowVariable(java.lang.String name, java.lang.String value)
          Sets the workflow variable with the given name, for example a "live" flag
 

Method Detail

doTransition

void doTransition(java.lang.String transitionID,
                  java.lang.String revision)
                  throws WorkflowException
Perform the transition with the given id to the indicated revision.

Parameters:
transitionID -
revision -
Throws:
WorkflowException

isLive

boolean isLive()
               throws WorkflowException
Indicates whether this resource is live or not.

Returns:
true if this resource is live, false otherwise.
Throws:
WorkflowException

getLiveView

View getLiveView(java.lang.String viewid)
                 throws java.lang.Exception
Gets the view of the live version of this resource.

Parameters:
viewid -
Returns:
live view
Throws:
java.lang.Exception

getWorkflowState

java.lang.String getWorkflowState(java.lang.String revision)
                                  throws WorkflowException
Gets the workflow state of the given revision.

Parameters:
revision -
Returns:
workflow state or null if the revision has no workflow state
Throws:
WorkflowException

setWorkflowState

void setWorkflowState(java.lang.String state,
                      java.lang.String revision)
                      throws WorkflowException
Sets the workflow state of the given revision, for example a "review" status

Parameters:
state -
revision -
Throws:
WorkflowException

getWorkflowDate

java.util.Date getWorkflowDate(java.lang.String revision)
                               throws WorkflowException
Gets the workflow date of the given revision, that is the date when the state has changed.

Parameters:
revision -
Returns:
workflow date or null if the revision has no workflow date
Throws:
WorkflowException

getWorkflowVariable

java.lang.String getWorkflowVariable(java.lang.String name)
                                     throws WorkflowException
Gets the workflow variable with the given name.

Parameters:
name -
Returns:
workflow variable or null if this resource has no workflow variable with the given name.
Throws:
WorkflowException

setWorkflowVariable

void setWorkflowVariable(java.lang.String name,
                         java.lang.String value)
                         throws WorkflowException
Sets the workflow variable with the given name, for example a "live" flag

Parameters:
name -
value -
Throws:
WorkflowException

removeWorkflowVariable

void removeWorkflowVariable(java.lang.String name)
                            throws WorkflowException
Removes the workflow variable with the given name.

Parameters:
name -
Throws:
WorkflowException

getWorkflowIntrospection

java.lang.String getWorkflowIntrospection()
                                          throws WorkflowException
Gets the introspection xml containing the workflow information. Since workflow is tied to versioning, this xml also contains the revision information.

Returns:
workflow introspection xml
Throws:
WorkflowException