org.enhydra.shark
Class WfProcessWrapper

java.lang.Object
  extended byorg.enhydra.shark.WfProcessWrapper
All Implemented Interfaces:
BaseBusinessObject, java.io.Serializable, WfExecutionObject, WfProcess

public class WfProcessWrapper
extends java.lang.Object
implements WfProcess, java.io.Serializable

WfProcessWrapper - Workflow Process Object implementation.

Version:
1.0.1
Author:
Sasa Bojanic, Vladimir Puskas
See Also:
Serialized Form

Field Summary
protected  java.lang.String mgrName
           
protected  java.lang.String processId
           
protected  WMSessionHandle shandle
           
 
Constructor Summary
protected WfProcessWrapper(WMSessionHandle shandle, java.lang.String mgrName, java.lang.String processId)
          Creates new WfProcessWrapper.
 
Method Summary
 void abort()
          Abort the execution of this process.
 void change_state(java.lang.String new_state)
          Method change_state
protected  void checkSecurity(java.lang.String methodName, java.util.Map d)
           
 java.lang.String description()
          Method description
 boolean equals(java.lang.Object obj)
          It is assumed that there can't be two or more processes having the same key.
 WfActivityIterator get_activities_in_state(java.lang.String state)
          Retrieve the iterator of activities in some specific state.
 WfEventAuditIterator get_iterator_history(java.lang.String query, java.util.Map names_in_query)
          Search in the history for specific elements.
 WfActivityIterator get_iterator_step()
          Retrieve the Iterator of active activities of this process.
 WfEventAudit[] get_sequence_history(int max_number)
          Getter for history sequence.
 WfActivity[] get_sequence_step(int max_number)
          Retrieve the List of activities of this process.
protected  WfProcessInternal getProcessImpl(java.lang.String procId, int mode)
           
 int hashCode()
           
 how_closedType how_closed()
          Method how_closed
 int how_many_history()
          Method how_many_history
 int how_many_step()
          Retrieve the no of activities in this process.
 boolean is_member_of_history(WfExecutionObject member)
          Checks if a 'member' is an element of the history.
 boolean is_member_of_step(WfActivity member)
          Check if some activity is a member of this process.
 java.lang.String key()
          Method key
 UtcT last_state_time()
          Method last_state_time
 WfProcessMgr manager()
          Retrieve the WfProcessMgr of this process.
 java.lang.String name()
          Method name
 short priority()
          Method priority
 java.util.Map process_context()
          Method process_context
 WfRequester requester()
          Retrieves the requestor of this process.
 java.util.Map result()
          Retrieve the result for this process.
 void resume()
          Resume this process.
 void set_description(java.lang.String new_value)
          Method set_description
 void set_name(java.lang.String new_value)
          Method set_name
 void set_priority(short new_value)
          Method set_priority
 void set_process_context(java.util.Map new_value)
          Method set_process_context
 void set_requester(WfRequester new_value)
          Set the requester for this process.
 void start()
          Starts the process - creates a separate thread.
 java.lang.String state()
          Method state
 void suspend()
          Suspend this process.
 void terminate()
          Terminate this process.
 java.lang.String toString()
          Method toString
 java.lang.String[] valid_states()
          Method valid_states
 while_openType while_open()
           
 why_not_runningType why_not_running()
          Method why_not_running
 workflow_stateType workflow_state()
          Method workflow_state
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

shandle

protected WMSessionHandle shandle

mgrName

protected java.lang.String mgrName

processId

protected java.lang.String processId
Constructor Detail

WfProcessWrapper

protected WfProcessWrapper(WMSessionHandle shandle,
                           java.lang.String mgrName,
                           java.lang.String processId)
Creates new WfProcessWrapper.

Method Detail

requester

public WfRequester requester()
                      throws java.lang.Exception
Retrieves the requestor of this process.

Specified by:
requester in interface WfProcess
Returns:
a WfRequester.
Throws:
Exception.
java.lang.Exception

set_requester

public void set_requester(WfRequester new_value)
                   throws java.lang.Exception,
                          CannotChangeRequester
Set the requester for this process.

Specified by:
set_requester in interface WfProcess
Parameters:
new_value - a WfRequester
Throws:
java.lang.Exception
CannotChangeRequester

how_many_step

public int how_many_step()
                  throws java.lang.Exception
Retrieve the no of activities in this process.

Specified by:
how_many_step in interface WfProcess
Returns:
an int
Throws:
java.lang.Exception

