OBEROn SDK

com.oberon.ooql.sdk
Class Workflow

java.lang.Object
  extended by com.oberon.ooql.sdk.OBBase
      extended by com.oberon.ooql.sdk.AdminBase
          extended by com.oberon.ooql.sdk.Workflow
All Implemented Interfaces:
java.io.Serializable

public class Workflow
extends AdminBase
implements java.io.Serializable

Workflow Admin Object: defines a workflow.

Version:
5.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Workflow()
           
Workflow(java.lang.String name)
           
 
Method Summary
 void addExecuteAccess(java.lang.String actorType, java.lang.String actorName)
          Add access right to execute this Workflow to an actor
 void addStep(Step step)
          Appends a new Step to the Workflow
 void clearParameters()
          Remove all Workflow global Parameters.
 java.lang.String compareUpdate(Workflow refWorkflow, boolean checkImage, boolean overwrite, boolean force, Framework framework)
          Return/apply the OOQL command to update this Workflow object and let it become equals to another reference object.
static java.lang.String covertActorFormat(java.lang.String actor)
          Convert the actor string format from actortype|actorname to OOQL format
 void create(boolean force, Framework framework)
          Create a new Workflow object on the database
 void create(Framework framework)
          Create a new Workflow object on the database
 void destroy(Framework framework)
          Remove the Workflow object from the database.
 void fromXML(org.jdom.Element rootElement)
          Load the Workflow object and Step properties from XML element tree
 void fromXML(org.jdom.Element rootElement, boolean loadSteps)
          Load the Workflow object properties from XML element tree
 java.lang.String getCreateCommand(boolean force)
          Return the OOQL command to create this Workflow object with the settled properties
 java.util.Vector<java.lang.String> getExecuteAccess()
          Return the list of execute access rights for this Workflow.
 java.util.Hashtable<java.lang.String,java.lang.String> getParameters()
          Get the Workflow global Parameters.
 java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
          Get a property for this Workflow object by its OOQL identifier
 java.lang.String getSaveCommand(boolean force)
          Return the OOQL command to update this Workflow object with the modified properties.
 Step getStartStep()
          Get the Workflow start Step
 Step getStep(java.lang.String stepName)
          Get a Workflow Step with the given name
 Step getStepAt(int index)
          Get a Workflow Step at given position index
 Step getStepFromId(int stepId)
          Get a Workflow Step with the given internal id
 java.util.Vector<java.lang.String> getStepIDs()
          Get all Workflow Step internal ids
 java.util.Vector<java.lang.String> getStepNames()
          Get all Workflow Step names
 int getStepPos(java.lang.String stepName)
          Get the Step position index in the Workflow step sequence
 java.util.Vector<Step> getSteps()
          Get all workflow Steps
 java.lang.String getStepsAsString(java.lang.String delim)
          Get all Workflow Step names as a single string
 java.util.Hashtable<java.lang.String,org.jdom.Element> getStepXML()
          Get the Step properties loaded from the XML element tree
 java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
          Return a Vector of administrative object names extracted by using an OOQL selector
 boolean hasAccess(Framework framework)
          Check if the framework user has access to execute this Workflow
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Workflow object: connect the memory instance with the database instance
static Workflow open(java.lang.String name, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open an administrative object and read properties from the database or retrieve them from memory
 void removeExecuteAccess(java.lang.String actorType, java.lang.String actorName)
          Remove the actor access right to execute this Workflow
 void removeParameter(java.lang.String parameter)
          Remove a parameter from the Workflow global Parameters.
 void removeStep(Step step)
          Remove a Step from the Workflow
 void removeStep(java.lang.String stepName)
          Remove a Step from the Workflow identified by its name
 void setParameter(java.lang.String parameter, java.lang.String value)
          Set a Workflow global Parameter.
 void setParameters(java.util.Hashtable<java.lang.String,java.lang.String> parameters)
          Set the Workflow global Parameters.
 void setSteps(java.util.Vector<Step> steps)
          Set all Workflow Steps
 java.lang.String toString()
          Return the Workflow object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the Workflow object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Workflow object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Workflow object properties as XML element tree
 void unlink(Framework framework)
          Close the object: disconnect the memory instance from the database instance
 void updateExecuteAccess(java.util.Vector<java.lang.String> accesses)
          Update the execute access on the basis of a given list
 void updateParameters(java.util.Hashtable<java.lang.String,java.lang.String> parameters)
          Update the parameters on the basis of a given map
 void updateSteps(java.util.Vector<Step> steps)
          Update the steps on the basis of a given list
 void validate(Framework framework)
          Validate this Workflow
 void write(boolean force, Framework framework)
          Update the Workflow object to the database The operation is allowed only if there is no Process instances for this Workflow.
 void write(Framework framework)
          Update the Workflow object to the database The operation is allowed only if there is no Process instances for this Workflow.
 
Methods inherited from class com.oberon.ooql.sdk.AdminBase
addFeature, changedApplication, checkChangeName, checkCounters, checkCounters, getAdminType, getApplication, getCommonProperty, getCommonTargetNames, getCounters, getCreateBasicCommand, getCreateCommand, getCrtDate, getDescription, getEditBasicCommand, getFeature, getFeatures, getFeaturesAsString, getImage, getImage, getImage, getImageData, getImageFile, getModDate, getModUser, getName, getOldName, getPlainFeatures, getSaveCommand, getSVNRevision, getXMLFeatureList, hasImage, isHidden, setApplication, setCounters, setCrtDate, setDescription, setHidden, setImage, setImageData, setImageFile, setModDate, setModUser, setName, setSVNRevision, show, show, toCommonXML, toXML
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Workflow

public Workflow()

Workflow

public Workflow(java.lang.String name)
         throws OberonException
Parameters:
name - the name of the administrative object
Throws:
OberonException - if the name contains invalid characters
Method Detail

open

public static Workflow open(java.lang.String name,
                            Framework framework,
                            java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                     throws OberonException
Open an administrative object and read properties from the database or retrieve them from memory

Parameters:
name - the object name
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

link

public void link(Framework framework,
                 java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          throws OberonException
Open the Workflow object: connect the memory instance with the database instance

Specified by:
link in class AdminBase
Parameters:
framework - the current framework
counters - administrative object synch counters (if null read them from database)
Throws:
OberonException - usually due to DB SQL exceptions

create

public void create(Framework framework)
            throws OberonException
Create a new Workflow object on the database

Specified by:
create in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

create

public void create(boolean force,
                   Framework framework)
            throws OberonException
Create a new Workflow object on the database

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

write

public void write(Framework framework)
           throws OberonException
Update the Workflow object to the database The operation is allowed only if there is no Process instances for this Workflow.

Specified by:
write in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

write

public void write(boolean force,
                  Framework framework)
           throws OberonException
Update the Workflow object to the database The operation is allowed only if there is no Process instances for this Workflow.

Parameters:
force - if true ignores optional features
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights
Since:
1.6

unlink

public void unlink(Framework framework)
            throws OberonException
Close the object: disconnect the memory instance from the database instance

Specified by:
unlink in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

validate

public void validate(Framework framework)
              throws OberonException
Validate this Workflow

Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions

destroy

public void destroy(Framework framework)
             throws OberonException
Remove the Workflow object from the database. The operation is allowed only if there is no Process instances for this Workflow.

Specified by:
destroy in class AdminBase
Parameters:
framework - the current framework
Throws:
OberonException - usually due to DB SQL exceptions or to limited user access rights

addExecuteAccess

public void addExecuteAccess(java.lang.String actorType,
                             java.lang.String actorName)
Add access right to execute this Workflow to an actor

Parameters:
actorType - the actor type: can be ActorAccess.USER , ActorAccess.TEAM , ActorAccess.ASSIGNMENT
actorName - the actor name

removeExecuteAccess

public void removeExecuteAccess(java.lang.String actorType,
                                java.lang.String actorName)
Remove the actor access right to execute this Workflow

Parameters:
actorType - the actor type: can be ActorAccess.USER , ActorAccess.TEAM , ActorAccess.ASSIGNMENT
actorName - the actor name

updateExecuteAccess

public void updateExecuteAccess(java.util.Vector<java.lang.String> accesses)
Update the execute access on the basis of a given list

Parameters:
accesses - list of accesses formatted as actorType|actorName
Since:
4.0

getExecuteAccess

public java.util.Vector<java.lang.String> getExecuteAccess()
Return the list of execute access rights for this Workflow.

Returns:
Vector of access rights ormatted as actorType|actorName
See Also:
addExecuteAccess(String, String)

setParameters

public void setParameters(java.util.Hashtable<java.lang.String,java.lang.String> parameters)
Set the Workflow global Parameters.

Parameters:
parameters - set of parameters to put/change into the parameter table
Since:
2.2_01

setParameter

public void setParameter(java.lang.String parameter,
                         java.lang.String value)
Set a Workflow global Parameter.

Parameters:
parameter - the parameter to set
value - the parameter value
Since:
2.2_01

removeParameter

public void removeParameter(java.lang.String parameter)
Remove a parameter from the Workflow global Parameters.

Parameters:
parameter - the parameter to remove
Since:
2.2_01

updateParameters

public void updateParameters(java.util.Hashtable<java.lang.String,java.lang.String> parameters)
Update the parameters on the basis of a given map

Parameters:
parameters - map of parameter values
Since:
4.0

clearParameters

public void clearParameters()
Remove all Workflow global Parameters.

Since:
2.2_01

getParameters

public java.util.Hashtable<java.lang.String,java.lang.String> getParameters()
Get the Workflow global Parameters.

Returns:
Hashtable where the parameter names are the keys

addStep

public void addStep(Step step)
             throws OberonException
Appends a new Step to the Workflow

Throws:
OberonException

removeStep

public void removeStep(Step step)
Remove a Step from the Workflow


removeStep

public void removeStep(java.lang.String stepName)
Remove a Step from the Workflow identified by its name


updateSteps

public void updateSteps(java.util.Vector<Step> steps)
                 throws OberonException
Update the steps on the basis of a given list

Parameters:
steps - list of Steps
Throws:
OberonException
Since:
4.0

setSteps

public void setSteps(java.util.Vector<Step> steps)
Set all Workflow Steps

Parameters:
steps - a Vector of Steps

getStepPos

public int getStepPos(java.lang.String stepName)
Get the Step position index in the Workflow step sequence

Returns:
the position index or -1 if not found

getSteps

public java.util.Vector<Step> getSteps()
Get all workflow Steps

Returns:
a Vector of Steps

getStepAt

public Step getStepAt(int index)
Get a Workflow Step at given position index


getStep

public Step getStep(java.lang.String stepName)
Get a Workflow Step with the given name


getStartStep

public Step getStartStep()
Get the Workflow start Step


getStepFromId

public Step getStepFromId(int stepId)
Get a Workflow Step with the given internal id


getStepNames

public java.util.Vector<java.lang.String> getStepNames()
Get all Workflow Step names

Returns:
a Vector Step names

getStepIDs

public java.util.Vector<java.lang.String> getStepIDs()
Get all Workflow Step internal ids

Returns:
a Vector of ids

getStepsAsString

public java.lang.String getStepsAsString(java.lang.String delim)
Get all Workflow Step names as a single string

Parameters:
delim - the Step name separator

hasAccess

public boolean hasAccess(Framework framework)
Check if the framework user has access to execute this Workflow


covertActorFormat

public static java.lang.String covertActorFormat(java.lang.String actor)
Convert the actor string format from actortype|actorname to OOQL format

Parameters:
actor - actor string formatted as actortype|actorname ( User|MyName )
Returns:
actor name formatted as actortype[actorname] ( user[MyName] )

getProperty

public java.lang.String getProperty(java.lang.String propertyName,
                                    java.util.Vector<java.lang.Object> filterArgs,
                                    java.lang.String token,
                                    Framework framework)
Get a property for this Workflow object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: defaultfiletype , revisionrule ...)
filterArgs - extra arguments used to compute properties
token - separator token for complex properties
framework - the current framework
Returns:
the property value

getTargetNames

public java.util.Vector<?> getTargetNames(java.lang.String composedName,
                                          java.util.Vector<java.lang.Object> filterArgs,
                                          Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector

Specified by:
getTargetNames in class OBBase
Parameters:
composedName - OOQL property identifier/name (example: step, .. )
filterArgs - extra arguments used to compute properties
framework - the current framework
Returns:
a Vector of target names, used to extract their (sub)properties values

toString

public java.lang.String toString()
Return the Workflow object basic properties as a single String

Overrides:
toString in class AdminBase

toString

public java.lang.String toString(Framework framework)
Return the Workflow object extended properties as a single String

Overrides:
toString in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(Framework framework)
Return the Workflow object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
framework - the current framework

toXML

public org.jdom.Element toXML(boolean getImage,
                              boolean fullDump,
                              Framework framework)
Return the Workflow object properties as XML element tree

Specified by:
toXML in class AdminBase
Parameters:
getImage - true to include "imagedata" element with the base64 encoded image data
fullDump - true to include detailed information
framework - the current framework

fromXML

public void fromXML(org.jdom.Element rootElement)
Load the Workflow object and Step properties from XML element tree

Overrides:
fromXML in class AdminBase

fromXML

public void fromXML(org.jdom.Element rootElement,
                    boolean loadSteps)
Load the Workflow object properties from XML element tree

Parameters:
loadSteps - if true to load also Step properties

getStepXML

public java.util.Hashtable<java.lang.String,org.jdom.Element> getStepXML()
Get the Step properties loaded from the XML element tree

Returns:
a Hashtable of Steps associated to their names
See Also:
fromXML(Element, boolean)

getCreateCommand

public java.lang.String getCreateCommand(boolean force)
Return the OOQL command to create this Workflow object with the settled properties

Specified by:
getCreateCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

getSaveCommand

public java.lang.String getSaveCommand(boolean force)
Return the OOQL command to update this Workflow object with the modified properties.
If the object is new, it returns the create command.

Specified by:
getSaveCommand in class AdminBase
Parameters:
force - if true append the "force" options at the end

compareUpdate

public java.lang.String compareUpdate(Workflow refWorkflow,
                                      boolean checkImage,
                                      boolean overwrite,
                                      boolean force,
                                      Framework framework)
                               throws OberonException
Return/apply the OOQL command to update this Workflow object and let it become equals to another reference object.
This method is useful to import objects from an XML file.

Parameters:
refWorkflow - the reference Workflow object
checkImage - if true compare also the image icon
overwrite - if true update the database object instance
force - if true ignores optional properties
framework - the current framework
Throws:
OberonException
See Also:
fromXML(Element)

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.