Java Doc for ToolAgent.java in  » Workflow-Engines » shark » org » enhydra » shark » api » internal » toolagent » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » shark » org.enhydra.shark.api.internal.toolagent 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.enhydra.shark.api.internal.toolagent.ToolAgent

All known Subclasses:   org.enhydra.shark.toolagent.AbstractToolAgent,
ToolAgent
public interface ToolAgent (Code)
This interface is based on WfMC's definition of ToolAgents. It is pretty close to the WfMC's specification, but expressed in Object oriented way.

The following is different then WfMC spec proposes:

  • Every method is throwing additional ToolAgentGeneralException
  • AppParameter class is different then WfMC's WMTPAttribute type - it defines some additional fields.
  • It has additional configure() method, that is used to pass CallbackUtilities to tool agent, which provides ToolAgent to get some configuration information from Shark, and provides a way to log tool agent events.
  • It has additional getInfo() method, that is used to get some information about tool agent.

Also, when calling invokeApplication() method, as the first AppParameter parameter in array, Shark is always passing a string representing ExtendedAttributes section of the corresponding XPDL application, chopped out from the XPDL definition, i.e.:

 <ExtendedAttributes>
 <ExtendedAttribute Name="ToolAgentClass" Value="org.enhydra.shark.toolagent.JavaScriptToolAgent"/>
 <ExtendedAttribute Name="Script" Value="java.lang.Thread.sleep(wait_ms);"/>
 </ExtendedAttributes>
 

