Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2006 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.content.virtual.workflow
Class Workflow

    java.lang.Object
      com.bea.content.virtual.workflow.Workflow

All Implemented Interfaces
  Serializable

    public class Workflow

extends Object
implements Serializable

Represents the Workflow document.

Methods which return an `com.bea.content.paging.ISortableFilterablePagedList` from `IWorkflowManager` can sort and filter the responses. For a discussion on paging, sorting and filtering, see `com.bea.content.paging` and `ContentListKeys`. Native sortable properties for the BEA Repository are found via the `ISortablePagedList.getNativeSortableProperties()` method on a paged list of Node objects.

For Workflows in the BEA Repository, the current list of native sortable and filterable properties is:

- name
- creationDate
- modifiedDate

See Also
  Serialized Form

Field Summary
`static int` | `DRAFT` Predefined Workflow status
`static int` | `PUBLISHED`
`static int` | `READY`
`static int` | `REJECTED`
`static int` | `RETIRED`
`static int` | `UNDEFINED` Status which determines if the workflow set a object is not defined in it's corresponding workflow document
`static String` | `WORKFLOW_STATUS_FIELD`

Constructor Summary
`Workflow(ID id, String name, String comment, Date createdDate, Date modifiedDate)` Construct a workflow without setting the spinodeOps or the workflow document.
`Workflow(ID id, String name, String comment, com.bea.content.virtual.workflow.schema.WorkflowDocument document, Date createdDate, Date modifiedDate)` Construct a Workflow without setting the spinodeOps variable.
`Workflow(ID id, String name, String comment, com.bea.content.virtual.workflow.schema.WorkflowDocument document, WorkflowOps spiWorkflowOps, boolean isInheritedOnTarget, Date createdDate, Date modifiedDate)` Construct a Workflow

Method Summary
`int` | `getBeginStatus()` Return the status that marks the begin point of the workflow
`String` | `getComment()` Return the comment associated with the workflow
`Date` | `getCreatedDate()` Return the date workflow was created
`ID` | `getId()`
`Date` | `getModifiedDate()` Return the last modification date of the workflow
`String` | `getName()`
`Set<String>` | `getRolesForCapability(ContentContext context, Node node, String capability)` Return all the published roles for the node represented by the node id.
`Map<Integer,String>` | `getStatusText()` Returns a map of status representation of the text.
`List<Integer>` | `getStatusTransitions(ContentContext context, Node node, int originStatus)` Returns a list of valid status transitions for the user from the given status.
`List<WorkflowAction>` | `getTransitionActions(ContentContext context, Node node, int fromState, int toState)` Return a list of WorkflowAction objects which represent the actions to be executed when making a transition from one state to another.
`boolean` | `hasTransitionAccess(ContentContext context, Node node, int status)` Helper method to indicate whether or not a user has access to a from-status element to perform operations on the object.
`boolean` | `isInheritedOnTarget()` Indicates whether or not the given workflow is inherited on the object of the workflow.
`boolean` | `isWorkflowDocumentLoaded()` Indicates whether the workflow document has been loaded for this object.
`void` | `setComment(String comment)`
`void` | `setInheritedOnTarget(boolean isInheritedOnTarget)` Sets the isInheritedOnTarget value.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DRAFT

    public static final int DRAFT

  Predefined Workflow status

  See Also
    Constants Summary

### READY

    public static final int READY

See Also
  Constants Summary

### REJECTED

    public static final int REJECTED

See Also
  Constants Summary

### PUBLISHED

    public static final int PUBLISHED

See Also
  Constants Summary

### RETIRED

    public static final int RETIRED

See Also
  Constants Summary

### UNDEFINED

    public static final int UNDEFINED

  Status which determines if the workflow set a object is not defined in it's corresponding workflow document

  See Also
    Constants Summary

### WORKFLOW_STATUS_FIELD

    public static final String WORKFLOW_STATUS_FIELD

See Also
  Constants Summary

Constructor Detail

### Workflow

    public Workflow(ID id,
                    String name,
                    String comment,
                    com.bea.content.virtual.workflow.schema.WorkflowDocument document,
                    WorkflowOps spiWorkflowOps,
                    boolean isInheritedOnTarget,
                    Date createdDate,
                    Date modifiedDate)

  Construct a Workflow

  Parameters
    `id` - The ID of the workflow
    `name` - The name of the workflow - workflow names are unique within a repository
    `comment` - An optional comment associated with a workflow
    `document` - The actual workflow document
    `spiWorkflowOps` - The SPI interface for the workflow.
    `isInheritedOnTarget` - Indicates whether the workflow is inherited on target or not.

### Workflow

    public Workflow(ID id,
                    String name,
                    String comment,
                    com.bea.content.virtual.workflow.schema.WorkflowDocument document,
                    Date createdDate,
                    Date modifiedDate)

  Construct a Workflow without setting the spinodeOps variable. Note that this is a helper constructor only and in order to use the Workflow methods to get transitions etc, you need to set the spiNodeOps also.

  Parameters
    `id` -
    `name` -
    `comment` -
    `document` -

### Workflow

    public Workflow(ID id,
                    String name,
                    String comment,
                    Date createdDate,
                    Date modifiedDate)

  Construct a workflow without setting the spinodeOps or the workflow document. This essentially creates a workflow object which acts only as a value object (useful to display the workflow objects in a list for example) and you cannot perform any transition methods on this object.

  Parameters
    `id` -
    `name` -
    `comment` -

Method Detail

### isWorkflowDocumentLoaded

    public boolean isWorkflowDocumentLoaded()

  Indicates whether the workflow document has been loaded for this object.

  Returns
    whether the workflow document has been loaded for this object or not

