org.obe.client.api.tool
Class ToolInvocation

java.lang.Object
  extended byorg.obe.client.api.tool.ToolInvocation
All Implemented Interfaces:
java.io.Serializable

public final class ToolInvocation
extends java.lang.Object
implements java.io.Serializable

Encapsulates the invocation of a tool (application or procedure). This class can be used directly by thick Java clients (apps & applets), in order to support tool types other than native executables. Thin clients can use this class to generate the JavaScript to invoke the requisite application from an HTML browser.

Author:
Adrian Price
See Also:
WMClient.executeWorkItem(java.lang.String, java.lang.String), Serialized Form

Field Summary
 ToolAgent agent
           
 java.lang.String description
           
 java.lang.Exception exception
           
static int META_DATA
           
 ToolAgentMetaData metaData
           
 Parameter[] parameters
           
 java.lang.String procInstId
           
static int TOOL_AGENT
           
 java.lang.String toolId
           
 int toolIndex
           
 ToolType toolType
           
 java.lang.String workItemId
           
 java.lang.String workItemName
           
 
Constructor Summary
ToolInvocation(java.lang.String procInstId, java.lang.String workItemName, java.lang.String workItemId, java.lang.String toolId, int toolIndex, ToolAgentMetaData metaData, ToolType toolType, ToolAgent agent, Parameter[] parameters, java.lang.String description)
           
 
Method Summary
 void invokeTool(WMClient client, boolean sync)
          Invokes the tool agent, synchronously or asynchronously.
 void renderInvocationScript(WMClient client, java.io.Writer writer)
          Renders the JavaScript necessary to invoke the tool from an HTML browser.
 int requestAppStatus()
           
 void terminateApp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

META_DATA

public static final int META_DATA
See Also:
Constant Field Values

TOOL_AGENT

public static final int TOOL_AGENT
See Also:
Constant Field Values

procInstId

public final java.lang.String procInstId

workItemName

public final java.lang.String workItemName

workItemId

public final java.lang.String workItemId

toolId

public final java.lang.String toolId

toolIndex

public final int toolIndex

metaData

public final ToolAgentMetaData metaData

toolType

public final ToolType toolType

agent

public final ToolAgent agent

parameters

public final Parameter[] parameters

description

public final java.lang.String description

exception

public java.lang.Exception exception
Constructor Detail

ToolInvocation

public ToolInvocation(java.lang.String procInstId,
                      java.lang.String workItemName,
                      java.lang.String workItemId,
                      java.lang.String toolId,
                      int toolIndex,
                      ToolAgentMetaData metaData,
                      ToolType toolType,
                      ToolAgent agent,
                      Parameter[] parameters,
                      java.lang.String description)
Method Detail

invokeTool

public void invokeTool(WMClient client,
                       boolean sync)
Invokes the tool agent, synchronously or asynchronously.

Parameters:
client - The client connection to use. This must be valid if called by a remote client, and must be null when called internally by the workflow engine to invoke a procedure.
sync - true to invoke the tool synchronously.

renderInvocationScript

public void renderInvocationScript(WMClient client,
                                   java.io.Writer writer)
                            throws java.io.IOException,
                                   WMWorkflowException
Renders the JavaScript necessary to invoke the tool from an HTML browser. The implementation optionally calls WMClient.toolStarted(java.lang.String, java.lang.String) to signal to the workflow engine that tool execution has begun.

Parameters:
client - The client connection to use.
writer - The writer to which the JavaScript should be written.
Throws:
java.io.IOException - If a problem occurred when writing the JavaScript.
WMWorkflowException - If a problem occurred when calling the client.

requestAppStatus

public int requestAppStatus()

terminateApp

public void terminateApp()


SourceForge.net Logo OBE-1.0 Copyright (C) 2002-2006 Adrian Price. All Rights Reserved.