get_iterator_step

public WfActivityIterator get_iterator_step()
                                     throws java.lang.Exception
Retrieve the Iterator of active activities of this process.

Specified by:
get_iterator_step in interface WfProcess
Returns:
a WfActivityIterator
Throws:
java.lang.Exception

get_sequence_step

public WfActivity[] get_sequence_step(int max_number)
                               throws java.lang.Exception
Retrieve the List of activities of this process.

Specified by:
get_sequence_step in interface WfProcess
Parameters:
max_number - High limit of elements in the result set (0->all).
Returns:
a WfActivity[]
Throws:
java.lang.Exception

is_member_of_step

public boolean is_member_of_step(WfActivity member)
                          throws java.lang.Exception
Check if some activity is a member of this process.

Specified by:
is_member_of_step in interface WfProcess
Parameters:
member - a WfActivity
Returns:
true if the specific activity is a member of this process, false otherwise.
Throws:
java.lang.Exception

manager

public WfProcessMgr manager()
                     throws java.lang.Exception
Retrieve the WfProcessMgr of this process.

Specified by:
manager in interface WfProcess
Returns:
a WfProcessMgr
Throws:
java.lang.Exception

result

public java.util.Map result()
                     throws java.lang.Exception,
                            ResultNotAvailable
Retrieve the result for this process.

Specified by:
result in interface WfProcess
Returns:
a Map
Throws:
java.lang.Exception
ResultNotAvailable

start

public void start()
           throws java.lang.Exception,
                  CannotStart,
                  AlreadyRunning
Starts the process - creates a separate thread.

Specified by:
start in interface WfProcess
Throws:
java.lang.Exception
CannotStart
AlreadyRunning

get_activities_in_state

public WfActivityIterator get_activities_in_state(java.lang.String state)
                                           throws java.lang.Exception,
                                                  InvalidState
Retrieve the iterator of activities in some specific state.

Specified by:
get_activities_in_state in interface WfProcess
Parameters:
state - a String
Returns:
a WfActivityIterator
Throws:
java.lang.Exception
InvalidState

workflow_state

public workflow_stateType workflow_state()
                                  throws java.lang.Exception
Method workflow_state

Specified by:
workflow_state in interface WfExecutionObject
Returns:
a workflow_stateType
Throws:
java.lang.Exception

while_open

public while_openType while_open()
                          throws java.lang.Exception
Specified by:
while_open in interface WfExecutionObject
Throws:
java.lang.Exception

why_not_running

public why_not_runningType why_not_running()
                                    throws java.lang.Exception
Method why_not_running

Specified by:
why_not_running in interface WfExecutionObject
Returns:
a why_not_runningType
Throws:
java.lang.Exception

how_closed

public how_closedType how_closed()
                          throws java.lang.Exception
Method how_closed

Specified by:
how_closed in interface WfExecutionObject
Returns:
a how_closedType
Throws:
java.lang.Exception

valid_states

public java.lang.String[] valid_states()
                                throws java.lang.Exception
Method valid_states

Specified by:
valid_states in interface WfExecutionObject
Returns:
a String[]
Throws:
java.lang.Exception

state

public java.lang.String state()
                       throws java.lang.Exception
Method state

Specified by:
state in interface WfExecutionObject
Returns:
a String
Throws:
java.lang.Exception

change_state

public void change_state(java.lang.String new_state)
                  throws java.lang.Exception,
                         InvalidState,
                         TransitionNotAllowed
Method change_state

Specified by:
change_state in interface WfExecutionObject
Parameters:
new_state - a String
Throws:
java.lang.Exception
InvalidState
TransitionNotAllowed

name

public java.lang.String name()
                      throws java.lang.Exception
Method name

Specified by:
name in interface WfExecutionObject
Returns:
a String
Throws:
java.lang.Exception

set_name

public void set_name(java.lang.String new_value)
              throws java.lang.Exception
Method set_name

Specified by:
set_name in interface WfExecutionObject
Parameters:
new_value - a String
Throws:
java.lang.Exception

key

public java.lang.String key()
                     throws java.lang.Exception
Method key

Specified by:
key in interface WfExecutionObject
Returns:
a String
Throws:
java.lang.Exception

description

public java.lang.String description()
                             throws java.lang.Exception
Method description

Specified by:
description in interface WfExecutionObject
Returns:
a String
Throws:
java.lang.Exception

