org.enhydra.shark
Class WfActivityWrapper

java.lang.Object
  extended by org.enhydra.shark.WfActivityWrapper
All Implemented Interfaces:
java.io.Serializable, BaseBusinessObject, WfActivity, WfExecutionObject, WfRequester

public class WfActivityWrapper
extends java.lang.Object
implements WfActivity, java.io.Serializable

WfActivityWrapper - Workflow Activity Object implementation

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

Field Summary
protected  java.lang.String id
           
protected  java.lang.String mgrName
           
protected  java.lang.String processId
           
protected  WMSessionHandle shandle
           
 
Constructor Summary
protected WfActivityWrapper(WMSessionHandle shandle, java.lang.String mgrName, java.lang.String processId, java.lang.String id)
          Create a new WfActivityWrapper
 
Method Summary
 void abort()
          Abort the execution of this process or activity.
 void change_state(java.lang.String new_state)
           
protected  void checkSecurity(java.lang.String methodName, java.util.Map d)
           
 void complete()
          Complete this activity.
 WfProcess container()
          Getter for the process of this activity.
 java.lang.String description()
           
 boolean equals(java.lang.Object obj)
          It is assumed that there can't be two or more activities having the same key.
 WfAssignmentIterator get_iterator_assignment()
          Retrieve the Iterator of Assignments objects.
 WfEventAuditIterator get_iterator_history(java.lang.String query, java.util.Map names_in_query)
          Search in the history for specific elements.
 WfProcessIterator get_iterator_performer()
          Gets an iterator of processes.
 WfAssignment[] get_sequence_assignment(int max_number)
          Retrieve all assignments of this activity.
 WfEventAudit[] get_sequence_history(int max_number)
          Getter for history sequence.
 WfProcess[] get_sequence_performer(int max_number)
          A list of processes
protected  WfActivityInternal getActivityImpl(java.lang.String procId, java.lang.String actId, int mode)
           
 int hashCode()
           
 how_closedType how_closed()
          Method how_closed
 int how_many_assignment()
          Retrieve the no. of Assignment objects.
 int how_many_history()
           
 int how_many_performer()
          Gets the number of processes.
 boolean is_member_of_assignment(WfAssignment member)
          Check if a specific assignment is a member of this activity.
 boolean is_member_of_history(WfExecutionObject member)
          Predicate to check if a 'member' is an element of the history.
 boolean is_member_of_performer(WfProcess member)
          Checks if a WfProcess is associated with this requester object
 java.lang.String key()
           
 UtcT last_state_time()
           
 java.lang.String name()
           
 short priority()
           
 java.util.Map process_context()
           
 void receive_event(WfEventAudit event)
           
 java.util.Map result()
          Retrieve the Result map of this activity.
 void resume()
          Resume this process or activity.
 void set_description(java.lang.String new_value)
           
 void set_name(java.lang.String new_value)
           
 void set_priority(short new_value)
           
 void set_process_context(java.util.Map new_value)
           
 void set_result(java.util.Map results)
          Assign Result for this activity.
 java.lang.String state()
           
 void suspend()
          Suspend this process or activity.
 void terminate()
          Terminate this process or activity.
 java.lang.String toString()
          Method toString
 java.lang.String[] 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

id

protected java.lang.String id
Constructor Detail

WfActivityWrapper

protected WfActivityWrapper(WMSessionHandle shandle,
                            java.lang.String mgrName,
                            java.lang.String processId,
                            java.lang.String id)
Create a new WfActivityWrapper

Method Detail

how_many_assignment

public int how_many_assignment()
                        throws java.lang.Exception
Retrieve the no. of Assignment objects.

Specified by:
how_many_assignment in interface WfActivity
Returns:
No. of current assignments.
Throws:
java.lang.Exception - General workflow exception.

get_iterator_assignment

public WfAssignmentIterator get_iterator_assignment()
                                             throws java.lang.Exception
Retrieve the Iterator of Assignments objects.

Specified by:
get_iterator_assignment in interface WfActivity
Throws:
java.lang.Exception

get_sequence_assignment

public WfAssignment[] get_sequence_assignment(int max_number)
                                       throws java.lang.Exception
Retrieve all assignments of this activity.

Specified by:
get_sequence_assignment in interface WfActivity
Returns:
array of WfAssignment objects.
Throws:
java.lang.Exception

is_member_of_assignment

public boolean is_member_of_assignment(WfAssignment member)
                                throws java.lang.Exception
Check if a specific assignment is a member of this activity.

Specified by:
is_member_of_assignment in interface WfActivity
Returns:
true if the assignment is a member of this activity.
Throws:
java.lang.Exception

container

public WfProcess container()
                    throws java.lang.Exception
Getter for the process of this activity.

