Government Services Infrastructure - GSi |
|
Create Process Instance Immediate Get Task Output Parameters With Type Get Process Based Data for Report Core Class – VerticalClientApi [Deprecated] – Use VerticalHTTPClientApi Construct VerticalClientApi [Deprecated] / Use VerticalHTTPClientApi createProcessInstanceImmediate getPIStatusForVerticalUnqiueID Get Process Based Data for Report
Overview
This document explains in detail the functions that can be invoked using the GSi Vertical web services API.
This document will help the reader understand and learn
Introduction
Using the GSi Vertical API, process instance creation, process instance status checking and get tasks for user operations can be performed. Also task based operations: Claim and Complete can be performed.
All the above operations are exposed through the VerticalApi Service.
Getting Started
Note: GSi as of the version V1.0/1.x has deprecated the Web Services based API. Instead of this an HTTP(S) based GSi Vertical API is provided. There is a new client API VerticalHTTPClientAPI interface provided for the verticals to invoke the functions provided by the Vertical client API. The method signatures for the existing methods remain the same, only the declaration is what is changed.
This version of the document explains the usage the new Vertical HTTP based Client API and details the new API functions provided.
To use the GSi Vertical API, write a client program (Web Service requestor) in a language of your choice. This client program will send request to the VerticalApi service. The VerticalApi service will process the request and send back the response, which needs to be parsed by the client program. In the current version, by default the Java version of GSi Vertical API client is provided, discussed in later section.
The operations of the service are defined in the WSDL (Web Services Definition Language) file. To connect to the Web Service, the URL for the WSDL needs to be known. The URL will be of the following format:
http://<GSiServerLocation>:<Port>/GSiServer/verticalapi?wsdl
The detail of how the client program connects to the API. depends on the client program language and toolkit used. After connecting the client can send requests to invoke any of the provided operations.
RequirementsSince the GSi Vertical API runs as a Web Service, there is no need to install any specific stuff related to the API. The only software that needs to be installed is the ones required for the client program. In case of the Java version which is provided with the distribution, the VerticalClientApi.jar and Apache Axis related jars are required to be present in the classpath.
API Reference
This section explains the operations provided by the GSi Vertical API service. To access any of the operations provided by the service, the client needs to validate/identify itself. The validate operation request upon success will return a user token. This token should be used for all subsequent requests. Once the client has done with all its service requests, it needs to invoke the disconnect operation to logout.
Validate User
Create Process Instance
Create Process Instance Immediate
Get Process Instance Status
Get Tasks
Claim Task
Complete Task
Get Task Output Parameters
Reject Task
Force Assign Task
Get Task Output Parameters With Type
Get Completed Tasks
Get Process Based Data for Report
Disconnect User
Java Client API ReferenceBy default with the distribution, the Java client for the Vertical API is provided. This can be used by including the VerticalAPI.jar and related jar files in the vertical application classpath.
There are classes provided to access the Vertical API. All access to API is encapsulated in one class VerticalClientApi (Package: com.comat.gsi.common.verticalapi) and this class is used to invoke the operations provided by the Vertical API.
For detailed information, refer to the Javadoc API documents provided with the distribution.
The new vertical API client is provided in the new class VerticalHTTPClientApi (Package: com.comat.gsi.common.verticalapi). This class is used to invoke the operations provided by the HTTP(S) based nwVertical API. Core Class – VerticalClientApi [Deprecated] – Use VerticalHTTPClientApiThis class handles the invocation of the web services based Vertical API. After instantiating the class, first validateUser method has to be invoked. Upon successful execution other methods can be invoked. If the user is not validated remaining methods cannot be invoked.
Every method throws VerticalApiException in 2 possible case ie., first if user is not validated/authenticated and second, if server is not reachable.
Construct VerticalClientApi [Deprecated] / Use VerticalHTTPClientApi
VerticalClientApi Creation
The instance of the VerticalClientApi needs to be created to invoke the vertical API. VerticalClientApi(String serverUrl, String namespace, String serviceName) Parameters:
Sample Usage:
VerticalHttpClientApi Creation The instance of the VerticalHTTPClientApi needs to be created to invoke the vertical API. VerticalHTTPClientApi(String host, int port) Parameters:
Sample Usage:
validateUser
Validates the user information details provided. After the instance creation of the VerticalClientApi object, this method should be called before invoking any other methods.
Signature: void validateUser(String username, String[] role, String[] ou, String verticalName)
Parameters:
Throws:
Sample Usage:
createProcessInstanceThis method creates the process instance with the specified inputs in an asynchronous manner. This request is server by the GSi Server in an asynchronous manner and errors like process not deployed, insufficient inputs are not immediately known by the caller. The success return code indicates that the request is successfully posted.
Signature: int createProcessInstance(String processDefinition, String verticalUniqueID, String requestor, java.util.Map inputParamValues)
Parameters:
Returns: int - Return values 1 - Successfully request sent 2- Request failed 3 - Invalid usertoken
Throws:
Sample Usage:
createProcessInstanceImmediate
This method creates the process instance with the specified inputs in a synchronous manner. This request is server by the GSi Server in a synchronous manner and errors like process not deployed, insufficient inputs are returned immediately.
Signature: int createProcessInstanceImmediate(String processDefinition, String verticalUniqueID, String requestor, java.util.Map inputParamValues)
Parameters:
Returns: Return values 1 - Successfully request sent 2- Insufficient input parameters 3 - Process definition not found 4 - Unknown exception 5 - Invalid user token 6 - Unable to contact WFE
Throws:
Sample Usage:
getPIStatusForVerticalUnqiueIDGet the status of the process instance with the specified input parameters, process name and vertical unique ID. The status will be of the format [the process status:<completed activities (act1,act2,act3)>:<activities in execution(act1,act2,act3):<activities aborted(act1,act2,act3)]
Signature: String getPIStatusForVerticalUnqiueID(String processDefinition, String verticalUniqueID) Parameters:
Throws:
Sample Usage:
getTasks
Gets the open and pending tasks of the user for the roles and organization units specified in validateUser method.
Signature: UserTask[] getTasks() Parameters: None Returns: Array of UserTask objects, which are open or pending
Throws:
Sample Usage:
claimTaskItem
Claim the specified task/task item on behalf of the requestor.
Signature: int claimTaskItem(long taskID,String requestor) Parameters:
Returns: int - return codes 1 - Successfully Claimed 2 - Invalid State 3- Task not found 4 - Failed for unknown reason 5 - Invalid token/ User not authenticated 6 - Unable to contact WFE
Throws:
Sample Usage:
completedTaskItem
Complete the specified task/task item with the passed output parameters..
Signature: int completedTaskItem(long taskID,String taskOutputParams) Parameters:
taskOutputParams – task output in XML format Returns: int - return codes 1 - Successfully Completed 2 - Invalid State 3- Task not found 4 - Failed for unknown reason 5 - Invalid token/ User not authenticated 6 - Unable to contact WFE
Throws:
Sample Usage:
getTaskOutputParams
Get the task output parameters for the specified task/task item.
Signature: String[] getTaskOutputParams(long Parameters:
Returns: String array of output parameter names Throws:
Sample Usage:
rejectTaskItem
Reject the specified task/task item on behalf of the requestor. The task item upon successful rejection is available as an open task for claiming by the potential users.
Signature: int rejectTaskItem(long taskID,String requestor) Parameters:
Returns: int - return codes 1 - Successfully Rejected task 2 - Invalid State 3- Task not found 4 - Failed for unknown reason 5 - Invalid token/ User not authenticated 6 - Unable to contact WFE
Throws:
Sample Usage:
forceAssignTaskItem
Force assign the specified task/task item on behalf of the requestor to the specified assignto user.
Signature: int forceAssignTaskItem(long taskID, String requestor, String assignTo) Parameters:
Returns: int - return codes 1 - Successfully force assigned task 2 - Invalid State 3- Task not found 4 - Failed for unknown reason 5 - Invalid token/ User not authenticated 6 - Unable to contact WFE
Throws:
Sample Usage:
getTaskOutputParamsWithType
Get the task output parameters for the specified task/task item with the parameter data types.
Signature: String[][] getTaskOutputParamsWithType(long taskID) Parameters:
Returns: String 2 dimensional array of task output parameters and their types Throws:
Sample Usage:
getCompletedTasks
Gets the completed tasks of the user for the roles and organization units specified in validateUser method.
Signature: UserTask[]getCompletedTasks () Parameters: None Returns: Array of UserTask objects, which are completed by the logged in user.
Throws:
Sample Usage:
Get Process Based Data for ReportThis method gets the process data (specific to the vertical) based on the specified search criteria. The search is based on process/activity definition, state and process attributes values.
Signature: String[] getProcessData(String[] processNames, int processState, int actId, int actState, Condition reqCond, Condition verticalIDCond, ProcessAttributeCriteria attrFilter, Date startedFromDate, Date startedToDate, Date endedFromDate, Date endedToDate ) throws VerticalApiException Parameters: processNames processState actId actState reqCond - Process Requestor name based Condition verticalIDCond - vertical mapping id based Condition attrFilter - process attribute based conditions criteria ProcessAttributeCriteria startedFromDate startedToDate endedFromDate endedToDate Returns: String[] - each record csv based Format : Vertical mapping id, Process name (can be empty), Status, Requestor(can be empty), Started Date, Completed Date, Time taken for completion (msec)
Throws:
Sample Usage:
disconnectUser
Disconnects/Logouts the user and after this invocation, any requests to other operations will fail with Invalid token/User not authenticated error.
Signature: void disconnectUser() Parameters: None Throws:
Sample Usage:
Appendix
WSDL Document
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="VerticalApi" targetNamespace="http://com.comat.gsi.common.verticalapi" xmlns:tns="http://com.comat.gsi.common.verticalapi" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://com/comat/gsi/common/verticalapi/types" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> <types> <schema targetNamespace="http://com/comat/gsi/common/verticalapi/types" xmlns:tns="http://com/comat/gsi/common/verticalapi/types" xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOfInputParam"> <complexContent> <restriction base="soap11-enc:Array"> <attribute ref="soap11-enc:arrayType" wsdl:arrayType="tns:InputParam[]"/></restriction></complexContent></complexType> <complexType name="InputParam"> <sequence> <element name="key" type="string"/> <element name="value" type="string"/></sequence></complexType> <complexType name="ArrayOfstring"> <complexContent> <restriction base="soap11-enc:Array"> <attribute ref="soap11-enc:arrayType" wsdl:arrayType="string[]"/></restriction></complexContent></complexType> <complexType name="ArrayOfUserTask"> <complexContent> <restriction base="soap11-enc:Array"> <attribute ref="soap11-enc:arrayType" wsdl:arrayType="tns:UserTask[]"/></restriction></complexContent></complexType> <complexType name="UserTask"> <sequence> <element name="id" type="long"/> <element name="prdName" type="string"/> <element name="tskClaimedTime" type="long"/> <element name="tskCreatedTime" type="long"/> <element name="tskInputXml" type="string"/> <element name="tskName" type="string"/> <element name="tskPerformer" type="string"/> <element name="tskPotentialOu" type="string"/> <element name="tskPotentialRole" type="string"/> <element name="tskStatus" type="short"/> </sequence> </complexType> </schema> </types> <message name="VerticalApi_claimTaskItem"> <part name="long_1" type="xsd:long"/> <part name="String_2" type="xsd:string"/> <part name="String_3" type="xsd:string"/> </message> <message name="VerticalApi_claimTaskItemResponse"> <part name="result" type="xsd:int"/> </message>
<message name="VerticalApi_completedTaskItem"> <part name="long_1" type="xsd:long"/> <part name="String_2" type="xsd:string"/> <part name="String_3" type="xsd:string"/> </message> <message name="VerticalApi_completedTaskItemResponse"> <part name="result" type="xsd:int"/> </message>
<message name="VerticalApi_createProcessInstance"> <part name="String_1" type="xsd:string"/> <part name="String_2" type="xsd:string"/> <part name="String_3" type="xsd:string"/> <part name="arrayOfInputParam_4" type="ns2:ArrayOfInputParam"/> <part name="String_5" type="xsd:string"/> </message> <message name="VerticalApi_createProcessInstanceResponse"> <part name="result" type="xsd:int"/> </message>
<message name="VerticalApi_createProcessInstanceImmediate"> <part name="String_1" type="xsd:string"/> <part name="String_2" type="xsd:string"/> <part name="String_3" type="xsd:string"/> <part name="arrayOfInputParam_4" type="ns2:ArrayOfInputParam"/> <part name="String_5" type="xsd:string"/> </message> <message name="VerticalApi_createProcessInstanceImmediateResponse"> <part name="result" type="xsd:int"/> </message>
<message name="VerticalApi_disconnectUser"> <part name="String_1" type="xsd:string"/> </message> <message name="VerticalApi_disconnectUserResponse"/>
<message name="VerticalApi_getPIStatusForVerticalUnqiueID"> <part name="String_1" type="xsd:string"/> <part name="String_2" type="xsd:string"/> <part name="String_3" type="xsd:string"/> </message> <message name="VerticalApi_getPIStatusForVerticalUnqiueIDResponse"> <part name="result" type="xsd:string"/> </message>
<message name="VerticalApi_getTaskOutParams"> <part name="long_1" type="xsd:long"/> <part name="String_2" type="xsd:string"/> </message> <message name="VerticalApi_getTaskOutParamsResponse"> <part name="result" type="ns2:ArrayOfstring"/> </message>
<message name="VerticalApi_getTasks"> <part name="String_1" type="xsd:string"/> </message> <message name="VerticalApi_getTasksResponse"> <part name="result" type="ns2:ArrayOfUserTask"/> </message>
<message name="VerticalApi_sendCustomObject"> <part name="arrayOfInputParam_1" type="ns2:ArrayOfInputParam"/></message> <message name="VerticalApi_sendCustomObjectResponse"> <part name="result" type="xsd:string"/></message> <message name="VerticalApi_sendCustomObject2"> <part name="arrayOfUserTask_1" type="ns2:ArrayOfUserTask"/></message> <message name="VerticalApi_sendCustomObject2Response"> <part name="result" type="xsd:string"/></message> <message name="VerticalApi_sendCustomObject3"> <part name="InputParam_1" type="ns2:InputParam"/></message> <message name="VerticalApi_sendCustomObject3Response"> <part name="result" type="xsd:string"/></message> <message name="VerticalApi_sendCustomObject4"> <part name="UserTask_1" type="ns2:UserTask"/></message> <message name="VerticalApi_sendCustomObject4Response"> <part name="result" type="xsd:string"/></message>
<message name="VerticalApi_validateUser"> <part name="String_1" type="xsd:string"/> <part name="arrayOfString_2" type="ns2:ArrayOfstring"/> <part name="arrayOfString_3" type="ns2:ArrayOfstring"/> <part name="int_4" type="xsd:int"/> </message> <message name="VerticalApi_validateUserResponse"> <part name="result" type="xsd:string"/> </message>
<portType name="VerticalApi"> <operation name="claimTaskItem" parameterOrder="long_1 String_2 String_3"> <input message="tns:VerticalApi_claimTaskItem"/> <output message="tns:VerticalApi_claimTaskItemResponse"/></operation> <operation name="completedTaskItem" parameterOrder="long_1 String_2 String_3"> <input message="tns:VerticalApi_completedTaskItem"/> <output message="tns:VerticalApi_completedTaskItemResponse"/></operation> <operation name="createProcessInstance" parameterOrder="String_1 String_2 String_3 arrayOfInputParam_4 String_5"> <input message="tns:VerticalApi_createProcessInstance"/> <output message="tns:VerticalApi_createProcessInstanceResponse"/></operation> <operation name="createProcessInstanceImmediate" parameterOrder="String_1 String_2 String_3 arrayOfInputParam_4 String_5"> <input message="tns:VerticalApi_createProcessInstanceImmediate"/> <output message="tns:VerticalApi_createProcessInstanceImmediateResponse"/></operation> <operation name="disconnectUser" parameterOrder="String_1"> <input message="tns:VerticalApi_disconnectUser"/> <output message="tns:VerticalApi_disconnectUserResponse"/></operation> <operation name="getPIStatusForVerticalUnqiueID" parameterOrder="String_1 String_2 String_3"> <input message="tns:VerticalApi_getPIStatusForVerticalUnqiueID"/> <output message="tns:VerticalApi_getPIStatusForVerticalUnqiueIDResponse"/></operation> <operation name="getTaskOutParams" parameterOrder="long_1 String_2"> <input message="tns:VerticalApi_getTaskOutParams"/> <output message="tns:VerticalApi_getTaskOutParamsResponse"/></operation> <operation name="getTasks" parameterOrder="String_1"> <input message="tns:VerticalApi_getTasks"/> <output message="tns:VerticalApi_getTasksResponse"/></operation> <operation name="sendCustomObject" parameterOrder="arrayOfInputParam_1"> <input message="tns:VerticalApi_sendCustomObject"/> <output message="tns:VerticalApi_sendCustomObjectResponse"/></operation> <operation name="sendCustomObject2" parameterOrder="arrayOfUserTask_1"> <input message="tns:VerticalApi_sendCustomObject2"/> <output message="tns:VerticalApi_sendCustomObject2Response"/></operation> <operation name="sendCustomObject3" parameterOrder="InputParam_1"> <input message="tns:VerticalApi_sendCustomObject3"/> <output message="tns:VerticalApi_sendCustomObject3Response"/></operation> <operation name="sendCustomObject4" parameterOrder="UserTask_1"> <input message="tns:VerticalApi_sendCustomObject4"/> <output message="tns:VerticalApi_sendCustomObject4Response"/></operation> <operation name="validateUser" parameterOrder="String_1 arrayOfString_2 arrayOfString_3 int_4"> <input message="tns:VerticalApi_validateUser"/> <output message="tns:VerticalApi_validateUserResponse"/></operation></portType> <binding name="VerticalApiBinding" type="tns:VerticalApi"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/> <operation name="claimTaskItem"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="completedTaskItem"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="createProcessInstance"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="createProcessInstanceImmediate"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="disconnectUser"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="getPIStatusForVerticalUnqiueID"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="getTaskOutParams"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="getTasks"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="sendCustomObject"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="sendCustomObject2"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="sendCustomObject3"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="sendCustomObject4"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation> <operation name="validateUser"> <soap:operation soapAction=""/> <input> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></input> <output> <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://com.comat.gsi.common.verticalapi"/></output></operation></binding> <service name="VerticalApi"> <port name="VerticalApiPort" binding="tns:VerticalApiBinding"> <soap:address location="http://localhost:8080/GSiServer/verticalapi"/></port> </service> </definitions>
|