OBEROn SDK

com.oberon.ooql.sdk
Class Process

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

public class Process
extends OBBase

Process Object: defines running workflow instance.

Version:
5.0
See Also:
Serialized Form

Field Summary
 java.lang.String application
          The application name to witch this process is related
 java.lang.String username
          User who start the process
 
Constructor Summary
Process()
           
Process(java.lang.String workflowName)
          Create new process for a specific Workflow
 
Method Summary
 void addObject(java.lang.String objectID)
          Submit a ObjectObj to the Process
 void addObject(java.lang.String objectClass, java.lang.String objectName, java.lang.String objectRevision)
          Submit a ObjectObj to the Process
 void clearParameters()
          Remove all Process global Parameters.
 void completeStep(ProcessStep step, java.util.Vector<java.lang.String> choices, Framework framework)
          Complete a running step by current framework user
 void fromXML(org.jdom.Element rootElement)
          Load the Process object properties from XML element tree
 java.lang.String getApplication()
          Get the application Menu name.
 java.lang.String getLogFilePath()
          Get the Log File Path
 java.lang.String getName()
          Get the process ID
 java.util.Vector<java.lang.Object> getObjects()
          Get the associated ObjectObjs.
 java.util.Hashtable<java.lang.String,java.lang.String> getParameters()
          Get the Process global Parameters.
 ObjectObj getPrimaryObject()
          Get the primary ObjectObj associated to the Process
 java.lang.String getPrimaryObjectId()
          Get the primary ObjectObj ID associated to the Process
 ProcessStep getProcessStep(java.lang.String stepName)
          Get a Process Step with the given name
 ProcessStep getProcessStepAt(int index)
          Get a Process Step at given position index
 ProcessStep getProcessStepFromId(int stepId)
          Get a Process Step with the given internal id
 java.util.Vector<java.lang.String> getProcessStepNames()
          Get all Process Step names
 int getProcessStepPos(java.lang.String stepName)
          Get the ProcessStep position index in the Process step sequence
 java.util.Vector<ProcessStep> getProcessSteps()
          Get all Process Steps
 java.lang.String getProcessStepsAsString(java.lang.String delim)
          Get all Process Step names as a single string
 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 Process object by its OOQL identifier
 java.util.Vector<java.lang.String> getRunningStepNames()
          Get the Process running Step names
 java.lang.String getSaveCommand()
          Return the OOQL command to update this Process object with the modified properties.
 java.lang.String getStartCommand(java.lang.String holder)
          Return the OOQL command to start this Process with the settled properties
 java.lang.String getStartDateTime()
          Get the Process Start Date/Time
 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
 java.lang.String getUser()
          Get the User who start the process
 java.lang.String getWorkflow()
          Get the related Workflow name
 void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the Process object: connect the memory instance with the database instance
static void list(Selector selector, java.io.DataOutputStream outStream, Framework framework)
          List the active Processes