Specified by:
container in interface WfActivity
Throws:
java.lang.Exception

result

public java.util.Map result()
                     throws java.lang.Exception,
                            ResultNotAvailable
Retrieve the Result map of this activity.

Specified by:
result in interface WfActivity
Returns:
Map of results from this activity
Throws:
java.lang.Exception
ResultNotAvailable

set_result

public void set_result(java.util.Map results)
                throws java.lang.Exception,
                       InvalidData
Assign Result for this activity.

Specified by:
set_result in interface WfActivity
Throws:
java.lang.Exception
InvalidData

complete

public void complete()
              throws java.lang.Exception,
                     CannotComplete
Complete this activity.

Specified by:
complete in interface WfActivity
Throws:
java.lang.Exception
CannotComplete

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
Specified by:
valid_states in interface WfExecutionObject
Throws:
java.lang.Exception

state

public java.lang.String state()
                       throws java.lang.Exception
Specified by:
state in interface WfExecutionObject
Throws:
java.lang.Exception

change_state

public void change_state(java.lang.String new_state)
                  throws java.lang.Exception,
                         InvalidState,
                         TransitionNotAllowed
Specified by:
change_state in interface WfExecutionObject
Throws:
java.lang.Exception
InvalidState
TransitionNotAllowed

name

public java.lang.String name()
                      throws java.lang.Exception
Specified by:
name in interface WfExecutionObject
Throws:
java.lang.Exception

set_name

public void set_name(java.lang.String new_value)
              throws java.lang.Exception
Specified by:
set_name in interface WfExecutionObject
Throws:
java.lang.Exception

key

public java.lang.String key()
                     throws java.lang.Exception
Specified by:
key in interface WfExecutionObject
Throws:
java.lang.Exception

description

public java.lang.String description()
                             throws java.lang.Exception
Specified by:
description in interface WfExecutionObject
Throws:
java.lang.Exception

set_description

public void set_description(java.lang.String new_value)
                     throws java.lang.Exception
Specified by:
set_description in interface WfExecutionObject
Throws:
java.lang.Exception

process_context

public java.util.Map process_context()
                              throws java.lang.Exception
Specified by:
process_context in interface WfExecutionObject
Throws:
java.lang.Exception

set_process_context

public void set_process_context(java.util.Map new_value)
                         throws java.lang.Exception,
                                InvalidData,
                                UpdateNotAllowed
Specified by:
set_process_context in interface WfExecutionObject
Throws:
java.lang.Exception
InvalidData
UpdateNotAllowed

priority

public short priority()
               throws java.lang.Exception
Specified by:
priority in interface WfExecutionObject
Throws:
java.lang.Exception

set_priority

public void set_priority(short new_value)
                  throws java.lang.Exception
Specified by:
set_priority in interface WfExecutionObject
Throws:
java.lang.Exception

resume

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

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 or activity.

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 or activity.

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 or activity.

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
Specified by:
how_many_history in interface WfExecutionObject
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 - Search criteria.
names_in_query - elements to search.
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 - Maximum number of element in result list.
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
Predicate to check if a 'member' is an element of the history.

Specified by:
is_member_of_history in interface 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
Specified by:
last_state_time in interface WfExecutionObject
Throws:
java.lang.Exception

how_many_performer

public int how_many_performer()
                       throws java.lang.Exception
Gets the number of processes.

Specified by:
how_many_performer in interface WfRequester
Throws:
java.lang.Exception

get_iterator_performer

public WfProcessIterator get_iterator_performer()
                                         throws java.lang.Exception
Gets an iterator of processes.

Specified by:
get_iterator_performer in interface WfRequester
Throws:
java.lang.Exception

get_sequence_performer

public WfProcess[] get_sequence_performer(int max_number)
                                   throws java.lang.Exception
A list of processes

Specified by:
get_sequence_performer in interface WfRequester
Returns:
List of WfProcess objects.
Throws:
java.lang.Exception

is_member_of_performer

public boolean is_member_of_performer(WfProcess member)
                               throws java.lang.Exception
Checks if a WfProcess is associated with this requester object

Specified by:
is_member_of_performer in interface WfRequester
Returns:
true if the process is found.
Throws:
java.lang.Exception

receive_event

public void receive_event(WfEventAudit event)
                   throws java.lang.Exception,
                          InvalidPerformer
Specified by:
receive_event in interface WfRequester
Throws:
java.lang.Exception
InvalidPerformer

toString

public java.lang.String toString()
Method toString

Overrides:
toString in class java.lang.Object
Returns:
a String

equals

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

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

checkSecurity

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

getActivityImpl

protected WfActivityInternal getActivityImpl(java.lang.String procId,
                                             java.lang.String actId,
                                             int mode)
                                      throws java.lang.Exception
Throws:
java.lang.Exception