OBEROn SDK

com.oberon.ooql.sdk
Class Trigger

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

public class Trigger
extends Program

Class used to let Programs work as event triggers.

Version:
5.0
See Also:
Serialized Form

Field Summary
static int CLASS_ADDLINK
          Class event: Connect a ObjectObj instance with another
static int CLASS_CHANGECLASS
          Class event: Change the ObjectObj's Class
static int CLASS_CHANGEDESCR
          Class event: Change the ObjectObj's description
static int CLASS_CHANGEFIELD
          Class event: Change the ObjectObj's field values
static int CLASS_CHANGEHOLDER
          Class event: Change the ObjectObj's holder
static int CLASS_CHANGELIFECYCLE
          Class event: Change the ObjectObj's Lifecycle
static int CLASS_CHANGENAME
          Class event: Change the ObjectObj's name / revision
static int CLASS_CHANGESPACE
          Class event: Move the ObjectObj between two ObjectSpaces
static int CLASS_CLONE
          Class event: Clone a ObjectObj instance
static int CLASS_CREATE
          Class event: Create new ObjectObj instance
static int CLASS_DELEGATE
          Class event: Delegate access to a ObjectObj instance
static int CLASS_DESTROY
          Class event: Destroy an ObjectObj instance
static int CLASS_FILEDELETE
          Class event: Remove file from an ObjectObj instance
static int CLASS_FILEGET
          Class event: Extract a file from an ObjectObj instance
static int CLASS_FILELOCK
          Class event: Lock file for an ObjectObj instance
static int CLASS_FILEPUT
          Class event: Attach new file to an ObjectObj instance
static int CLASS_FILERENAME
          Class event: Rename an ObjectObj's file
static int CLASS_FILEUNLOCK
          Class event: Unlock file for an ObjectObj instance
static int CLASS_LOCK
          Class event: Lock an ObjectObj
static int CLASS_REMOVELINK
          Class event: Disconnect a ObjectObj instance from another
static int CLASS_REVISE
          Class event: Revise an ObjectObj instance
static int CLASS_REVOKE
          Class event: Revoke delegation for a ObjectObj instance
static int CLASS_UNDO
          Class event: Undo the latest ObjectObj edit operation
static int CLASS_UNLOCK
          Class event: Remove the lock from an ObjectObj
static int EVENT_ACTION
          Perform actions after the event
static int EVENT_CHECK
          Check conditions before the event
static int EVENT_WORKFLOW
          Perform actions after the event
static int FIELD_EDIT
          Field event: Edit
static int FORMITEM_DISABLED
          Form event: Item disabled condition
static int FORMITEM_EDITABLE
          Form event: Item editable condition
static int FORMITEM_REQUIRED
          Form event: Item required condition
static int FORMITEM_VISIBLE
          Form event: Item visible condition
static int LIFECYCLE_IGNORE
          Lifecycle-Stage event: Ignore a stage Validation
static int LIFECYCLE_PROGRESS
          Lifecycle-Stage event: Go to the next Stage
static int LIFECYCLE_REFUSE
          Lifecycle-Stage event: Refuse a stage Validation
static int LIFECYCLE_REGRESS
          Lifecycle-Stage event: Return to the previous Stage
static int LIFECYCLE_SETSTAGE
          Lifecycle-Stage event: Set the Stage for a object
static int LIFECYCLE_VALIDATE
          Lifecycle-Stage event: Validate e stage Validation
static int LINK_CHANGETYPE
          LinkType event: Change the link type
static int LINK_CONNECT
          LinkType event: Create new Link between two ObjectObj instances
static int LINK_DISCONNECT
          LinkType event: Remove a Link between two ObjectObj instances
static int LINK_MODHOLDER
          LinkType event: Change the Link's holder
static int LINK_RESTORE
          LinkType event: Undo the latest Link edit operation
static int LINK_UPDATE
          LinkType event: Edit Link fields
static int PROCESS_CHGSTEPSTATE
          Process event: step change state
static int PROCESS_DECISION
          Process event: step decision