static Process open(java.lang.String id, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
          Open the process and read properties from the database
 void removeParameter(java.lang.String parameter)
          Remove a parameter from the Process global Parameters.
static void restartMonitor(Framework framework)
          ReStart the process monitor Only super users can perform this operation
 void resume(Framework framework)
          Resume the Process suspended steps
 void setId(int pId)
          Set the process ID
 void setLogFilePath(java.lang.String path)
          Set the Log File Path
 void setParameter(java.lang.String parameter, java.lang.String value)
          Set a Process global Parameter.
 void setParameters(java.util.Hashtable<java.lang.String,?> parameters)
          Set the Process execution global Parameters.
 void setPrimaryObject(ObjectObj objectObj)
          Set the primary ObjectObj for the Process
 void setPrimaryObject(java.lang.String objectID)
          Set the primary ObjectObj for the Process
 void setPrimaryObject(java.lang.String objectClass, java.lang.String objectName, java.lang.String objectRevision)
          Set the primary ObjectObj for the Process
 void setProcessSteps(java.util.Vector<ProcessStep> steps)
          Set all Process Steps
 void setStartDateTime(java.lang.String datetime)
          Set the Process Start Date/Time
 void setWorkflow(java.lang.String workflowName)
          Link the Process with the related Workflow name
 void show(Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the Process properties
static void show(java.lang.String code, Selector selector, java.io.DataOutputStream outStream, Framework framework)
          Show the properties for the given Process
 void start(Framework framework, java.util.Hashtable<java.lang.String,?> args)
          Execute the Process
 void start(java.lang.String holder, Framework framework, java.util.Hashtable<java.lang.String,?> args)
          Execute the Process
static void startMonitor(Framework framework)
          Start the process monitor Only super users can perform this operation
 void stop(Framework framework)
          Stop the Process
static void stopMonitor(Framework framework)
          Stop the process monitor Only super users can perform this operation
 void suspend(Framework framework)
          Suspend all Process running steps
 java.lang.String toString()
          Return the Process object basic properties as a single String
 java.lang.String toString(Framework framework)
          Return the Process object extended properties as a single String
 org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
          Return the Process object properties as XML element tree
 org.jdom.Element toXML(Framework framework)
          Return the Process object properties as XML element tree
 void update(Framework framework)
          Update a running process
 void updateStep(ProcessStep step, Framework framework)
          Update a running step
 
Methods inherited from class com.oberon.ooql.sdk.OBBase
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setLinked
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

application

public java.lang.String application
The application name to witch this process is related


username

public java.lang.String username
User who start the process

Constructor Detail

Process

public Process()

Process

public Process(java.lang.String workflowName)
        throws OberonException
Create new process for a specific Workflow

Parameters:
workflowName - the Workflow name
Throws:
OberonException - if the name contains invalid characters
Method Detail

setId

public void setId(int pId)
Set the process ID

Overrides:
setId in class OBBase

getName

public java.lang.String getName()
Get the process ID

Specified by:
getName in class OBBase

getUser

public java.lang.String getUser()
Get the User who start the process


getApplication

public java.lang.String getApplication()
Get the application Menu name.

Since:
2.2_01

open

public static Process open(java.lang.String id,
                           Framework framework,
                           java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
                    throws OberonException
Open the process and read properties from the database

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

link

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

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

start

public void start(Framework framework,
                  java.util.Hashtable<java.lang.String,?> args)
           throws OberonException
Execute the Process

Parameters:
framework - the current framework
args - vector of Process input arguments
Throws:
OberonException - due to startup errors or programmatically raised exceptions

start

public void start(java.lang.String holder,
                  Framework framework,
                  java.util.Hashtable<java.lang.String,?> args)
           throws OberonException
Execute the Process

Parameters:
holder - set the process holder
framework - the current framework
args - vector of Process input arguments
Throws:
OberonException - due to startup errors or programmatically raised exceptions
Since:
2.1

update

public void update(Framework framework)
            throws OberonException
Update a running process

Parameters:
framework - the current framework
Throws:
OberonException - due to startup errors or programmatically raised exceptions

updateStep

public void updateStep(ProcessStep step,
                       Framework framework)
                throws OberonException
Update a running step

Parameters:
step - the process step
framework - the current framework
Throws:
OberonException - due to startup errors or programmatically raised exceptions

completeStep

public void completeStep(ProcessStep step,
                         java.util.Vector<java.lang.String> choices,
                         Framework framework)
                  throws OberonException
Complete a running step by current framework user

Parameters:
step - the process step
choices - vector of transition names representing the user choices
framework - the current framework
Throws:
OberonException - due to startup errors or programmatically raised exceptions

suspend

public void suspend(Framework framework)
             throws OberonException
Suspend all Process running steps

Parameters:
framework - the current framework
Throws:
OberonException - due to shut down errors

resume

public void resume(Framework framework)
            throws OberonException
Resume the Process suspended steps

Parameters:
framework - the current framework
Throws:
OberonException - due to shut down errors
Since:
2.1.07

stop

public void stop(Framework framework)
          throws OberonException
Stop the Process

Parameters:
framework - the current framework
Throws:
OberonException - due to shut down errors
Since:
2.1.07

show

public void show(Selector selector,
                 java.io.DataOutputStream outStream,
                 Framework framework)
          throws java.io.IOException,
                 OberonException
Show the Process properties

Parameters:
selector - selection parameters (if null return all the object properties)
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
See Also:
Framework.getResult()

show

public static void show(java.lang.String code,
                        Selector selector,
                        java.io.DataOutputStream outStream,
                        Framework framework)
                 throws java.io.IOException,
                        OberonException
Show the properties for the given Process

Parameters:
code - the Process reference code
selector - selection parameters (if null return all the process properties)
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException - for all other problems
Since:
4.0
See Also:
Framework.getResult()

list

public static void list(Selector selector,
                        java.io.DataOutputStream outStream,
                        Framework framework)
                 throws java.io.IOException,
                        OberonException
List the active Processes

Parameters:
selector - selection parameters (if null return the Process ids)
outStream - the stream for the results (if null the result is stored into the framework)
framework - the current framework
Throws:
java.io.IOException - when the output stream return an exception
OberonException
See Also:
Framework.getResult()

startMonitor

public static void startMonitor(Framework framework)
                         throws OberonException
Start the process monitor Only super users can perform this operation

Parameters:
framework - the current framework
Throws:
OberonException

restartMonitor

public static void restartMonitor(Framework framework)
                           throws OberonException
ReStart the process monitor Only super users can perform this operation

Parameters:
framework - the current framework
Throws:
OberonException

stopMonitor

public static void stopMonitor(Framework framework)
                        throws OberonException
Stop the process monitor Only super users can perform this operation

Parameters:
framework - the current framework
Throws:
OberonException

setWorkflow

public void setWorkflow(java.lang.String workflowName)
Link the Process with the related Workflow name


getWorkflow

public java.lang.String getWorkflow()
Get the related Workflow name


setStartDateTime

public void setStartDateTime(java.lang.String datetime)
Set the Process Start Date/Time

Parameters:
datetime - the start date/time (timezone: GMT) valid formats are: "yyyy-MM-dd HH:mm" "yyyy-MM-dd HH:mm:ss"

getStartDateTime

public java.lang.String getStartDateTime()
Get the Process Start Date/Time

Returns:
the start date/time

setLogFilePath

public void setLogFilePath(java.lang.String path)
Set the Log File Path

Parameters:
path - the file full path for log process info

getLogFilePath

public java.lang.String getLogFilePath()
Get the Log File Path


setPrimaryObject

public void setPrimaryObject(ObjectObj objectObj)
Set the primary ObjectObj for the Process

Parameters:
objectObj - the ObjectObj
Since:
4.2

setPrimaryObject

public void setPrimaryObject(java.lang.String objectID)
Set the primary ObjectObj for the Process

Parameters:
objectID - the ObjectObj ID
Since:
4.2

setPrimaryObject

public void setPrimaryObject(java.lang.String objectClass,
                             java.lang.String objectName,
                             java.lang.String objectRevision)
Set the primary ObjectObj for the Process

Parameters:
objectClass - the ObjectObj Class name
objectName - the ObjectObj Name
objectRevision - the ObjectObj Revision
Since:
4.2

getPrimaryObject

public ObjectObj getPrimaryObject()
Get the primary ObjectObj associated to the Process

Returns:
the ObjectObj
Since:
4.2

getPrimaryObjectId

public java.lang.String getPrimaryObjectId()
Get the primary ObjectObj ID associated to the Process

Returns:
the ObjectObj ID
Since:
4.2

addObject

public void addObject(java.lang.String objectID)
Submit a ObjectObj to the Process

Parameters:
objectID - the ObjectObj ID
Since:
2.1

addObject

public void addObject(java.lang.String objectClass,
                      java.lang.String objectName,
                      java.lang.String objectRevision)
Submit a ObjectObj to the Process

Parameters:
objectClass - the ObjectObj Class name
objectName - the ObjectObj Name
objectRevision - the ObjectObj Revision
Since:
2.1

getObjects

public java.util.Vector<java.lang.Object> getObjects()
Get the associated ObjectObjs.

Returns:
a Vector of String { ObjectObj ID } or String[3] {Class-name, name, revision}
Since:
2.1

setParameters

public void setParameters(java.util.Hashtable<java.lang.String,?> parameters)
Set the Process execution 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 Process 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 Process global Parameters.

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

clearParameters

public void clearParameters()
Remove all Process global Parameters.

Since:
2.2_01

getParameters

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

Returns:
Hashtable where the parameter names are the keys

setProcessSteps

public void setProcessSteps(java.util.Vector<ProcessStep> steps)
Set all Process Steps

Parameters:
steps - a Vector of ProcessSteps

getProcessStepPos

public int getProcessStepPos(java.lang.String stepName)
Get the ProcessStep position index in the Process step sequence

Returns:
the position index or -1 if not found

getProcessSteps

public java.util.Vector<ProcessStep> getProcessSteps()
Get all Process Steps

Returns:
a Vector of ProcessSteps

getProcessStepAt

public ProcessStep getProcessStepAt(int index)
Get a Process Step at given position index


getProcessStep

public ProcessStep getProcessStep(java.lang.String stepName)
Get a Process Step with the given name


getProcessStepFromId

public ProcessStep getProcessStepFromId(int stepId)
Get a Process Step with the given internal id


getProcessStepNames

public java.util.Vector<java.lang.String> getProcessStepNames()
Get all Process Step names

Returns:
a Vector ProcessStep names

getRunningStepNames

public java.util.Vector<java.lang.String> getRunningStepNames()
Get the Process running Step names

Returns:
a Vector ProcessStep names
Since:
2.1

getProcessStepsAsString

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

Parameters:
delim - the ProcessStep name separator

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 Process object by its OOQL identifier

Specified by:
getProperty in class OBBase
Parameters:
propertyName - OOQL property identifier/name (example: workflow , startdate ...)
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
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 Process object basic properties as a single String

Overrides:
toString in class java.lang.Object

toString

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

Parameters:
framework - the current framework

toXML

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

Parameters:
framework - the current framework

toXML

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

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 Process object properties from XML element tree


getStartCommand

public java.lang.String getStartCommand(java.lang.String holder)
Return the OOQL command to start this Process with the settled properties

Parameters:
holder - the assigned holder
Since:
4.0

getSaveCommand

public java.lang.String getSaveCommand()
Return the OOQL command to update this Process object with the modified properties.

Since:
4.0

OBEROn SDK

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