org.enhydra.shark.api.client.wfservice
Interface SharkConnection


public interface SharkConnection

Interface used to perform some administrative operations that concern execution engine objects.

The first method to be called by client application is the first method of this interface - connect(), and only if user authentication is OK, other methods can be used (otherwise, every method throws NotConnected exception).

Author:
Sasa Bojanic, Vladimir Puskas

Method Summary
 void attachToHandle(WMSessionHandle shandle)
           
 void connect(WMConnectInfo connectInfo)
          This is the first method to be called in order to communicate with the engine.
 void disconnect()
          Disconnects from shark engine.
 WfActivityIterator get_iterator_activity()
           
 WfAssignmentIterator get_iterator_assignment()
           
 WfProcessIterator get_iterator_process()
           
 WfProcessMgrIterator get_iterator_processmgr()
          Returns an iterator that can be used to retrieve WfProcessMgr objects that represent appropriate XPDL process definitions, and are used to create new process instances.
 WfResourceIterator get_iterator_resource()
          Returns an iterator that can be used to retrieve WfResource objects that represent appropriate shark users.
 WfProcessMgr[] get_sequence_processmgr(int max_number)
          Returns an array of WfProcessMgr objects.
 WfResource[] get_sequence_resource(int max_number)
          Returns an array of WfResource objects.
 WfActivity getActivity(java.lang.String procId, java.lang.String actId)
          Returns WfActivity object that has the given Id, or null if such doesn't exist.
 WfAssignment getAssignment(java.lang.String procId, java.lang.String assId)
          Returns WfAssignment object for given Id, or null if such doesn't exist.
 WfAssignment getAssignment(java.lang.String procId, java.lang.String actId, java.lang.String username)
          Returns WfAssignment object for activity with given Id, and resource with the given username, or null if such doesn't exist.
 WfProcess getProcess(java.lang.String procId)
          Returns WfProcess object that has the given Id, or null if such does not exist.
 WfProcessMgr getProcessMgr(java.lang.String name)
          Returns WfProcessMgr object that has the given name, or null if such does not exist.
 WfResource getResource(java.lang.String username)
          Returns WfResource object that has the given username, or null if such doesn't exist.
 WfResource getResourceObject()
          Returns WfResource object belonging to the user that has been connected to shark through this interface.
 WMSessionHandle getSessionHandle()
           
 

Method Detail

connect

void connect(WMConnectInfo connectInfo)
             throws java.lang.Exception
This is the first method to be called in order to communicate with the engine. If the login parameters are correct, user can use other methods of this interface to communicate with the shark engine, and if not, he can't do anything.

Parameters:
connectInfo - structure holding connection request data
Throws:
java.lang.Exception - If something unexpected happens.

attachToHandle

void attachToHandle(WMSessionHandle shandle)
                    throws java.lang.Exception
Throws:
java.lang.Exception

disconnect

void disconnect()
                throws java.lang.Exception
Disconnects from shark engine.

Throws:
java.lang.Exception - If something unexpected happens.

getSessionHandle

WMSessionHandle getSessionHandle()
                                 throws java.lang.Exception
Throws:
java.lang.Exception

getResourceObject

WfResource getResourceObject()
                             throws java.lang.Exception
Returns WfResource object belonging to the user that has been connected to shark through this interface. This will be the WfResource object that has the same username attribute as the one used in connect() method. After getting this object, client application can present user a list of its assignments that can be retrieved throug this WfResource object.

Returns:
WfResource object belonging to the user.
Throws:
java.lang.Exception - If something unexpected happens.

get_iterator_processmgr

WfProcessMgrIterator get_iterator_processmgr()
                                             throws java.lang.Exception
Returns an iterator that can be used to retrieve WfProcessMgr objects that represent appropriate XPDL process definitions, and are used to create new process instances.

Returns:
WfProcessMgrIterator for retrieving WfProcessMgr objects.
Throws:
java.lang.Exception - If something unexpected happens.