Shark uses tool agents like the following:

  • It aquires ToolAgent instance from ToolAgentManager . When it creates ToolAgent instance, ToolAgentManager implementation has to call ToolAgent's configure() method.
  • It calls connect() method, and gets handle to ToolAgent
  • It calls invokeApplication() method (the AppParameter array passed to this method should be considered to be passed as a value, not as a reference, because Shark doesn't care about it after calling this method).
  • It calls requestAppStatus() method. Tool agent implementation has to fill the AppParameter array that Shark passes to this method, with the values of appropriate parameters (These parameters are the one passed in invokeApplication() method call, that could be changed during tool agent execution). It also expects the information on application status to be returned, and in our standard implementation, if the status is equal to -1, shark throws exception (Of course, ToolAgent can also signal an exception to shark by throwing any of defined exceptions for a method).
  • finally, shark calls disconnect().

author:
   Sasa Bojanic
author:
   Vladimir Puskas


Field Summary
final public static  longAPP_STATUS_ACTIVE
    
final public static  longAPP_STATUS_FINISHED
    
final public static  longAPP_STATUS_INVALID
    
final public static  longAPP_STATUS_RUNNING
    
final public static  longAPP_STATUS_TERMINATED
    
final public static  longAPP_STATUS_WAITING
    


Method Summary
 voidconfigure(CallbackUtilities cus)
     Used to configure tool agent if needed.
 WMSessionHandleconnect(WMConnectInfo wmci)
     This is the first method that shark calls when accessing some tool agent.
 voiddisconnect(WMSessionHandle shandle)
     Method disconnect.
 StringgetInfo(WMSessionHandle shandle)
     Method getInfo.
 voidinvokeApplication(WMSessionHandle shandle, long handle, WMEntity appInfo, WMEntity toolInfo, String applicationName, String processInstanceId, String workitemId, AppParameter[] parameters, Integer applicationMode)
     Executes tool agent application.
Parameters:
  handle - a long representing unique session Id.
Parameters:
  applicationName - the name of application which will beexecuted by this tool agent
Parameters:
  processInstanceId - Id of process instance for which toolagent application is called.
Parameters:
  workitemId - Id of assignment that is associated withinvoked application.
Parameters:
  parameters - array of parameters (engine variables)passed to tool agent application.
 longrequestAppStatus(WMSessionHandle shandle, long handle, WMEntity toolInfo, String processInstanceId, String workitemId, AppParameter[] parameters)
     Returns the status of tool agent application execution, and fills the parameters with the results of tool agent application execution.
Parameters:
  handle - a long representing unique session Id.
Parameters:
  processInstanceId - Id of process instance for which toolagent application is called.
Parameters:
  workitemId - Id of assignment that is associated withinvoked application.
Parameters:
  parameters - array of parameters (engine variables)passed to application.
 voidterminateApp(WMSessionHandle shandle, long handle, WMEntity toolInfo, String processInstanceId, String workitemId)
     Terminates tool agent application.

Field Detail
APP_STATUS_ACTIVE
final public static long APP_STATUS_ACTIVE(Code)



APP_STATUS_FINISHED
final public static long APP_STATUS_FINISHED(Code)



APP_STATUS_INVALID
final public static long APP_STATUS_INVALID(Code)



APP_STATUS_RUNNING
final public static long APP_STATUS_RUNNING(Code)



APP_STATUS_TERMINATED
final public static long APP_STATUS_TERMINATED(Code)



APP_STATUS_WAITING
final public static long APP_STATUS_WAITING(Code)





Method Detail
configure
void configure(CallbackUtilities cus) throws Exception(Code)
Used to configure tool agent if needed.



connect
WMSessionHandle connect(WMConnectInfo wmci) throws ConnectFailed, ToolAgentGeneralException(Code)
This is the first method that shark calls when accessing some tool agent.
Parameters:
  wmci - structure holding connection request data a SessionHandle.
throws:
  ConnectFailed - If application executed by tool agent needsauthentication, and userId and/or password are not valid
throws:
  ToolAgentGeneralException - If something unexpected happens.



disconnect
void disconnect(WMSessionHandle shandle) throws InvalidSessionHandle, ToolAgentGeneralException(Code)
Method disconnect.
Parameters:
  shandle - a SessionHandle.
throws:
  InvalidSessionHandle - If the given session handle is not valid.
throws:
  ToolAgentGeneralException - If something unexpected happens.



getInfo
String getInfo(WMSessionHandle shandle) throws ToolAgentGeneralException(Code)
Method getInfo. a String representing brief description on tool agent use.
throws:
  ToolAgentGeneralException -



invokeApplication
void invokeApplication(WMSessionHandle shandle, long handle, WMEntity appInfo, WMEntity toolInfo, String applicationName, String processInstanceId, String workitemId, AppParameter[] parameters, Integer applicationMode) throws ApplicationNotStarted, ApplicationNotDefined, ApplicationBusy, ToolAgentGeneralException(Code)
Executes tool agent application.
Parameters:
  handle - a long representing unique session Id.
Parameters:
  applicationName - the name of application which will beexecuted by this tool agent
Parameters:
  processInstanceId - Id of process instance for which toolagent application is called.
Parameters:
  workitemId - Id of assignment that is associated withinvoked application.
Parameters:
  parameters - array of parameters (engine variables)passed to tool agent application. Some of these parameters will be changedduring application execution. These parameters should be considered theinput ones - the engine will not read there value after this method isfinished, but it will give to the ToolAgent.requestAppStatus methodthe array of parameters to be filled with the result of tool agentapplication execution.

The value field of the first parameter in the parameter arrayis always a string representing ExtendedAttributes section of thecorresponding XPDL application, chopped out from the XPDL definition, i.e.:

<ExtendedAttributes><ExtendedAttribute Name="ToolAgentClass" Value="org.enhydra.shark.toolagent.JavaScriptToolAgent"/><ExtendedAttribute Name="Script" Value="java.lang.Thread.sleep(wait_ms);"/></ExtendedAttributes>

Parameters:
  applicationMode - an Integer representing application mode.
throws:
  ApplicationNotStarted - If application can't be started.
throws:
  ApplicationNotDefined - If there is no such application.
throws:
  ApplicationBusy - If application is bussy.
throws:
  ToolAgentGeneralException - If something unexpected happens.



requestAppStatus
long requestAppStatus(WMSessionHandle shandle, long handle, WMEntity toolInfo, String processInstanceId, String workitemId, AppParameter[] parameters) throws ApplicationBusy, InvalidToolAgentHandle, InvalidWorkitem, InvalidProcessInstance, ToolAgentGeneralException(Code)
Returns the status of tool agent application execution, and fills the parameters with the results of tool agent application execution.
Parameters:
  handle - a long representing unique session Id.
Parameters:
  processInstanceId - Id of process instance for which toolagent application is called.
Parameters:
  workitemId - Id of assignment that is associated withinvoked application.
Parameters:
  parameters - array of parameters (engine variables)passed to application. This is a subset of parameters passed to theinvokeApplication() method, and these parameters need to be filled withthe result of tool agent's application execution. The status of tool agent application.
throws:
  ApplicationBusy - If application is bussy.
throws:
  InvalidToolAgentHandle - If handle is invalid.
throws:
  InvalidWorkitem - If there is no such workitem as the onerepresented by given Id parameters.
throws:
  InvalidProcessInstance - If there is no process instance withgiven Id.
throws:
  ToolAgentGeneralException - If something unexpected happens.



terminateApp
void terminateApp(WMSessionHandle shandle, long handle, WMEntity toolInfo, String processInstanceId, String workitemId) throws ApplicationNotStopped, InvalidWorkitem, InvalidProcessInstance, ApplicationBusy, ToolAgentGeneralException(Code)
Terminates tool agent application.
Parameters:
  handle - long representing unique session Id.
Parameters:
  processInstanceId - Id of process instance for which toolagent application is called.
Parameters:
  workitemId - Id of assignment that is associated withinvoked application.
throws:
  ApplicationNotStopped - If application can't be stopped.
throws:
  InvalidWorkitem - If there is no such workitem as the onerepresented by given Id parameters.
throws:
  InvalidProcessInstance - If there is no process instance withgiven Id.
throws:
  ApplicationBusy - If application is bussy.
throws:
  ToolAgentGeneralException - If something unexpected happens.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.