CA Workflow API Ref Guide ENU
CA Workflow API Ref Guide ENU
For your convenience, CA provides one site where you can access the information you
need for your Home Office, Small Business, and Enterprise CA products. At
http://ca.com/support, you can access the following:
■ Online and telephone contact information for technical assistance and customer
services
■ Information about user communities and forums
■ Product and documentation downloads
■ CA Support policies and guidelines
■ Other helpful resources appropriate for your product
If you have comments or questions about CA product documentation, you can send a
message to [email protected].
If you would like to provide feedback about CA product documentation, complete our
short customer survey, which is available on the CA Support website at
http://ca.com/docs.
Contents
Chapter 1: Introduction 9
Workflow Web Service Basics ...................................................................................................................................... 9
Process Manager Components ............................................................................................................................. 9
Web Service Components ................................................................................................................................... 10
Worklist Components ......................................................................................................................................... 10
How to Obtain the Services' WSDL Document .................................................................................................... 10
Security ............................................................................................................................................................... 10
Error Handling ..................................................................................................................................................... 11
Contents 5
getStatusCode Operation .................................................................................................................................... 32
getWSDL Operation............................................................................................................................................. 33
isEIAMEnabled Operation ................................................................................................................................... 34
isLoggingEnabled Operation ............................................................................................................................... 34
lock Operation ..................................................................................................................................................... 35
logIn Operation (Deprecated) ............................................................................................................................. 35
logInPM Operation .............................................................................................................................................. 36
logInToken Operation (Deprecated) ................................................................................................................... 37
logInTokenPM Operation .................................................................................................................................... 37
logOut Operation (Process Manager) ................................................................................................................. 38
purgeInstances Operation ................................................................................................................................... 39
purgeInstancesAsynchronously Operation ......................................................................................................... 39
purgeAsynchronouslyForCompletedWithStats Operation ................................................................................. 41
purgeInstancesSynchronously Operation ........................................................................................................... 42
purgeSynchronouslyForCompletedWithStats Operation ................................................................................... 43
putActors Operation ........................................................................................................................................... 44
putConfiguration Operation ................................................................................................................................ 44
putDefinition Operation ...................................................................................................................................... 45
resumeInstance Operation ................................................................................................................................. 46
setExternalVariables Operation .......................................................................................................................... 46
start Operation .................................................................................................................................................... 47
suspendInstance Operation ................................................................................................................................ 48
terminateInstance Operation ............................................................................................................................. 48
unlock Operation ................................................................................................................................................ 49
updateActor Operation ....................................................................................................................................... 49
Complex Types - Process Manager Web Services ...................................................................................................... 50
Parameter Values - pmService WSDL .................................................................................................................. 50
Process Instance Status .............................................................................................................................................. 51
Simple Types - Process Manager Web Services ......................................................................................................... 52
Contents 7
ObjectClassException ............................................................................................................................................... 122
ObjectExportNotSupportedException ...................................................................................................................... 122
ObjectImportException ............................................................................................................................................ 122
ObjectManagerException ......................................................................................................................................... 122
PMInterfaceException .............................................................................................................................................. 122
ProcessExecutionException ...................................................................................................................................... 123
ProcessManagerException ....................................................................................................................................... 124
Runtime ActorException .......................................................................................................................................... 124
SecurityManagerException ...................................................................................................................................... 124
TypeConversionException ........................................................................................................................................ 124
UnsupportedCallbackException ............................................................................................................................... 124
Glossary 135
Index 137
The Process Manager Web service utilizes technology from Apache Axis. The WSDL is
generated from the same base classes as the Workflow Java API.
Starting with CA Workflow r1.1, a new Process Manager API supports complex data
types as part of the WSDL definition, allowing for easier processing of the data returned
from various API methods. The new API also allows third party WSDL2Java tools to
generate Java stub classes which are a native Java representation of input and output
parameters for most methods.
Chapter 1: Introduction 9
Workflow Web Service Basics
These Web services are similar in respect to implementation, security, and error
handling. Divergent areas include Simple Object Access Protocol (SOAP) definitions and
some data types.
Worklist Components
The Worklist Web service is incorporated into the wl-web.war file. The Web service is
automatically deployed when the WAR file is deployed.
The Worklist Web service utilizes technology from Apache Axis. The WSDL is generated
from the same base classes as the Workflow Java API.
For example, to view the WSDL for the Process Manager Web service, use the following
URL:
http://<servername>:CA Portal/pm/services/pmService2?wsdl
Security
As with all standard Web services, information is sent in plain text over a network using
the HTTP protocol. During CA Workflow development, the W3C (World Wide Web
Consortium) did not yet have a confirmed standard for Web service security. If security
is an issue with your installation, we recommend using SSL as your communications
protocol.
Error Handling
If an error occurs with a Web method, a SOAP Fault is returned. The SOAP Fault is the
standard means of returning exception information for Web services.
The Fault message contains standardized <Message> and <Code> elements, however,
the <Detail> element is the most informative. The <Detail> element contains <errorID>
and <Message> elements. The <Message> contains an English string that describes
errors. The <Message> elements are more suitable for developers and more appropriate
messages should display for users.
Example
The following illustrates a SOAP Fault when bad parameters are supplied to LogIn()
method:
<faultstring>com.ejbtech.processmanager.services.PMServiceException:
Malformed URL</faultstring>
<detail>
<com.ejbtech.processmanager.services.PMServiceException
xsi:type="ns1:PMServiceException"
xmlns:ns1="urn:services.processmanager.ejbtech.com">
<errorID xsi:type="xsd:string"
xsi:nil="true"/>
<message xsi:type="xsd:string">Malformed
URL</message>
</com.ejbtech.processmanager.services.PMServiceException>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
Chapter 1: Introduction 11
Chapter 2: The Process Manager Web
Service
The Process Manager Web services are used to access the Process Manager.
The Process Manager Web Service API (PMService) in CA Workflow r1 was written as a
thin layer over the internal process manager APIs, using the same HTTP RPC method as
the IDE client. The API would then convert the Java objects returned by the RPC
methods to XML and return the XML as a SOAP string. It was up to the client to parse
these XML strings and no schema was provided for the XML types.
The new Process Manager Web Service API (PMService2) seeks to improve the original
PMService in the following areas:
■ Instead of returning XML as strings, the Process Manager Web Service API uses the
built-in serializers provided with Apache Axis, as well as custom serializers, to return
data as complex types defined in the WSDL instead of free-form XML.
■ Since the Web Service API and process manager reside inside the same context in
the J2EE application server, the HTTP calls will be replaced with direct calls to the
ProcessManagerServer in the pm context.
A side effect of moving away from the HTTP API is that Axis must be run inside an HTTP
session managed by the J2EE application server in order for clustering to work properly.
This change requires the client support HTTP cookies to maintain a session with the
server. Clients that do not support cookies should continue to use the original
PMService API delivered with CA Workflow r1.
The old Process Manager Web Service API (PMService) is still supported in CA Workflow
r1.1.
The sections that follow provide additional details and describe operations from
PMService and PMService2.
To log in to a remote process manager, change the port address of your Web services
client to that servers' PMService address.
clearLog Operation
Description
Cleans up the log trace. This operation clears the Process Manager log.
Syntax
public void clearLog(java.lang.String sessionID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
deleteActor Operation
Description
Deletes an actor from workflow. This method will throw an exception if there is an
error removing the actor from the database, but it will not throw an exception if the
actor is not found.
Syntax
public void deleteActor(java.lang.String sessionid, java.lang.String actorName)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
deleteDefinition Operation
Description
Deletes a process definition by given ID. The operation permanently removes the
process definition.
Syntax
public void deleteDefinition(java.lang.String sessionid, java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
deleteInstance Operation
Description
Permanently deletes a process instance.
Syntax
Public void deleteInstance(java.lang.String sessionid, java.lang.String ID)
Throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
enableLogging Operation
Description
Starts and stops logging by turning logging On/Off in the Process Manager.
Syntax
public void enableLogging(java.lang.String sessionid, java.lang.Boolean enable)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
getActor Operation
Description
Returns the specified Actor. The entire Actor is returned as an XML document.
Syntax
public java.lang.String getActor(java.lang.String sessionid, java.lang.String
actor)
throws PMServiceException
Parameters
Return
The specified Actor as an XML string
Exception Thrown
PMServiceException
getActors Operation
Description
Returns ALL the Actors. The Actors are returned as an XML document.
Syntax
public java.lang.String getActors(java.lang.String sessionID)
throws PMServiceException
Parameters
Return
All actors at the specified URL as an XML document string
Exception Thrown
PMServiceException
getApprovedEIAMUsers Operation
Description
Returns a list of comma-separated EIAM users that should be selected from an
assignment action. The search results will include the first 300 users retrieved from
EIAM.
Syntax
public java.lang.String getApprovedEIAMUsers (java.lang.String sessionid,
java.lang.String workitemID)
throws PMServiceException
Parameters
Return
A list of comma-separated EIAM users based on the assignment action with the
specified workitems as string
Exception Thrown
PMService Exception
getApprovedEIAMUsersUsingEIAMFilters Operation
Description
Returns a list of comma-separated EIAM users that should be selected from an
assignment action. The search results will include the first 300 users retrieved from
EIAM.
Syntax
public java.lang.String getApprovedEIAMUsersUsingEIAMFilters (java.lang.String
sessionID, java.lang.String workitemID, java.lang.String search,
java..lang.String safeAttribute, java.lang.String safeOperator)
throws PMServiceException
Parameters
Return
A list of EIAM users as a string
Exception Thrown
PMServiceException
getConfiguration Operation
Description
Returns a Process Manager configuration. This returns an XML document that
contains name/value pairs with configuration information for the Process Manager
such as:
LogBufSize
Identifies the server log buffer size.
WebServiceTimeout
Indicates the amount of time that the Web services actor waits for a response
from a Web service in seconds.
Timeout
This setting affects two back-off times:
■ Specifies the wait period before retrying when no process engine is
available.
■ If a workitem cannot run because a process instance is suspended,
specifies the time in milliseconds before it is queued again. To tune the
timeout to reduce re-queuing activity, increase timeout from its default
value of 3000 ms.
EnableReporting
Indicates if data is saved to the Workflow database table "stats", which is used
in Workflow reports and charts. Valid values are:
■ True (default indicates that the data is saved to the Workflow database.
■ False indicates that the data is not saved to the Workflow database.
SMTPost
Specifies the Simple Mail Transfer Protocol (SMTP) address when the workflow
sends an email.
FromName
Specifies the name that appears in the From field when the workflow sends an
email.
FromAddress
Specifies the return address when the workflow sends an email.
EnginePools
Specifies the number of process engine instances that the server runs to
process Workflow activities.
MaxWorkitems
Specifies the maximum number of workitems the process engine keeps in
memory. Once the number of instance workitems reaches this value, they are
written to disk. If your CA Workflow server has extensive memory, increasing
the MaxWorkitems value speeds up the performance of large iterations.
UseSnapshots
Indicates if CA Workflow is optimized for increased throughput and better
memory usage. Enter true or false in this field.
■ True specifies that the CA Workflow server uses a new, memory-efficient
database schema, yielding increased throughput. As a result, new process
instances started from the same process definition share common
information.
■ False (default) specifies that the CA Workflow server uses the original
database schema.
LogFileName
Specifies the file name for the Process Manager log file.
ProcessManagerURL
Specifies the URL of the Process Manager used to populate the generated
WSDL.
Additional configuration information specific to other components under the
Process Manager's control, such as actors, may also be present.
Syntax
public java.lang.String getConfiguration (java.lang.String sessionID)
throws PMServiceException
Parameters
Return
The process Manager Properties as an XML document
Exception Thrown
PMService Exception
getDefinition Operation
Description
Returns the specified process definition. The entire process definition is returned as
an XML document.
Syntax
public java.lang.String getDefinition(java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
The process definition as XML at the specified URL
Exception Thrown
PMServiceException
getDefinitionDescriptor Operation
Description
Returns a process definition descriptor for the specified process definition as an
XML document.
Syntax
public java.lang.String getDefinitionDescriptor (java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
The process definition as XML at the specified URL
Exception Thrown
PMServiceException
getDefinitions Operation
Description
Returns an array of process definition descriptors known by the Process Manager.
Each array element is an XML document representation of the process definition
descriptor, rather than an entire process definition.
Parameters
Return
An array of process definition descriptors expressed as XML documents
Exception Thrown
PMServiceException
getExternalVariables Operation
Description
Retrieves the values of a process instances external variables.
Syntax
public java.lang.String getExternalVariables (java.lang.String sessionID,
java.lang.String processID)
throws PMServiceException
Parameters
Return
The value of all external variables as an XML document
Exception Thrown
PMServiceException
getInputParametersArray Operation
Description
Returns an array of input parameters (name and type) for a specified process
definition.
Syntax
public java.lang.String[]getInputParametersArray (java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
An array of strings each of which is a parameter
Exceptions
PMServiceException
getInstance Operation
Description
Returns the complete Process Instance object for the specified process instance
expressed as an XML document.
Syntax
public java.lang.String getInstance (java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
The process instance at the specified URL
Exception Thrown
PMServiceException
getInstances Operation
Description
Returns an array of process instances known by the Process Manager. Each array
element is an XML document that represents the ProcessInstanceDescriptor rather
than an entire process instance.
The format of a ProcessInstanceDescriptor is:
id
Specifies the unique identifier of the process instance
name
Specifies the name of the process instance
description
Specifies the description of the process instance
started
Specifies the time, in milliseconds from midnight, January 1, 1970 UTC, when
the process instance was started
completed
Specifies the time, in milliseconds from midnight, January 1, 1970 UTC, when
the process instance was completed
status
Specifies the state of the process instance
externals
Specifies a list of the attributes of the process instance marked as external
inuse
If set, specifies the name of the user holding a lock on the process instance
Syntax
public java.lang.String[] getInstances (java.lang.String sessionID,
java.lang.String definitionID, java.lang.Long from, java.lang.Long to)
throws PMServiceException
Parameters
Return
An array of strings of ProcessInstance objects expressed as XML documents
Exception Thrown
PMServiceException
getInstanceHistory Operation
Description
Shows the instance history of a process expressed as an XML document.
Syntax
public java.lang.String getInstanceHistory (java.lang.String sessionID,
java.lang.String ID, java.lang.String.history)
throws PMServiceException
Parameters
Return
The instance history of a process expressed as an XML document
Exception Thrown
PMServiceException
getInstanceImage Operation
Description
Returns a process instance status image.
Syntax
public java.lang.Byte[] getInstanceImage (java.lang.String sessionID,
java.lang.String instanceID, TransmissionType tp, ImageType it)
throws PMServiceException
Parameters
Return
If the TransmissionType is bytearray, then the image is returned as byte[] else null
Exception Thrown
PMServiceException
getInstancesByStatus
Description
Returns an array of instances for the process definition selected by status. This
returns an array of process instances known by the process manager. Each array
element is an XML document representing the Process Instance Descriptor, rather
than an entire process instance. The format of a Process Instance Descriptor is
shown under the description of getInstances.
Syntax
public java.lang.String getInstancesByStatus (java.lang.String sessionID,
java.lang.String definitionID, java.lang.Long from, java.lang.Long to,
java.lang.int status)
throws PMServiceException
Parameters
Return
An array of ProcessInstance objects expressed as XML documents
Exception Thrown
PMServiceException
getInstanceWorkItems Operation
Description
Returns all workitems associated with a particular process instance. The workitems
are returned as an XML document.
Syntax
public java.lang.String getInstanceWorkItems (java.lang.String sessionID,
java.lang.String ID, java.lang.Boolean showCompleted)
throws PMServiceException
Parameters
Return
The workitems as an XML string at the specified URL
Exception Thrown
PMServiceException
getLog Operation
Description
Returns the entire contents of the Process Manager log file as an array of strings.
Syntax
public java.lang.String[] getLog(java.lang.String sessionID)
throws PMServiceException
Parameters
Return
The contents of the log file as an array of strings.
Exception Thrown
PMServiceException
getResults Operation
Description
Returns process execution results as an array of attributes.
Syntax
public java.lang.String[] getResults (java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
An array of string attributes; each attribute is XML
Exception Thrown
PMServiceException
getStatus Operation
Description
Returns status of the process instance.
Syntax
public java.lang.String getStatus (java.lang.String sessionID, java.lang.String
processID)
throws PMServiceException
Parameters
Return
The status of the process instance as a string
Exception Thrown
PMServiceException
getStatusCode Operation
Description
Returns the status code of the process instance. For a representation of the status
code string, see the section “Process Instance Status” later in this chapter.
Syntax
public java.lang.String getStatusCode (java.lang.String sessionID,
java.lang.String processID)
throws PMServiceException
Parameters
Return
The status code as numeric value of the process instance (see the section Process
Instance Status)
Exception Thrown
PMServiceException
getWSDL Operation
Description
Returns the generated WSDL for a process definition.
Syntax
public java.lang.String getWSDL (java.lang.String sessionID, java.lang.String
ID)
throws PMServiceException
Parameters
Return
The generated WSDL for the process definition
Exception Thrown
PMServiceException
isEIAMEnabled Operation
Description
Returns a Boolean that indicates if a user source is EIAM.
Syntax
public java.lang.Boolean isEIAMEnabled (java.lang.String sessionID)
throws PMServiceException
Parameters
Return
True if the user source is EIAM, or false if not
Exception Thrown
PMServiceException
isLoggingEnabled Operation
Description
Returns true or false to indicate whether Process Manager Server logging is
enabled.
Syntax
public java.lang.Boolean isLoggingEnabled (java.lang.String sessionID)
throws PMServiceException
Parameters
Return
TRUE if logging is currently enabled or FALSE if it is not
Exception Thrown
PMServiceException
lock Operation
Description
Locks the identified process definition or process instance. The Process Manager
maintains the locks in memory.
Syntax
public void lock(java.lang.String sessionID, java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the Process
Manager
Exception Thrown
PMServiceException
logInPM Operation
Description
Logs the user in to the local Process Manager with a username and password.
Syntax
public java.lang.String logInPM(java.lang.String user, java.lang.String
password)
throws PMServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the Process
Manager
Exception Thrown
PMServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the Process
Manager
Exception Thrown
PMServiceException
logInTokenPM Operation
Description
Logs the user in to the local Process Manager with an eIAM token
Syntax
public java.lang.String logInTokenPM (java.lang.String token)
throws PMServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the Process
Manager
Exception Thrown
PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstances Operation
Description
Permanently deletes all process instances that are created or completed from the
specified process definition and run within the specified time period. The beginning
and ending from and to dates are each expressed as the difference in milliseconds
between that date/time and 12:00 AM, January 1, 1970 UTC (UTC is also known as
GMT).
Syntax
public void purgeInstances (java.lang.String sessionID, java.lang.String
definitionID, java.lang.Long from, java.lang.Long to)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstancesAsynchronously Operation
Description
Permanently deletes all process instances that are created or completed from the
specified process definition and run within the specified time period. The beginning
and ending from and to dates are each expressed as the difference in milliseconds
between that date/time and 12:00 AM, January 1, 1970 UTC (UTC is also known as
GMT). This is an asynchronous operation that runs in the background.
Syntax
public void purgeInstancesAsynchronously (java.lang.String sessionID,
java.lang.String definitionID, java.lang.Long from, java.lang.Long to,
java.lang.Boolean completed )
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeAsynchronouslyForCompletedWithStats Operation
Description
Permanently deletes all process instances that are created from the specified
process definition and also the associated data from the STATS table and run within
the specified time period. The beginning and ending from and to dates are each
expressed as the difference in milliseconds between that date/time and 12:00 AM,
January 1, 1970 UTC (UTC is also known as GMT). This is an asynchronous operation
that runs in the background.
Syntax
public void purgeAsynchronouslyForCompletedWithStats (java.lang.String
sessionID, java.lang.String definitionID, java.lang.Long from, java.lang.Long
to, java.lang.Boolean completed, java.lang.Boolean deleteStats)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstancesSynchronously Operation
Description
Permanently deletes all process instances that are created or completed from the
specified process definition and run within the specified time period. The beginning
and ending from and to dates are each expressed as the difference in milliseconds
between that date/time and 12:00 AM, January 1, 1970 UTC (UTC is also known as
GMT). This operation returns the status of the purge operation.
Syntax
public java.lang.integer purgeInstancesSynchronously (java.lang.String
sessionID, java.lang.String definitionID, java.lang.Long from, java.lang.Long
to, java.lang.Boolean completed)
throws PMServiceException
Parameters
Return
The purge status value (the integer and corresponding string)
Valid values are:
0 = PURGE_SUCCESS
1 = PURGE_FAILURE_INTERNAL_ERROR
2 = PURGE_LOGIN_FAILED
3 = NO_INSTANCES_TO_PURGE
Exception Thrown
PMServiceException
purgeSynchronouslyForCompletedWithStats Operation
Description
Permanently deletes all process instances that are created from the specified
process definition and also the associated data from the STATS table and run within
the specified time period. The beginning and ending from and to dates are each
expressed as the difference in milliseconds between that date/time and 12:00 AM,
January 1, 1970 UTC (UTC is also known as GMT).
Syntax
public void purgeAsynchronouslyForCompletedWithStats (java.lang.String
sessionID, java.lang.String definitionID, java.lang.Long from, java.lang.Long
to, java.lang.Boolean completed, java.lang.Boolean deleteStats)
throws PMServiceException
Parameters
Return
The purge status value (the integer and corresponding string).
Valid values are:
0 = PURGE SUCCESS
1 = PURGE FAILURE INTERNAL ERROR
2 = PURGE LOGIN FAILED
3 = NO INSTANCES TO PURGE
Exception Thrown
PMServiceException
putActors Operation
Description
Puts actors into the Workflow database. The format of the XML file is the same as
the format returned by the IDE export option or the getActors()method. Multiple
actors may be present in the XML file.
Syntax
public java.lang.String[] putActors (java.lang.String sessionID,
java.lang.String actorXML)
throws PMServiceException
Parameters
Return
The Actors (an array of strings) that got inserted into the database
Exception Thrown
PMServiceException
putConfiguration Operation
escription
Sets a Process Manager configuration and replaces the server properties object
used for Process Manager configuration information. The status is specified in an
exception if an error occurs.
Syntax
public void putConfiguration (java.lang.String sessionID, java.lang.String[]
names, java.lang.String[] values)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
putDefinition Operation
Description
Creates a process definition and saves the specified process definition. The status is
specified in an exception if an error occurs.
Syntax
public java.lang.String putDefinition (java.lang.String sessionID,
java.lang.String definition)
throws PMServiceException
Parameters
Return
The ID of the created process definition
Exception Thrown
PMServiceException
resumeInstance Operation
Description
Resumes the specified process instance, putting it back into the running state.
Syntax
public void resumeInstance (java.lang.String sessionID, java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
setExternalVariables Operation
Description
Sets the values of a process instances external variables. The status is specified in
an exception if an error occurs.
Syntax
public void setExternalVariables (java.lang.String sessionID, java.lang.String
processID, java.lang.String[] names, java.lang.String[] values)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
start Operation
Description
Creates a process instance. The specified process definition is instantiated (that is, a
new ProcessInstance is created and run from the specified ProcessDefinition). The
Process Manager chooses the version of the process definition that is the most
effective. An array of parameters (name/value pairs) is also passed as an argument
to this call. The status is specified in an exception if an error occurs.
Syntax
public java.lang.String start(java.lang.String sessionID, java.lang.String
definitionID, Parameter[] parameters)
throws PMServiceException
Parameters
Return
The process instance ID
Exception Thrown
PMServiceException
suspendInstance Operation
Description
Suspends the specified process instance. The instance can be resumed with the
resumeInstance operation. The status is specified in an exception if an error occurs.
Syntax
public void suspendInstance (java.lang.String sessionID, java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
terminateInstance Operation
Description
Terminates the specified process instance and deletes all outstanding workitems.
The status is specified in an exception if an error occurs.
Syntax
public java.lang.String terminateInstance (java.lang.String sessionID,
java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
unlock Operation
Description
Unlocks a process definition or process instance identified.
Syntax
public void unlock (java.lang.String sessionID, java.lang.String ID)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
updateActor Operation
Description
Updates an Actor in CA Workflow. If multiple actors are present in the XML, only
the first actor will be used. This function will throw a PMServiceException if the
actor is not found in the database. The format of the XML file is the same as the
format returned by the IDE export option or the getActors()method. The status is
specified in an exception if an error occurs.
Syntax
public java.lang.String updateActor (java.lang.String sessionID,
java.lang.String actorXML, java.lang.String actorName)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
With PMService, a user session with the Axis client libraries might look something like
this:
PMService2 in Axis
With PMService2, the same session looks like this (note that we must explicitly tell axis
to maintain the session for us):
PMService2 service =
new PmServiceServiceLocator().getpmService2();
((PmService2SoapBindingStub)service).setMaintainSession(true);
service.logIn("caflow", "caflow");
ProcessDefinitionDescriptor[] definitions =
service.getDefinitions();
for (int i = 0; i < definitions.length; i++) {
System.out.println(definitions[i].getName());
}
In C#, using stubs generated by wsdl.exe, the PMService2 session would look like this
(note the use of a CookieContainer to maintain the session):
Session Management
The change that will have the largest impact on how this API is used is the change to the
session management code. As shown in the previous session example, PMService2 no
longer returns a session ID as an explicit parameter from the login method and no
longer accepts a session ID as a parameter to the other methods. Instead, Axis returns
an HTTP cookie with the login method which must be passed in when any other
methods are called.
The line that tells the Axis client to pass along this cookie is
"((PmService2SoapBindingStub)service).setMaintainSession(true);" In .NET, adding a
CookieContainer to the service instructs the generated stubs to use the cookie. No other
client libraries have been tested at this time.
The reason for this change is that it allows you to use the clustering support built into
application servers. With cookie-based sessions, we get a consistent and well-tested
mechanism to propagate session data throughout the cluster in the case of failover, and
we provide the load balancer with sufficient information to keep sessions associated
with a single node in the cluster whenever possible.
Attribute
HistoryRecord
LogEntry
Parameter
ProcessDefinitionDescriptor
ProcessInstanceDescriptor
Version
WorkItem
Class PMService2
The Process Manager Services version 2 (PMService2) provides Web service access to
the process manager. Axis HTTP Cookie based session management is used. This file is
meant to be used as a session scoped service. If it is used as a request or application
scoped service, session management will not function correctly. This class can also be
used directly in the PM context by creating a new PMService2 object and calling login.
Syntax
java.lang.Object
|
+-com.ejbtech.processmanager.services.PMService2
java.io.Serializable
extends java.lang.Object
implements java.io.Serializable
Field Summary
Field Description
public statiC final CACOPYRIGHT
Constructor Summary
Constructor Description
public PMService2()
Method Summary
Method
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PMService2()
PMService2 Fields
Fields
Fields Description
CACOPYRIGHT public static final java.lang.String CACOPYRIGHT
Example
Computer Associates copyright notice.
Constant value: Copyright (c) 2003-2004 Computer Associates
International, Inc. All rights reserved.
clearLog
Description
Cleans up the log trace and clears the Process Manager log.
Syntax
public void clearLog()
throws PMServiceException
Parameters
None
Return
None
Exception Thrown
PMServiceException
createDefinition
Description
Creates a new process definition. The operation saves the specified process
definition.
Syntax
public java.lang.String createDefinition(java.lang.String xml)
throws PMServiceException
Parameters
Return
The ID of the created process definition
Exception Thrown
PMServiceException if the process definition already exists
deleteActor
Description
Deletes an actor from workflow. This method will throw an exception if there is an
error removing the actor from the database, but it will not throw an exception if the
actor is not found.
Syntax
public void deleteActor(java.lang.String actorName)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException if there is an error removing the actor from the database
deleteDefinition
Description
Deletes a process definition by given ID and permanently removes the process
definition.
Syntax
public void deleteDefinition(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
deleteInstance
Description
Permanently removes the process instance.
Syntax
public void deleteInstance(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
enableLogging
Description
Starts and stops logging performed by the Process Manager.
Syntax
public void enableLogging(boolean enable)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
getActor
Description
Returns a single actor as an XML document. This document is of the same format as
the XML files saved through the export dialog in the Workflow Design Environment.
Syntax
public java.lang.String getActor(java.lang.String actor)
throws PMServiceException
Parameters
Return
An XML representation of the actor
Exception Thrown
PMServiceException
getActors
Description
Returns all actors as an XML document. This document is of the same format as the
XML files saved through the export dialog in the Workflow Design Environment.
Syntax
public java.lang.String getActors()
throws PMServiceException
Parameters
None
Return
All the actors in workflow as an XML document
Exception Thrown
PMServiceException
getConfiguration
Description
Returns a Process Manager configuration. Returned values will contain name/value
pairs with configuration information for the Process Manager. Some of the
configuration information is:
LogBufSize
Identifies the server log buffer size.
WebServiceTimeout
Indicates the amount of time that the Web services actor waits for a response
from a Web service in seconds.
Timeout
This setting affects two back-off times:
■ Specifies the wait period before retrying when no process engine is
available.
■ If a workitem cannot run because a process instance is suspended,
specifies the time before it is queued again. To tune the timeout to reduce
re-queuing activity, increase timeout from its default value of 3000 ms.
EnableReporting
Indicates if data is saved to the Workflow database table "stats", which is used
in Workflow reports and charts. Enter true or false in this field:
■ True (default) indicates that the data is saved to the Workflow database.
■ False indicates that the data is not saved to the Workflow database.
SMTPost
Specifies the Simple Mail Transfer Protocol (SMTP) address when the workflow
sends an email.
FromName
Specifies the name that appears in the From field when the workflow sends an
email.
FromAddress
Specifies the return address when the workflow sends and email.
Engine Pools
Specifies the number of process engine instances that the server runs to
process workflow activities.
MaxWorkitems
Specifies the maximum number of workitems the process engine keeps in
memory. Once the number of instance workitems reaches this value, they are
written to disk. If your CA Workflow server has extensive memory, increasing
the MaxWorkitems value speeds up the performance of large iterations.
UseSnapshots
Indicates if CA Workflow is optimized for increased throughput and better
memory usage. Enter true or false in this field.
■ True specifies that the CA Workflow server uses a new, memory-efficient
database schema, yielding increased throughput. As a result, new process
instances started from the same process definition share common
information.
■ False (default) specifies that the CA Workflow server uses the original
database schema.
LogFileName
Specifies the file name for the Process Manager log file.
ProcessManagerURL
Specifies the URL of the Process Manager used to populate the generated
WSDL.
Syntax
public Pair[] getConfiguration()
throws PMServiceException
Parameters
None
Return
The Process Manager properties as a map
Exception Thrown
PMServiceException
getDefinition
Description
Returns the specified process definition. The entire Process Definition is returned as
a string representing an XML document.
Syntax
public java.lang.String getDefinition(java.lang.String id, boolean lock)
throws PMServiceException
Parameters
Return
The process definition at the specified URL
Throws
PMServiceException
getDefinitionDescriptor
Description
Returns the Process Definition Descriptor for the specified process definition.
Syntax
public ProcessDefinitionDescriptor getDefinitionDescriptor(java.lang.String
id)
throws PMServiceException
Parameters
Return
The process definition descriptor at the specified URL
Exception Thrown
PMServiceException
getDefinitions
Description
Returns an array of process definition descriptors. This returns an array of process
definitions known by the Process Manager. Each array element is a
ProcessDefinitionDescriptor, rather than an entire process definition.
Syntax
public ProcessDefinitionDescriptor[] getDefinitions()
throws PMServiceException
Parameters
None
Return
An array of Process Definition Descriptors
Exception Thrown
PMServiceException
getExternalVariables
Description
Returns the external variables for a process.
Syntax
public Pair[]getExternalVariables(java.lang.String processId)
throws PMServiceException
Parameters
Return
An array of external variables as pairs (see Complex Types-PMServices2)
Exception Thrown
PMServiceException
getInputParameters
Description
Returns input parameters (process attributes) for a selected process definition.
Syntax
public AttributeBean[] getInputParameters(java.lang.String id)
throws PMServiceException
Parameters
Return
A list of input parameters (see Complex Types-PMService2)
Exception Thrown
PMServiceException
getInstance
Description
Returns a string containing the complete process instance object for the specified
process instance expressed as an XML document.
Syntax
public java.lang.String getInstance(java.lang.String id)
throws PMServiceException
Parameters
Return
The process instance at the specified URL or null if no process instance was found
Exception Thrown
PMServiceException
getInstanceDetails()
Description
Returns a string containing the "Process Instance details" for the specified process
instance expressed as an XML document. The returned value contains
bare-minimum details of a given process-instance equal to the getInstance(String)
method of PMService.
Syntax
getInstanceDetails(java.lang.String id)
throws PMServiceException
Parameters
Return
The process instance at the specified URL or null if no process instance was found
Exception Thrown
PMServiceException
getInstanceHistory
Description
Returns the instance history as an array of HistoryRecords.
Syntax
public com.ejbtech.process.HistoryRecord[] getInstanceHistory(java.lang.String
id)
throws PMServiceException
Parameters
Return
An array of history records (see Complex Types-PMService2)
Exception Thrown
PMServiceException
getInstanceImage
Description
Returns a process instance status image.
Syntax
public byte[] getInstanceImage(final String instanceid, TransmissionType tp,
ImageType it)
throws PMServiceException
Parameters
Return
An instance status image either as a byte array or attachment
Exception Thrown
PMServiceException
getInstances
Description
Returns an array of instances for the process definition and returns an array of
process instances known by the Process Manager. Each array element is a
ProcessInstanceDescriptor rather than an entire process instance.
Syntax
public ProcessInstanceDescriptor[] getInstances(java.lang.String
definitionId,long from, long to)
throws PMServiceException
Parameters
Return
An array of process instance objects expressed as XML documents or null if no
process instances exist
Exception Thrown
PMServiceException
getInstanceWorkItems
Description
Returns all the workitems for a particular instance.
Syntax
public com.ejbtech.processengine.WorkItem[]
getInstanceWorkItems(java.lang.String id,
boolean showCompleted)
throws PMServiceException
Parameters
Return
An array of workitems (see Complex Types-PMService2)
Exception Thrown
PMServiceException
getLog
Description
Returns the user's log. This does not return the entire Process Manager log, only
events that occurred since enableLogging was called.
Syntax
public WSLogEntry[] getLog()
throws PMServiceException
Parameters
None
Return
The contents of the log as an array of log entries (see Complex Types-PMService2)
Exception Thrown
PMServiceException
getLoginName
Description
Returns the user name associated with the session, which can be used to find the
user name associated with a token.
Syntax
public java.lang.String getLoginName()
throws PMServiceException
Parameters
None
Return
The name of the user logged in with the session
Exception Thrown
PMServiceException
getResults
Description
Returns process execution results as an array of attributes.
Syntax
public AttributeBean[] getResults(java.lang.String sessionId)
throws PMServiceException
Parameters
Return
An array of attributes (see Complex Types-PMServices2)
Exception Thrown
PMServiceException
getRunningDefinitions
Description
Returns an array of all the definitions that have instances in the system. This
includes definitions that have only completed or terminated/suspended instances.
Each array element is a ProcessDefinitionDescriptor, rather than an entire process
definition.
Syntax
public ProcessDefinitionDescriptor[] getRunningDefinitions()
throws PMServiceException
Parameters
None
Return
An array of Process Definition Descriptors
Exception Thrown
PMServiceException
getStatus
Description
Returns the status of a process.
Syntax
public java.lang.String getStatus(java.lang.String processid)
throws PMServiceException
Parameters
Return
The status of the specified process instance as string
Exception Thrown
PMServiceException
getStatusCode
Description
Returns the status code of a process. The possible status codes are:
■ STATUS_CREATED = 0
■ STATUS_RUNNING = 1
■ STATUS_COMPLETED = 2
■ STATUS_SUSPENDED = 3
■ STATUS_TERMINATED = 4
Syntax
public java.lang.String getStatusCode(java.lang.String processid)
throws PMServiceException
Parameters
Return
A process status as string for numeric value
Exception Thrown
PMServiceException
hasDefinitionPermission
Description
Checks if the current user has a permission on a selected definition. Valid definition
permissions are:
■ PM_EDIT_DEFINITION_SECURITY
■ PM_VIEW_DEFINITION
■ PM_EDIT_DEFINITION
■ PM_DELETE_DEFINITION
■ PM_LOCK_DEFINITION
■ PM_UNLOCK_DEFINITION
■ PM_START_INSTANCE
■ PM_LIST_INSTANCES
Syntax
public boolean hasDefinitionPermission(java.lang.String
permissionName,java.lang.String definitionId)
throws PMServiceException
Parameters
Return
TRUE if the current user has the selected permission; otherwise, returns FALSE
Exception Thrown
PMServiceException
hasGlobalPermission
Description
Checks if the current user has the given global permission. Valid global permission
names are:
■ Login permissions
PD_LOGIN
WL_LOGIN
WM_LOGIN
■ Worklist Permissions
WL_START_PROCESS
WL_REASSIGN_TASK
■ GlobalActorManager permissions
AM_VIEW_ACTOR
AM_CREATE_ACTOR
AM_EDIT_ACTOR
AM_DELETE_ACTOR
■ GlobalProcessManager permissions
PM_ACCESS PD_ACCESS
PM_VIEW_CONFIGURATION
PM_EDIT_CONFIGURATION
PM_VIEW_LOG
PM_CLEAR_LOG
PM_ENABLE_LOG
PM_LIST_DEFINITIONS
PM_CREATE_DEFINITION
■ GlobalObjectManager permissions
OM_VIEW_OBJECT
OM_CREATE_OBJECT
OM_EDIT_OBJECT
OM_DELETE_OBJECT
■ Global ProcessMonitor permissions
PMON_RUN_REPORT
PMON_CREATE_REPORT
PMON_EDIT_REPORT
PMON_DELETE_REPORT
■ Global DataType permissions
DT_CREATE_DATATYPE
DT_DELETE_DATATYPE
DT_VIEW_DATATYPE
Syntax
public boolean hasGlobalPermission(java.lang.String permissionName)
throws PMServiceException
Parameters
Return
TRUE if the current user has this permission; otherwise, returns FALSE
Exception Thrown
PMServiceException
hasInstancePermission
Description
Checks if the current user has a permission on a given instance. Valid instance
permission names are:
■ PM_VIEW_INSTANCE
■ PM_EDIT_INSTANCE
■ PM_DELETE_INSTANCE
■ PM_SUSPEND_INSTANCE
■ PM_RESUME_INSTANCE
■ PM_TERMINATE_INSTANCE
Syntax
public boolean hasInstancePermission(java.lang.String permissionName,
java.lang.String instanceId)
throws PMServiceException
Parameters
Return
TRUE if the current user has permission; otherwise, returns FALSE
Exception Thrown
PMServiceException
isLoggingEnabled
Description
Returns a boolean flag that indicates if logging is enabled.
Syntax
public boolean isLoggingEnabled()
throws PMServiceException
Parameters
None
Return
A boolean TRUE if the Process Manager server enabled logging; otherwise, returns
FALSE
Exception Thrown
PMServiceException
isSessionValid
Description
Checks if this PMService2 session is still valid.
Syntax
public boolean isSessionValid()
throws PMServiceException
Parameters
None
Return
A boolean TRUE if the session is valid; otherwise, returns FALSE
Exception Thrown
PMServiceException
lock
Description
Locks the process definition or process instance identified. The Process Manager
maintains the locks in memory.
Syntax
public void lock(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
logIn
Description
Logs the specified user into the Process Manager. This method is intended to be
used in conjunction with session cookies to establish a user session. You must first
enable session tracking on your Web services client library before calling this
method.
Syntax
public void logIn(java.lang.String user, java.lang.String password)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
loginToken
Description
Logs the specified user into the Process Manager using a token from EIAM. This
method is intended to be used in conjunction with session cookies to establish a
user session. You must first enable session tracking on your Web services client
library before calling this method.
Syntax
public void loginToken(java.lang.String token)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
logOut
Description
Logs out of the Process Manager session.
Syntax
public void logOut()
Parameters
None
Return
None
Exception Thrown
None
purgeAsynchronouslyForCompletedWithStats
Description
Permanently deletes all process instances created from the specified process
definition that started or completed between the specified dates and also the
associated data from the STATS table. This is an asynchronous operation that runs
in the background.
Syntax
public void purgeAsynchronouslyForCompletedWithStats (java.lang.String
definitionId,long from,long to, boolean completed, Boolean deleteStats)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstances
Description
Permanently deletes all process instances created from the specified process
definition that started between the specified dates.
Syntax
public void purgeInstances(java.lang.String definitionId,long from,long to)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstancesAsynchronously
Description
Permanently deletes all process instances created from the specified process
definition that started or completed between the specified dates. This is an
asynchronous operation that runs in the background.
Syntax
public void purgeInstancesAsynchronously(java.lang.String definitionId,long
from,long to, boolean completed)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
purgeInstancesSynchronously
Description
Permanently deletes all process instances created from the specified process
definition that started or completed between the specified dates.
Syntax
public int purgeInstancesSynchronously(java.lang.String definitionId,long
from,long to, boolean completed)
throws PMServiceException
Parameters
Return
Returns the purge operation status. Valid values are:
0 = PURGE_SUCCESS
1 = PURGE_FAILURE_INTERNAL_ERROR
3 = NO_INSTANCES_TO_PURGE
Exception Thrown
PMServiceException
purgeSynchronouslyForCompletedWithStats
Description
Permanently deletes all process instances created from the specified process
definition that started or completed between the specified dates and also the
associated data from the STATS table and run within the specified time period.
Syntax
public int purgeSynchronouslyForCompletedWithStats(java.lang.String
definitionId,long from,long to, boolean completed, boolean deleteStats)
throws PMServiceException
Parameters
Return
Returns the purge operation status. Valid values are:
0 = PURGE_SUCCESS
1 = PURGE_FAILURE_INTERNAL_ERROR
3 = NO_INSTANCES_TO_PURGE
Exception Thrown
PMServiceException
putActors
Description
Puts actors into the workflow database. The format of the XML file is the same as
the format returned by the Workflow Design Environment export option or the
getActors() method. Multiple actors may be present in the XML file. If any of the
actors already exist in the database, they will be skipped.
Syntax
public java.lang.String[] putActors(java.lang.String actorXML)
throws PMServiceException
Parameters
Return
The names of the actors that were successfully added
Exception Thrown
PMServiceException
putConfiguration
Description
Sets a Process Manager configuration. This is used to replace the server properties
object used for Process Manager configuration information.
Syntax
public void putConfiguration(Pair[] configuration)
throws PMServiceException
Parameters
configuration pair[] Specifies a map containing the name, and value pairs
for the properties
Return
None
Exception Thrown
PMServiceException
putDefinition
Description
Updates an existing process definition or creates a new process definition if the
process definition id is null.
Syntax
public java.lang.String putDefinition(java.lang.String xml)
throws PMServiceException
Parameters
Return
The ID of the updated or created process definition
Exception Thrown
PMServiceException
resumeInstance
Description
Resumes the specified process instance, putting the instance back into a running
state.
Syntax
public void resumeInstance(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
setExternalVariables
Description
Sets the external variables for a process instance.
Syntax
public void setExternalVariables(java.lang.String processId,
Pair[] externals)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
start
Description
Starts a new process instance from the specified process definition. The Process
Manager chooses the version of the process definition that is the most effective.
Syntax
public java.lang.String start(java.lang.String definitionId,
com.ejbtech.processengine.Parameter[] parameters)
throws PMServiceException
Parameters
Return
The process instance ID
Exception Thrown
PMServiceException
suspendInstance
Description
Suspends the specified process instance. The process instance can be resumed with
the resumeInstance operation.
Syntax
public void suspendInstance(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
terminateInstance
Description
Terminates the specified process instance. All outstanding workitems are deleted.
Syntax
public void terminateInstance(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
unlock
Description
Unlocks the process definition or process instance identified.
Syntax
public void unlock(java.lang.String id)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException
updateActor
Description
Updates an actor in workflow. The format of the XML is the same as the format
returned by the export actor function of the IDE or the getActor method of this API.
If multiple actors are present in the XML, only the first actor will be used. This
function will throw a PMServiceException if the actor is not found in the database.
Syntax
public void updateActor (java.lang.String actorXML, java.lang.String actorName)
throws PMServiceException
Parameters
Return
None
Exception Thrown
PMServiceException if the actor is not found, or if there is error parsing the XML or
storing it in the database
For example, a fax actor could be an application most of the time but, when the fax
server is not running, the workitems could be done by an individual.
The Worklist Web service operations are identical to the RPC calls used by the Worklist
Client application.
Change the port address of your Web services client to that servers WLService address.
Summary of operations
completeActivity Operation
Description
Completes the specified workitem identified by the workIitemID. If the actor
operation that was to be performed for this workitem assigns values to output
parameters (such as the query user operation) then these values must be passed in
to the completeActivity operation as a comma-separated list. These values should
be ordered in the way they appear in the output parameters dialog in the Workflow
Design Environment. If the number of values does not match the number of output
parameters for the workitem, then a WLServiceException will be thrown.
Syntax
public java.lang.Long completeActivity (java.lang.String sessionID,
java.lang.String dialogParam, java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The completion date as long
Exception Thrown
WLServiceException
getApprovedJNDIUsers Operation
Description
Returns the list of comma-separated LDAP users that should be selected from in an
assignment action.
Syntax
public java.lang.String getApprovedJNDIUsers (java.lang.String
sessionID,java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The list of LDAP users
Exception Thrown
WLServiceException
getInputParameters Operation
Description
Returns the input parameters for a Workitem. Each input parameter returned is
separated by a semicolon and is made up of the following three values separated by
commas:
■ The parameter name
■ The parameter type
■ The parameter value
Syntax
public java.lang.String getInputParameters (java.lang.String sessionID,
java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The input parameters of the Workitem specified in the following format:
<name>,<type>,<value>;…;<name>,<type>,<value>
Exception Thrown
WLServiceException
getInputParametersNumber Operation
Description
Returns the number of input parameters for a workitem.
Syntax
public java.lang.String getInputParametersNumber (java.lang.String sessionID,
java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The number of input parameters as string
Exception Thrown
WLServiceException
getOutputParametersNumber Operation
Description
Returns the number of output parameters for a workitem.
Syntax
public java.lang.String getOutputParametersNumber (java.lang.String sessionID,
java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The number of output parameters as a string
Exception Thrown
WLServiceException
getProcessAttributes Operation
Description
Returns the list of process attributes that have been marked as external. Each
process attribute entry is separated by a semicolon and is made up of three values
separated by commas:
■ attribute name
■ attribute type (the value for type is lower case such as “string” and “integer”)
■ attribute value
Syntax
public java.lang.String getProcessAttributes (java.lang.String sessionID,
java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The list of process attributes
Exception Thrown
WLServiceException
completeForm Operation
Description
Completes the specified form workitem identified by the workitemID.
Syntax
public java.lang.Long completeForm (java.lang.String sessionID,
java.lang.String dialogParam, java.lang.String workitemID)
throws WLServiceException
Parameters
Return
The completion date as long
Exception Thrown
WLServiceException
getWorkItems Operation
Description
Returns the workitems for all users, including workitems for groups.
Syntax
public java.lang.String getWorkItems (java.lang.String sessionID)
throws WLServiceException
Parameters
Return
An XML document that represents all workitems
Exception Thrown
WLServiceException
getWorkItemsForActor Operation
Description
Returns the workitems assigned to an actor excluding the groups to which this actor
belongs. An XML document containing all of the workitems assigned to a user is
returned.
Syntax
public java.lang.String getWorkItemsForActor (java.lang.String sessionID)
throws WLServiceException
Parameters
Return
The XML string of workitems assigned to the actor
Exception Thrown
WLServiceException
isLDAPDirEnabled Operation
Description
Returns a Boolean that indicates if a user source is an LDAP directory.
Syntax
public java.lang.Boolean isLDAPDirEnabled (java.lang.String sessionID)
throws WLServiceException
Parameters
Return
Returns TRUE if the user source is an LDAP directory, or FALSE if not
Exception Thrown
WLServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the worklist
Exception Thrown
WLServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the worklist
Exception Thrown
WLServiceException
logInTokenWL Operation
Description
Logs the user into the local worklist.
Syntax
public java.lang.String logInTokenWL(java.lang.String token)
throws WLServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the worklist
Exception Thrown
WLServiceException
logInWL Operation
Description
Logs the user into the local worklist.
Specifies a semicolon-delimited list of name/value pairs to complete the form
Note: The values can be a comma delimited list.
Sample string: company=CA;group=sales;members=joe, bob, eric
Syntax
public java.lang.String logInWL (java.lang.String usename, java.lang.String
password)
throws WLServiceException
Parameters
Return
The session ID that will be used as a handle for communicating with the worklist
Exception Thrown
WLServiceException
Parameters
Return
None
Exception Thrown
WLServiceException
makeAssignment Method
Description
Returns the string SUCCESS if the assignment action was successful, or returns a list
of coma separated rejection messages. Use the makeAssignment method to take,
return, delegate, or reassign workitems. Take and return actions are used when
working with group workitems. To perform a group workitem, a user must first take
it from the group list. A workitem that was taken from a group can be returned to
the group.
The delegate action is used to delegate the execution of a workitem to another
user. A duplicate of the delegated workitem will appear in that user's worklist;
when the user performs the workitem, both are marked as completed.
The reassign action is used to reassign a workitem to another actor (user or group).
Multiple workitems can be acted on by this operation. The parameters selectedWIs,
selectedWINames, selectedUsersTo, and selectedTaskOwners list the workitems
that are to be acted on, the names of these workitems, to whom the workitems are
to be assigned, and the owners of these workitems.
The parameters assignedby, completedbefore, and dateformat are used only if the
action is delegated. The assignedby parameter is the user who is delegating the
workitems. The completedbefore and dateformat parameters allow the user who is
delegating to provide a due date for the delegated workitem.
Syntax
public java.lang.String makeAssignment (java.lang.String sessionID,
java.lang.String assignmentAction , java.lang.String selectedWIs,
java.lang.String selectedWINames, java.lang.String selectedUsersTo,
java.lang.String selectedTaskOwners , java.lang.String assignedby,
java.lang.String completedbefore,java.lang.String dateformat )
throws WLServiceException
Parameters
assignedby string Specifies the name of the user who is assigning the
workitems
Used for delegation only.
Return
"SUCCESS" or a comma-separated list of rejection messages
Exception Thrown
WLServiceException
turnOffAutoDelegation Operation
Description
Turns off the AutoDelegation setting in the worklist for the currently logged in user.
Syntax
public void turnOffAutoDelegation (java.lang.String sessionID)
throws WLServiceException
Parameters
Return
None
Exception Thrown
WLServiceException
turnOnAutoDelegation Operation
Description
Turns on the auto delegation setting in the worklist by specifying which user or
group the workitems will be auto delegated to.
Syntax
public void turnOnAutoDelegation (java.lang.String sessionID, java.lang.String
autoDelegate)
throws WLServiceException
Parameters
Return
None
Exception Thrown
WLServiceException
Exception Package
ActorException com.ejbtech.actormanager
ActorExportNotSupportedException com.ejbtech.actormanagerri
ActorFaultException com.ejbtech.actormanagerri
ActorImportException com.ejbtech.actormanagerri
Exception Package
ActorManagerException com.ejbtech.actormanager
CallerException com.ejbtech.security
DataTypeManagerException com.ejbtech.datatypemanager
FormException com.ejbtech.worklist.forms
LoginException javax.security.auth.login
ObjectClassException com.ejbtech.objectmanager
ObjectExportNotSupportedException com.ejbtech.objectmanagerri
ObjectImportException com.ejbtech.objectmanagerri
ObjectManagerException com.ejbtech.objectmanager
PMInterfaceException com.ejbtech.processdesigner
PMServiceException com.ejbtech.processmanager.services
ProcessExecutionException com.ejbtech.processengine
ProcessManagerException com.ejbtech.processmanager
SecurityManagerException com.ejbtech.security
TypeConversionException com.ejbtech.util
UnsupportedCallbackException javax.security.auth.callback
WLServiceException com.ejbtech.worklist.services
ActorException
There are two types of an ActorException:
■ Thrown on design time
■ Thrown on runtime
ActorExportNotSupportedException
An ActorExportNotSupportedException is thrown to indicate that an actor does not
support the export operation.
ActorFaultException
An ActorFaultException is a runtime exception to signal an actor operation failure.
ActorImportException
An ActorImportException is thrown to indicate that an actor does not support the
import operation.
ActorManagerException
An ActorManagerException is thrown to indicate one of the following:
■ A user does not have permission to execute one of the Actor Manager functions, or
when a security error occurs
■ The Actor Manager function throws an exception
CallerException
A CallerException is thrown when an HTTP call to any of the system-defined APIs returns
an error.
DataTypeManagerException
A DataTypeManagerException is thrown to indicate one of the following:
■ A user does not have permission to execute one of the Data Type Manager
functions, or when a security error occurs
■ The Data Type Manager function throws an exception
FormException
A FormException is thrown to indicate a failure in building a WEB Form for the worklist.
An exception can be a failure to parse or format input data, or a missing parameter or
workitem.
LoginException
A LoginException is thrown when a user provides the incorrect credentials to log in to an
application.
ObjectClassException
An ObjectClassException is a runtime exception for the ObjectClass and indicates an
operational failure, for example, assigning or completing a workitem.
ObjectExportNotSupportedException
Indicates that an ObjectClass does not support export operation.
ObjectImportException
Indicates that an ObjectClass does not support import operation.
ObjectManagerException
Indicates one of the following:
■ A user does not have permission to execute one of the Object Manager functions or
any of security errors occur
■ An Object Manager function throws an exception
PMInterfaceException
Works as a wrapper for the client presentation of the ProcessManagerException and is
thrown to indicate that there was an attempt to open, save, unlock, or delete a
definition, open an instance, or update a security predicate.
ProcessExecutionException
Indicates one of the following:
■ An attempt to load an already terminated process; an attempt to complete an
activity, object, or an event (send, timer, or due date event) of a process that is
terminated
■ An attempt to start a process that was not created
■ An attempt to start a process with input parameters that are not set
■ An attempt to suspend a process that is not running
■ An attempt to resume a process that is not suspended
■ An attempt to resume a process with resume instructions that are not found
■ An attempt to fire a timer event for a timer node that is not found
■ An attempt to terminate a completed process; an attempt to complete an activity,
object, or event (send, timer, or due date event) of a process that is completed
■ An attempt to complete an activity or object, mark an activity incomplete, fire a
send, timer, or due date event, add a work item history record, or stop a subactivity
and correspondent workitem cannot be found
■ An attempt to get or set the value of a process attribute that cannot be found
■ An attempt to create a wait or send event work item with an undefined operation
■ An attempt to complete an activity, mark an activity incomplete, fire a due date
event, process exception, and correspondent activity workitem does not have an
associated actor
■ An attempt to get an actor for a role that has no actor assigned
■ An attempt to handle an object operation on an object that is not found
■ An attempt to handle an object operation on an object defined on a class that is not
found
■ When call to an actor to complete activity, mark activity completed, or incomplete
returns an error
■ A process has an unsupported attribute type
■ An attempt to complete a work item that is invalid
■ An attempt to complete a work item that is already completed
■ An attempt to set a process attribute that cannot be found
■ An error occurred during evaluating an expression
■ An actor that must be configured is not configured
ProcessManagerException
Defines one of the following exceptions:
■ Process engine originated
The ProcessManagerException wraps a ProcessExecutionException
■ Process manager originated
Indicates an operation error on a process instance or process definition, such as an
error that results from saving or reading a process instance, or deleting or locking a
process definition.
■ Security manager originated
Indicates that no permission has been granted for the current user to execute a
ProcessManager operation.
Runtime ActorException
A runtime ActorException indicates a failure of operation that an actor defined.
SecurityManagerException
A SecurityManagerException is thrown to indicate a communication error during the
smapi call or a missing definition security predicate.
TypeConversionException
Indicates that there is an exception of type conversion thrown. Type conversion is used
to get values of process attributes or operation parameters for supported types.
UnsupportedCallbackException
An UnsupportedCallbackException is thrown when the CallbackHandler defined to
retrieve specific authentication data does not recognize a particular Callback. (A
Callback is an object that contains the information requested to be retrieved.)
Note: Before following this example, contact your system administrator to receive a
valid user ID to access the Workflow Design Environment.
Workflow Steps
1. Get ISBN
This activity prompts the worklist user for the ISBN of the book that is requested
and stores it in the attribute ISBN.
For the purposes of this example, enter any fictional ISBN number.
2. Get Book Price
This activity queries a Web service for the price of the book.
For this example, the Web service generates a random price.
3. Approved Message
This activity informs the worklist user that the request was approved.
This activity is generated only if the price is under $50.00.
4. Denied Message
This activity informs the worklist user that the request was denied.
This activity is generated only if the price is $50.00 or higher.
Roles Used
User
The user who is requesting the book.
Web service
The Web service that returns the price of the book.
Note: If your Workflow Tomcat server is running on a different machine than your
Workflow Design Environment, or if it is running on a port other than 8081, you must
create the actor manually and edit the WSDL URL accordingly. (Importing the sample
WebService actor cannot be done under these circumstances because the WebService
actor is created with a WSDL URL that points to http://localhost:8081.)
package com.ca.workflow.pmservice.client;
import javax.activation.DataHandler;
import javax.xml.rpc.ServiceException;
import com.ejbtech.processmanager.services.PMServiceException;
import com.ejbtech.processmanager.services.PMService;
import com.ejbtech.processmanager.services.PmServiceServiceLocator;
import com.ejbtech.processmanager.services.PmServiceSoapBindingStub;
com.ca.workflow.pmservice.TransmissionType._MIME);
//Image type is PNG.
com.ca.workflow.pmservice.ImageType IT =
com.ca.workflow.pmservice.ImageType.fromString(
com.ca.workflow.pmservice.ImageType._PNG);
service.getInstanceImage(sessid,instanceId, tp, IT);
Object[] attach =
((PmServiceSoapBindingStub)service).getAttachments();
if(attach.length == 0){
throw new Exception("Image attachment is missing");
}
org.apache.axis.attachments.AttachmentPart part =
(org.apache.axis.attachments.AttachmentPart)attach[0];
DataHandler dh = part.getDataHandler();
java.io.InputStream ips = dh.getInputStream();
java.io.FileOutputStream fos = new
java.io.FileOutputStream(imgFilePath);
byte data[] = new byte[1024];
int idataread = -1;
while((idataread=ips.read(data)) != -1 ){
fos.write(data, 0, idataread);
}
fos.close();
}
}
SOAP
SOAP is an abbreviation for Simple Object Access Protocol, a simple XML-based protocol
to let applications exchange information.
WSDL
WSDL is an abbreviation for Web Services Description Language, an XML language for
describing Web services.
Glossary 135
Index
A getApprovedEIAMUsersUsingEIAMFilters Operation
• 19
ActorException • 120 getApprovedJNDIUsers Operation • 103
ActorExportNotSupportedException • 120 getConfiguration Operation • 20, 72
ActorFaultException • 121 getDefinition Operation • 22, 74
ActorImportException • 121 getDefinitionDescriptor Operation • 23, 74
ActorManagerException • 121 getDefinitions Operation • 23, 75
attribute • 55 getExternalVariables Operation • 24, 75
getInputParameters Operation • 76, 103
C getInputParametersArray Operation • 25
CallerException • 121 getInputParametersNumber Operation • 104
Class PMService2 getInstance Operation • 76
Constructors • 67 getInstanceHistory • 77
Fields • 67 getInstanceImage Operation • 28, 78
Methods • 67 getInstances Operation • 26, 78
clearLog Operation • 14, 68 getInstancesByStatus • 29
completeActivity Operation • 102 getInstanceWorkitems • 79
completeForm Operation • 107 getLog • 80
complex types, Process Manager Web Services • 50 getLoginName • 80
components getOutputParametersNumber Operation • 105
Web Service • 10 getProcessAttributes Operation • 106
Worklist • 10 getResults Operation • 31, 81
createDefinition • 68 getRunningDefinitions • 81
getStatus Operation • 32, 82
D getStatusCode Operation • 32, 82
DataTypeManagerException • 121 getWorkitems Operation • 107
deleteActor Operation • 15, 69 getWorkitemsForActor Operation • 108
deleteDefinition Operation • 16, 69 getWSDL Operation • 33
deleteInstance Operation • 16, 70
Design Time ActorException • 121
H
hasDefinitionPermission • 83
E hasGlobalPermission • 84
enableLogging • 70 hasInstancePermission • 86
error handling • 11 HistoryRecord • 56
executing a sample Workflow • 129
I
F importing a sample Workflow • 127
FormException • 122 isEIAMEnabled Operation • 34
isLDAPDirEnabled Operation • 108
G isLoggingEnabled • 87
isSessionValid • 87
getActor Operation • 18, 71
getActors Operation • 18, 71 J
getApprovedEIAMUsers Operation • 19
JNDI User Actor • 127
Index 137
L R
lock • 88 resumeInstance Operation • 46, 96
LogEntry • 56 Runtime ActorException • 124
login • 88
logIn Operation (deprecated) • 35, 109 S
LoginException • 122 security, Web Service • 10
loginToken • 89 SecurityManagerException • 124
logInToken Operation (deprecated) • 37, 110 session management • 54
logInTokenPM Operation • 37 setExternalVariables Operation • 46, 96
logInTokenWL Operation • 110 simple types, Process Manager Web services • 52
logInWL Operation • 111 start • 97
logOut • 89 start Operation • 47
logOut Operation (Process Manager) • 38 suspendInstance Operation • 48, 97
logOut Operation (worklist) • 111
T
O
terminateInstance Operation • 48, 98
ObjectClassException • 122 TypeConversionException • 124
ObjectExportNotSupportedException • 122
ObjectImportException • 122 U
ObjectManagerException • 122
unlock Operation • 49, 98
operations, Process Manager Web Service, list of •
UnsupportedCallbackException • 124
14
updateActor Operation • 49, 99
P V
Parameter • 57
Version • 58
parameter values, pmService WSDL • 50
PMInterfaceException • 122 W
PMService 2 • 9
PMService Client, sample • 132 Web Services Workflow, sample • 125
Process Instance status • 51 WebService Actor, adding a • 128
Process Manager Workitem • 59
Web services facility • 14 Worklist
Web services operations (PMService) • 14 components of • 10
ProcessDefinitionDescriptor • 57
ProcessExecutionException • 123
ProcessInstanceDescriptor • 58
ProcessManagerException • 124
purgeAsynchronouslyForCompletedWithStats
Operation • 41, 90
purgeInstances Operation • 39, 91
purgeInstancesAsynchronously Operation • 39, 91
purgeInstancesSynchronously Operation • 42, 92
purgeSynchronouslyForCompletedWithStats
Operation • 43, 93
putActors Operation • 44, 94
putConfiguration Operation • 44, 95
putDefinition Operation • 45, 95