get_sequence_processmgr

WfProcessMgr[] get_sequence_processmgr(int max_number)
                                       throws java.lang.Exception
Returns an array of WfProcessMgr objects.

Parameters:
max_number - The maximum number of WfProcessMgr instances to be returned. If set to 0, all existing instances will be returned (this will be equal to the number of XPDL process definitions in all packages that are loaded into engine).
Returns:
Array of specified WfProcessMgr objects.
Throws:
java.lang.Exception - If something unexpected happens.

get_iterator_resource

WfResourceIterator get_iterator_resource()
                                         throws java.lang.Exception
Returns an iterator that can be used to retrieve WfResource objects that represent appropriate shark users.

Returns:
WfResourceIterator for retrieving WfResource objects. that represent appropriate shark users.
Throws:
java.lang.Exception - If something unexpected happens.

get_sequence_resource

WfResource[] get_sequence_resource(int max_number)
                                   throws java.lang.Exception
Returns an array of WfResource objects.

Parameters:
max_number - The maximum number of WfResource instances to be returned. If set to 0, all existing instances will be returned.
Returns:
Specified array of WfResource objects.
Throws:
java.lang.Exception - If something unexpected happens.

getProcessMgr

WfProcessMgr getProcessMgr(java.lang.String name)
                           throws java.lang.Exception
Returns WfProcessMgr object that has the given name, or null if such does not exist.

Parameters:
name - WfProcessMgr object name.
Returns:
WfProcessMgr with the given name, or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

getResource

WfResource getResource(java.lang.String username)
                       throws java.lang.Exception
Returns WfResource object that has the given username, or null if such doesn't exist.

Parameters:
username - username of WfResource instance.
Returns:
WfResource with the given name, or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

getProcess

WfProcess getProcess(java.lang.String procId)
                     throws java.lang.Exception
Returns WfProcess object that has the given Id, or null if such does not exist.

Parameters:
procId - process instance Id.
Returns:
WfProcess with the given name, or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

getActivity

WfActivity getActivity(java.lang.String procId,
                       java.lang.String actId)
                       throws java.lang.Exception
Returns WfActivity object that has the given Id, or null if such doesn't exist.

Parameters:
procId - activity's process Id.
actId - activity instance Id.
Returns:
WfActivity with the given Id, or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

getAssignment

WfAssignment getAssignment(java.lang.String procId,
                           java.lang.String actId,
                           java.lang.String username)
                           throws java.lang.Exception
Returns WfAssignment object for activity with given Id, and resource with the given username, or null if such doesn't exist.

Parameters:
procId - the assignment's activity's process instance Id.
actId - the assignment's activity instance Id.
username - the assignement's username
Returns:
Specified WfAssignment , or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

getAssignment

WfAssignment getAssignment(java.lang.String procId,
                           java.lang.String assId)
                           throws java.lang.Exception
Returns WfAssignment object for given Id, or null if such doesn't exist. NOTE: this method is here only because of standardization (having one method with transaction, and other without), and is not supposed to be used in normal situations - tool agents can call the same method but with additional transaction parameter, and user applications should call the same method but with actId and username parameters instead of assId parameter.

Parameters:
procId - the assignment's activity's process instance Id.
assId - the assignment Id.
Returns:
Specified WfAssignment , or null if does not exist.
Throws:
java.lang.Exception - If something unexpected happens.

get_iterator_assignment

WfAssignmentIterator get_iterator_assignment()
                                             throws java.lang.Exception
Returns:
unbound assignment iterator
Throws:
java.lang.Exception

get_iterator_process

WfProcessIterator get_iterator_process()
                                       throws java.lang.Exception
Returns:
unbound process iterator
Throws:
java.lang.Exception

get_iterator_activity

WfActivityIterator get_iterator_activity()
                                         throws java.lang.Exception
Returns:
unbound activity iterator
Throws:
java.lang.Exception