set_description

public void set_description(java.lang.String new_value)
                     throws java.lang.Exception
Method set_description

Specified by:
set_description in interface WfExecutionObject
Parameters:
new_value - a String
Throws:
java.lang.Exception

process_context

public java.util.Map process_context()
                              throws java.lang.Exception
Method process_context

Specified by:
process_context in interface WfExecutionObject
Returns:
a Map
Throws:
java.lang.Exception

set_process_context

public void set_process_context(java.util.Map new_value)
                         throws java.lang.Exception,
                                InvalidData,
                                UpdateNotAllowed
Method set_process_context

Specified by:
set_process_context in interface WfExecutionObject
Parameters:
new_value - a Map
Throws:
java.lang.Exception
InvalidData
UpdateNotAllowed

priority

public short priority()
               throws java.lang.Exception
Method priority

Specified by:
priority in interface WfExecutionObject
Returns:
a short
Throws:
java.lang.Exception

set_priority

public void set_priority(short new_value)
                  throws java.lang.Exception
Method set_priority

Specified by:
set_priority in interface WfExecutionObject
Parameters:
new_value - a short
Throws:
java.lang.Exception

resume

public void resume()
            throws java.lang.Exception,
                   CannotResume,
                   NotSuspended
Resume this process.

Specified by:
resume in interface WfExecutionObject
Throws:
java.lang.Exception
CannotResume
NotSuspended

suspend

public void suspend()
             throws java.lang.Exception,
                    CannotSuspend,
                    NotRunning,
                    AlreadySuspended
Suspend this process.

Specified by:
suspend in interface WfExecutionObject
Throws:
java.lang.Exception
CannotSuspend
NotRunning
AlreadySuspended

terminate

public void terminate()
               throws java.lang.Exception,
                      CannotStop,
                      NotRunning
Terminate this process.

Specified by:
terminate in interface WfExecutionObject
Throws:
java.lang.Exception
CannotStop
NotRunning

abort

public void abort()
           throws java.lang.Exception,
                  CannotStop,
                  NotRunning
Abort the execution of this process.

Specified by:
abort in interface WfExecutionObject
Throws:
java.lang.Exception
CannotStop
NotRunning

how_many_history

public int how_many_history()
                     throws java.lang.Exception,
                            HistoryNotAvailable
Method how_many_history

Specified by:
how_many_history in interface WfExecutionObject
Returns:
an int
Throws:
java.lang.Exception
HistoryNotAvailable

get_iterator_history

public WfEventAuditIterator get_iterator_history(java.lang.String query,
                                                 java.util.Map names_in_query)
                                          throws java.lang.Exception,
                                                 HistoryNotAvailable
Search in the history for specific elements.

Specified by:
get_iterator_history in interface WfExecutionObject
Parameters:
query - a String
names_in_query - a Map
Returns:
Found history elements that meet the search criteria.
Throws:
java.lang.Exception
HistoryNotAvailable

get_sequence_history

public WfEventAudit[] get_sequence_history(int max_number)
                                    throws java.lang.Exception,
                                           HistoryNotAvailable
Getter for history sequence.

Specified by:
get_sequence_history in interface WfExecutionObject
Parameters:
max_number - an int
Returns:
List of History objects.
Throws:
java.lang.Exception
HistoryNotAvailable

is_member_of_history

public boolean is_member_of_history(WfExecutionObject member)
                             throws java.lang.Exception
Checks if a 'member' is an element of the history.

Specified by:
is_member_of_history in interface WfExecutionObject
Parameters:
member - a WfExecutionObject
Returns:
true if the element of the history, false otherwise.
Throws:
java.lang.Exception

last_state_time

public UtcT last_state_time()
                     throws java.lang.Exception
Method last_state_time

Specified by:
last_state_time in interface WfExecutionObject
Returns:
an UtcT
Throws:
java.lang.Exception

toString

public java.lang.String toString()
Method toString

Returns:
a String

equals

public boolean equals(java.lang.Object obj)
It is assumed that there can't be two or more processes having the same key.


hashCode

public int hashCode()

checkSecurity

protected void checkSecurity(java.lang.String methodName,
                             java.util.Map d)
                      throws java.lang.Exception
Throws:
java.lang.Exception

getProcessImpl

protected WfProcessInternal getProcessImpl(java.lang.String procId,
                                           int mode)
                                    throws java.lang.Exception
Throws:
java.lang.Exception