### getId

    public ID getId()

  Returns
    Returns the id.

### getName

    public String getName()

  Returns
    Returns the name of the workflow

### getComment

    public String getComment()

  Return the comment associated with the workflow

  Returns
    The comment

### setComment

    public void setComment(String comment)

### getCreatedDate

    public Date getCreatedDate()

  Return the date workflow was created

  Returns
    The creation date

### getModifiedDate

    public Date getModifiedDate()

  Return the last modification date of the workflow

  Returns
    The modification date

### getBeginStatus

    public int getBeginStatus()
                       throws RepositoryException

  Return the status that marks the begin point of the workflow

  Returns
    -1 if document is not defined, the begin status otherwise
  Throws
    `RepositoryException`

### getStatusTransitions

    public List<Integer> getStatusTransitions(ContentContext context,
                                              Node node,
                                              int originStatus)

  Returns a list of valid status transitions for the user from the given status. The list contains Integer values of Status Transitions. If the originStatus does not exist in the workflow document, the method will search for any UNDEFINED transitions described in the workflow document, and will return the available transitions for that status.

  Parameters
    `context` - The ContentContext object
    `originStatus` - The origin status for the user.
  Returns
    An integer list of allowable status transitions.

### getTransitionActions

    public List<WorkflowAction> getTransitionActions(ContentContext context,
                                                     Node node,
                                                     int fromState,
                                                     int toState)
                                              throws IOException,
                                                     XmlException,
                                                     ClassNotFoundException,
                                                     InstantiationException,
                                                     IllegalAccessException,
                                                     com.bea.p13n.entitlements.common.EntitlementsException,
                                                     RepositoryException

  Return a list of WorkflowAction objects which represent the actions to be executed when making a transition from one state to another. If the transition fromState is not defined in the workflow document, this method will try to retrieve the transition actions for the UNDEFINED state.

  Parameters
    `node` - The node on which actions are executed.
    `fromState` - The start point of the transition.
    `toState` - The end point of the transition.
  Returns
    A list of WorkflowAction objects, or null if transition fromState -> toState is not defined in the document, and the UNDEFINED transition is also not defined. This method can also return an empty list if the user is not authorized to execute any actions for that transition.
  Throws
    `IOException`
    `XmlException`
    `ClassNotFoundException`
    `InstantiationException`
    `IllegalAccessException`
    `com.bea.p13n.entitlements.common.EntitlementsException`
    `RepositoryException`

### hasTransitionAccess

    public boolean hasTransitionAccess(ContentContext context,
                                       Node node,
                                       int status)
                                throws IOException,
                                       XmlException,
                                       AuthenticationException,
                                       AuthorizationException,
                                       TransitionNotFoundException,
                                       NoSuchNodeException,
                                       com.bea.p13n.entitlements.common.EntitlementsException,
                                       RepositoryException

  Helper method to indicate whether or not a user has access to a from-status element to perform operations on the object. If the administrator has specified a capabilityConstraint/roleConstraint on the from-status element, this will check for the user's credentials to see if the current user matches these constraints. If the status does not exist in the workflow, the method will throw an exception

  Parameters
    `context` - The contentContext object
    `node` - The node object
    `status` - The status to check.
  Returns
    true if the user has access - false otherwise.
  Throws
    `IOException`
    `XmlException`
    `AuthenticationException`
    `AuthorizationException`
    `NoSuchNodeException`
    `com.bea.p13n.entitlements.common.EntitlementsException`
    `TransitionNotFoundException` - If the transition is not found
    `RepositoryException`

### getRolesForCapability

    public Set<String> getRolesForCapability(ContentContext context,
                                             Node node,
                                             String capability)
                                      throws AuthenticationException,
                                             AuthorizationException,
                                             NoSuchNodeException,
                                             RepositoryException

  Return all the published roles for the node represented by the node id. This will not only find the published role on that node id, but will also try to find published roles which are inherited by the node id. Finally, it will append the "Admin" role to the publish roles list.

  Parameters
    `context` - The content context object
    `node` - The node object
    `capability` - The capability to retrieve
  Returns
    A Set of string roles for the given node id.
  Throws
    `AuthenticationException`
    `AuthorizationException`
    `NoSuchNodeException`
    `RepositoryException`

### getStatusText

    public Map<Integer,String> getStatusText()
                                      throws RepositoryException

  Returns a map of status representation of the text. The key is the status id (Integer) and the value is the text representation of the status code.

  Returns
    Map of values for the status id's
  Throws
    `RepositoryException`

### isInheritedOnTarget

    public boolean isInheritedOnTarget()

  Indicates whether or not the given workflow is inherited on the object of the workflow. For example when you call workflowManager.getWorkflowForNode() the workflow object returned will have this value as True if the workflow was actually inherited for that node. It will be false if the user has explicitly set the workflow on the node itself. The same behavior exists if a workflow is set on the type - when you call workflowManager.getWorkflowForType() In case of a conflict, the value will be returned based on same conflict resolution rules which exist in the workflowManager.getWorkflowForNode() method. So for example for in hierarchy A/B/C if some workflow is set on Node A. Also assume that Node C has a type "Data" which has a workflow associated with that also. So in that case, the method getWorkflowForNode(Node C) will return the workflow of type "Data" and whether or not it is inherited will depend if the workflow on type "Data" is inherited or not.

  Returns
    true if inherited, false otherwise

### setInheritedOnTarget

    public void setInheritedOnTarget(boolean isInheritedOnTarget)

  Sets the isInheritedOnTarget value. This is computed and set by the system and is based on the object on which the workflow is set.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 BEA Systems, Inc. All Rights Reserved