static int PROCESS_TRANSITION
          Process event: step transition
static int PROCESS_USERCOMPLETION
          Process event: step completed by user
static int VIEWCOL_MODIFIABLE
          View event: Column editable condition
static int VIEWCOL_SEEABLE
          View event: Column visible condition
 
Fields inherited from class com.oberon.ooql.sdk.Program
CLASSNAME, EXTEND
 
Fields inherited from class com.oberon.ooql.sdk.AdminBase
bsOptions, HIDDEN_OPTION
 
Constructor Summary
Trigger()
           
Trigger(java.lang.String name)
           
Trigger(java.lang.String name, int event, int type)
           
Trigger(java.lang.String name, int event, int type, java.util.Vector<java.lang.String> args)
           
Trigger(java.lang.String composedName, java.lang.String args)
          [INTERNAL USAGE]
 
Method Summary
static java.lang.String argsToCommandString(java.util.Vector<?> vArgs, boolean bWorkflow)
           
 java.lang.String asString()
          Return the Trigger properties as a single String [INTERNAL USAGE]
 boolean equals(Trigger trigger)
          Check if this Trigger is equal to another (only event/type comparison)
 boolean equals(Trigger trigger, boolean fullMatch)
          Check if this Trigger is equal to another
 void execute(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Object> args)
          Execute the Trigger
 void execute(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Object> args, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Execute the Trigger
 void fromXML(org.jdom.Element rootElement)
          Load the Trigger properties from XML element tree
 java.util.Vector<java.lang.Object> getArgs()
          Get the Program input arguments
 java.lang.String getArgString()
          Get the Program input arguments as String [INTERNAL USAGE]
 int getEvent()
          Get the Trigger event
 java.lang.String getEventAsString()
          Get the Trigger event as OOQL string
static java.lang.String getEventAsString(int event)
          Get the Trigger event as OOQL equivalent String
static int getEventFromString(java.lang.String event)
          Get the Trigger event from the equivalent OOQL String
 int getType()
          Get the Trigger type
 java.lang.String getTypeAsString()
          Get the Trigger type as OOQL string
static java.lang.String getTypeAsString(int type)
          Get the Trigger type as OOQL equivalent String
static int getTypeFromString(java.lang.String triggerType)
          Get the Trigger type from the equivalent OOQL String
static int indexOf(java.util.Vector<Trigger> triggers, Trigger trigger)
          Search a Trigger into a trigger set (only event/type comparison)
static int indexOf(java.util.Vector<Trigger> triggers, Trigger trigger, boolean fullMatch)
          Search a Trigger into a trigger set
 void setArgs(java.util.Vector<java.lang.String> args)
          Set the Program input arguments
 void setArgString(java.lang.String args)
          Get the Program input arguments [INTERNAL USAGE]
 void setEvent(int event)
          Set the Trigger event
 void setParameters(java.util.Hashtable<java.lang.String,java.lang.String> parameters)
          Set the Workflow execution arguments
 void setType(int type)
          Set the Trigger type
 java.lang.String toString()
          Return the Trigger properties as a single String
 java.lang.String toString(java.lang.String indent)
          Return the Trigger properties as a single String
 
Methods inherited from class com.oberon.ooql.sdk.Program
compareSimple, compareUpdate, compile, compile, create, create, destroy, execute, getCreateCommand, getCreateCommand, getJavaClass, getOwnSubPrograms, getOwnSubProgramsAsString, getProperty, getSaveCommand, getSourceCode, getSubPrograms, getSubProgramsAsString, getSuper, getTargetNames, invoke, link, open, parseArgs, setJavaClass, setName, setSourceCode, setSourceFile, toString, toXML, toXML, unlink, write, write
 
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, 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
 

Field Detail

FIELD_EDIT

public static final int FIELD_EDIT
Field event: Edit

See Also:
Constant Field Values

CLASS_CREATE

public static final int CLASS_CREATE
Class event: Create new ObjectObj instance

See Also:
Constant Field Values

CLASS_CLONE

public static final int CLASS_CLONE
Class event: Clone a ObjectObj instance

See Also:
Constant Field Values

CLASS_CHANGESPACE

public static final int CLASS_CHANGESPACE
Class event: Move the ObjectObj between two ObjectSpaces

See Also:
Constant Field Values

CLASS_CHANGECLASS

public static final int CLASS_CHANGECLASS
Class event: Change the ObjectObj's Class

See Also:
Constant Field Values

CLASS_CHANGENAME

public static final int CLASS_CHANGENAME
Class event: Change the ObjectObj's name / revision

See Also:
Constant Field Values

CLASS_CHANGEHOLDER

public static final int CLASS_CHANGEHOLDER
Class event: Change the ObjectObj's holder

See Also:
Constant Field Values

CLASS_CHANGELIFECYCLE

public static final int CLASS_CHANGELIFECYCLE
Class event: Change the ObjectObj's Lifecycle

See Also:
Constant Field Values

CLASS_CHANGEDESCR

public static final int CLASS_CHANGEDESCR
Class event: Change the ObjectObj's description

See Also:
Constant Field Values

CLASS_CHANGEFIELD

public static final int CLASS_CHANGEFIELD
Class event: Change the ObjectObj's field values

See Also:
Constant Field Values

CLASS_FILEPUT

public static final int CLASS_FILEPUT
Class event: Attach new file to an ObjectObj instance

See Also:
Constant Field Values

CLASS_FILEGET

public static final int CLASS_FILEGET
Class event: Extract a file from an ObjectObj instance

See Also:
Constant Field Values

CLASS_FILERENAME

public static final int CLASS_FILERENAME
Class event: Rename an ObjectObj's file

See Also:
Constant Field Values

CLASS_FILEDELETE

public static final int CLASS_FILEDELETE
Class event: Remove file from an ObjectObj instance

See Also:
Constant Field Values

CLASS_ADDLINK

public static final int CLASS_ADDLINK
Class event: Connect a ObjectObj instance with another

See Also:
Constant Field Values

CLASS_REMOVELINK

public static final int CLASS_REMOVELINK
Class event: Disconnect a ObjectObj instance from another

See Also:
Constant Field Values

CLASS_LOCK

public static final int CLASS_LOCK
Class event: Lock an ObjectObj

See Also:
Constant Field Values

CLASS_UNLOCK

public static final int CLASS_UNLOCK
Class event: Remove the lock from an ObjectObj

See Also:
Constant Field Values

CLASS_REVISE

public static final int CLASS_REVISE
Class event: Revise an ObjectObj instance

See Also:
Constant Field Values

CLASS_DESTROY

public static final int CLASS_DESTROY
Class event: Destroy an ObjectObj instance

See Also:
Constant Field Values

CLASS_DELEGATE

public static final int CLASS_DELEGATE
Class event: Delegate access to a ObjectObj instance

See Also:
Constant Field Values

CLASS_REVOKE

public static final int CLASS_REVOKE
Class event: Revoke delegation for a ObjectObj instance

See Also:
Constant Field Values

CLASS_UNDO

public static final int CLASS_UNDO
Class event: Undo the latest ObjectObj edit operation

See Also:
Constant Field Values

CLASS_FILELOCK

public static final int CLASS_FILELOCK
Class event: Lock file for an ObjectObj instance

See Also:
Constant Field Values

CLASS_FILEUNLOCK

public static final int CLASS_FILEUNLOCK
Class event: Unlock file for an ObjectObj instance

See Also:
Constant Field Values

LINK_CONNECT

public static final int LINK_CONNECT
LinkType event: Create new Link between two ObjectObj instances

See Also:
Constant Field Values

LINK_CHANGETYPE

public static final int LINK_CHANGETYPE
LinkType event: Change the link type

See Also:
Constant Field Values

LINK_UPDATE

public static final int LINK_UPDATE
LinkType event: Edit Link fields

See Also:
Constant Field Values

LINK_DISCONNECT

public static final int LINK_DISCONNECT
LinkType event: Remove a Link between two ObjectObj instances

See Also:
Constant Field Values

LINK_RESTORE

public static final int LINK_RESTORE
LinkType event: Undo the latest Link edit operation

See Also:
Constant Field Values

LINK_MODHOLDER

public static final int LINK_MODHOLDER
LinkType event: Change the Link's holder

See Also:
Constant Field Values

LIFECYCLE_VALIDATE

public static final int LIFECYCLE_VALIDATE
Lifecycle-Stage event: Validate e stage Validation

See Also:
Constant Field Values

LIFECYCLE_IGNORE

public static final int LIFECYCLE_IGNORE
Lifecycle-Stage event: Ignore a stage Validation

See Also:
Constant Field Values

LIFECYCLE_REFUSE

public static final int LIFECYCLE_REFUSE
Lifecycle-Stage event: Refuse a stage Validation

See Also:
Constant Field Values

LIFECYCLE_SETSTAGE

public static final int LIFECYCLE_SETSTAGE
Lifecycle-Stage event: Set the Stage for a object

See Also:
Constant Field Values

LIFECYCLE_PROGRESS

public static final int LIFECYCLE_PROGRESS
Lifecycle-Stage event: Go to the next Stage

See Also:
Constant Field Values

LIFECYCLE_REGRESS

public static final int LIFECYCLE_REGRESS
Lifecycle-Stage event: Return to the previous Stage

See Also:
Constant Field Values

FORMITEM_VISIBLE

public static final int FORMITEM_VISIBLE
Form event: Item visible condition

See Also:
Constant Field Values

FORMITEM_EDITABLE

public static final int FORMITEM_EDITABLE
Form event: Item editable condition

See Also:
Constant Field Values

FORMITEM_REQUIRED

public static final int FORMITEM_REQUIRED
Form event: Item required condition

See Also:
Constant Field Values

FORMITEM_DISABLED

public static final int FORMITEM_DISABLED
Form event: Item disabled condition

See Also:
Constant Field Values

VIEWCOL_SEEABLE

public static final int VIEWCOL_SEEABLE
View event: Column visible condition

See Also:
Constant Field Values

VIEWCOL_MODIFIABLE

public static final int VIEWCOL_MODIFIABLE
View event: Column editable condition

See Also:
Constant Field Values

PROCESS_TRANSITION

public static final int PROCESS_TRANSITION
Process event: step transition

See Also:
Constant Field Values

PROCESS_USERCOMPLETION

public static final int PROCESS_USERCOMPLETION
Process event: step completed by user

See Also:
Constant Field Values

PROCESS_DECISION

public static final int PROCESS_DECISION
Process event: step decision

See Also:
Constant Field Values

PROCESS_CHGSTEPSTATE

public static final int PROCESS_CHGSTEPSTATE
Process event: step change state

See Also:
Constant Field Values

EVENT_CHECK

public static final int EVENT_CHECK
Check conditions before the event

See Also:
Constant Field Values

EVENT_ACTION

public static final int EVENT_ACTION
Perform actions after the event

See Also:
Constant Field Values

EVENT_WORKFLOW

public static final int EVENT_WORKFLOW
Perform actions after the event

See Also:
Constant Field Values
Constructor Detail

Trigger

public Trigger()

Trigger

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

Trigger

public Trigger(java.lang.String name,
               int event,
               int type)
        throws OberonException
Parameters:
name - the name of the administrative object
event - the Trigger event
type - the Trigger type
Throws:
OberonException - if the name contains invalid characters

Trigger

public Trigger(java.lang.String name,
               int event,
               int type,
               java.util.Vector<java.lang.String> args)
        throws OberonException
Parameters:
name - the name of the administrative object
event - the Trigger event
type - the Trigger type
args - the Program input arguments
Throws:
OberonException - if the name contains invalid characters

Trigger

public Trigger(java.lang.String composedName,
               java.lang.String args)
[INTERNAL USAGE]

Parameters:
composedName - name|event|type
args - the Program input arguments
Method Detail

setEvent

public void setEvent(int event)
Set the Trigger event


getEvent

public int getEvent()
Get the Trigger event


getEventAsString

public java.lang.String getEventAsString()
Get the Trigger event as OOQL string


setType

public void setType(int type)
Set the Trigger type


getType

public int getType()
Get the Trigger type


getTypeAsString

public java.lang.String getTypeAsString()
Get the Trigger type as OOQL string


setParameters

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


setArgs

public void setArgs(java.util.Vector<java.lang.String> args)
Set the Program input arguments


getArgs

public java.util.Vector<java.lang.Object> getArgs()
Get the Program input arguments


setArgString

public void setArgString(java.lang.String args)
Get the Program input arguments [INTERNAL USAGE]


getArgString

public java.lang.String getArgString()
Get the Program input arguments as String [INTERNAL USAGE]


execute

public void execute(Framework framework,
                    java.util.Hashtable<java.lang.String,java.lang.Object> args)
             throws OberonException
Execute the Trigger

Parameters:
framework - the current framework
args - the Trigger argument hashtable Trigger argument hashtable become the first element of the Program input argument vector
Throws:
OberonException - due to execution errors or to programmatically raised exceptions

execute

public void execute(Framework framework,
                    java.util.Hashtable<java.lang.String,java.lang.Object> args,
                    java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
             throws OberonException
Execute the Trigger

Parameters:
framework - the current framework
args - the Trigger argument hashtable
counters - administrative object synch counters (if null read them from database) Trigger argument hashtable become the first element of the Program input argument vector Trigger can run only at DB level (DBConnections)
Throws:
OberonException - due to execution errors or to programmatically raised exceptions

equals

public boolean equals(Trigger trigger,
                      boolean fullMatch)
Check if this Trigger is equal to another

Parameters:
trigger - the Trigger to compare with this Trigger
fullMatch - if false check only the trigger event and type otherwise check also the name and the Program arguments

equals

public boolean equals(Trigger trigger)
Check if this Trigger is equal to another (only event/type comparison)

Parameters:
trigger - the Trigger to compare with this Trigger

indexOf

public static int indexOf(java.util.Vector<Trigger> triggers,
                          Trigger trigger,
                          boolean fullMatch)
Search a Trigger into a trigger set

Parameters:
triggers - a Vector of Triggers (the set)
trigger - the trigger to search
fullMatch - if false check only the trigger event and type otherwise check also the name and the Program arguments

indexOf

public static int indexOf(java.util.Vector<Trigger> triggers,
                          Trigger trigger)
Search a Trigger into a trigger set (only event/type comparison)

Parameters:
triggers - a Vector of Triggers (the set)
trigger - the trigger to search

getEventAsString

public static java.lang.String getEventAsString(int event)
Get the Trigger event as OOQL equivalent String


getEventFromString

public static int getEventFromString(java.lang.String event)
Get the Trigger event from the equivalent OOQL String

Returns:
one of the EVENT constant or -1 if the type is not recognized

getTypeAsString

public static java.lang.String getTypeAsString(int type)
Get the Trigger type as OOQL equivalent String


getTypeFromString

public static int getTypeFromString(java.lang.String triggerType)
Get the Trigger type from the equivalent OOQL String

Returns:
one of the TYPE constant or -1 if the type is not recognized

toString

public java.lang.String toString()
Return the Trigger properties as a single String

Overrides:
toString in class Program

toString

public java.lang.String toString(java.lang.String indent)
Return the Trigger properties as a single String

Parameters:
indent - set the row indent chars

asString

public java.lang.String asString()
Return the Trigger properties as a single String [INTERNAL USAGE]


fromXML

public void fromXML(org.jdom.Element rootElement)
Load the Trigger properties from XML element tree

Overrides:
fromXML in class Program

argsToCommandString

public static java.lang.String argsToCommandString(java.util.Vector<?> vArgs,
                                                   boolean bWorkflow)

OBEROn SDK

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