org.obe.util
Class WorkflowUtilities

java.lang.Object
  extended byorg.obe.util.WorkflowUtilities

public final class WorkflowUtilities
extends java.lang.Object

Utility class for searching activity/workflow/package for settings and definitions.

Author:
Anthony Eden, Adrian Price

Method Summary
static Activity findActivity(WorkflowProcess workflow, java.lang.String activityId)
          Finds an activity within a workflow process definition.
static int findActivityPriority(Activity activity)
          Finds the priority to assign to an activity.
static ParameterMode findParameterMode(Application app, java.lang.String paramName)
          Gets the ParameterMode for the named parameter in the given application.
static Participant findParticipant(WorkflowProcess wp, java.lang.String participantId)
          Finds the Participant with the specified ID in the given workflow or package.
static Participant[] findParticipants(WorkflowProcess wp, java.lang.String particips)
          Find the Participants with the specified IDs in the given workflow or package.
static Application findToolDefinition(WorkflowProcess wp, java.lang.String toolId)
          Finds the definition of the specified tool in a workflow or package.
static TypeDeclaration findTypeDeclaration(XPDLPackage pkg, java.lang.String declaredTypeId)
          Finds a type declaration within a package.
static int findWorkflowPriority(WorkflowProcess workflow)
          Finds the workflow priority from the workflow or its package.
static WorkflowProcess findWorkflowProcess(XPDLPackage pkg, java.lang.String processDefinitionId)
          Finds a workflow definition within a package.
static java.lang.String[] getResponsibles(WorkflowProcess workflow)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findActivity

public static Activity findActivity(WorkflowProcess workflow,
                                    java.lang.String activityId)
                             throws WMInvalidActivityNameException
Finds an activity within a workflow process definition.

Parameters:
workflow - The workflow process definition to search.
activityId - The activity ID.
Returns:
The activity definition.
Throws:
WMInvalidActivityNameException - if the activity was not found.

findActivityPriority

public static int findActivityPriority(Activity activity)
Finds the priority to assign to an activity. The priority is taken from the activity itself if defined therein, or from its associated workflow priority if not.

Parameters:
activity - The activity definition.
Returns:
The activity priority.

findParameterMode

public static ParameterMode findParameterMode(Application app,
                                              java.lang.String paramName)
                                       throws FormalParameterNotFoundException
Gets the ParameterMode for the named parameter in the given application.

Parameters:
app - The Application
paramName - The parameter name
Returns:
The ParameterMode
Throws:
FormalParameterNotFoundException - If the named parameter could be found.

findParticipant

public static Participant findParticipant(WorkflowProcess wp,
                                          java.lang.String participantId)
                                   throws WMInvalidTargetUserException
Finds the Participant with the specified ID in the given workflow or package.

Parameters:
wp - The workflow process definition.
participantId - The participant ID. This can be a comma-separated list if there are two or more participants.
Returns:
The participant definition.
Throws:
WMInvalidTargetUserException - if any of the participants could not be located.

findParticipants

public static Participant[] findParticipants(WorkflowProcess wp,
                                             java.lang.String particips)
                                      throws WMInvalidTargetUserException
Find the Participants with the specified IDs in the given workflow or package.

Parameters:
wp - The workflow process definition.
particips - The participant ID(s). This can be a comma-separated list if there are two or more participants.
Returns:
The participant definition.
Throws:
WMInvalidTargetUserException - if any of the participants could not be located.

findToolDefinition

public static Application findToolDefinition(WorkflowProcess wp,
                                             java.lang.String toolId)
                                      throws WMInvalidToolException
Finds the definition of the specified tool in a workflow or package.

Parameters:
wp - The WorkflowProcess to search.
toolId - The ID of the tool for which the definition is required.
Returns:
The tool definition.
Throws:
WMInvalidToolException - if the tool definition could not be located.

findTypeDeclaration

public static TypeDeclaration findTypeDeclaration(XPDLPackage pkg,
                                                  java.lang.String declaredTypeId)
                                           throws WMInvalidProcessDefinitionException
Finds a type declaration within a package.

Parameters:
pkg - The package to search.
declaredTypeId - The ID of the declared type.
Returns:
The type declaration.
Throws:
WMInvalidProcessDefinitionException - if the type declaration could not be found.

findWorkflowPriority

public static int findWorkflowPriority(WorkflowProcess workflow)
Finds the workflow priority from the workflow or its package.

Parameters:
workflow - The workflow definition to search.
Returns:
The workflow or package priority.

findWorkflowProcess

public static WorkflowProcess findWorkflowProcess(XPDLPackage pkg,
                                                  java.lang.String processDefinitionId)
                                           throws WMInvalidProcessDefinitionException
Finds a workflow definition within a package.

Parameters:
pkg - The package to search.
processDefinitionId - The ID of the process definition required.
Returns:
The process definition.
Throws:
WMInvalidProcessDefinitionException - if the process definition could not be found in the package.

getResponsibles

public static java.lang.String[] getResponsibles(WorkflowProcess workflow)


SourceForge.net Logo OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.