Professional Documents
Culture Documents
Important Information
SOME TIBCO SOFTWARE EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN THE LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE LICENSE FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIBCO, The Power of Now, TIBCO Enterprise Message Service and TIBCO ActiveMatrix are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright 2005-2012 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information
Contents i
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix
Changes from the Previous Release of this Guide . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx Typographical Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi Connecting with TIBCO Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How to Join TIBCOmmunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How to Access TIBCO Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . How to Contact TIBCO Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii xxiii xxiii xxiii
Chapter 1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
TIBCO ActiveMatrix BPM Components and Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 TIBCO ActiveMatrix BPM APIs and How to Obtain Them . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 BPM Web Service API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Java Service Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Obtaining Information From TIBCO Business Studio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Work Data Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Formal Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Migration Issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Version 1.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 2 Developing a .NET Client Application Using the Web Service API . . . . . . . . . . . . . 11
The BPMTestApplication Example Client. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting the BPMTestApplication Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . BPMTestApplication Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Generating Service Model Code for BPM Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Handling Choice Elements in the BPM API Schemas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 13 13 14 15 15 15 16
Configuring Service Endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Authenticating the Calling User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Obtaining the Calling Users GUID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
ii
| Contents
Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Writing Adapter Methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Requirement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Writing the Application Layer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Rendering a Form for a Work Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . FormRedirect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The onTIBCOFormRunnerLoad Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 34 34 36 37
Chapter 3 Developing a Client Application Using the Java Service Connector API . . . . . . . . 43
Overview of the Java Service Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Enabling the Java Service Connector for Your Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . 44 The Sample Client Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Getting the SampleApp Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 47 47 49
Instantiating and Configuring the Service Connector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Setting up the Security Handler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 Authenticating the Calling User. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 Executing the Service Connector API Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Implementing the Client User Interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 Rendering a Form for a Work Item . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Displaying the Work Item Data as a TIBCO form. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The onTIBCOFormRunnerLoad Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 62 62 66 67
74 74 75 76
Contents iii
Runtime Authentication. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Implementing SSO Authentication Using a SAML Token. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Handling Time Differences Between the Client System and the BPM Runtime When Using Validity Periods in a SAML Assertion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 Using the Service Connector SamlSenderVouchesSecurityHandler Method. . . . . . . . . . . . . . . . . . . . . . . . 80 Using TIBCO ActiveMatrix BPM as the Authority for SSO Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create the Public Root Certificate and BPM Truststore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Generate a Client Certificate and Keystore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Create a SAML Assertion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 82 83 84
iv
| Contents
Process Instance State Transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159 Migrating a Process Instance to a Different Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Contents v
Identifying the Client Channel in a Service Call . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236 Rendering a TIBCO Business Studio Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238 Displaying a Work Item Form. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239 Displaying a Form in a Pageflow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242 Displaying a Form in a Business Service. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251 Using Custom Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Presentation Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256 Data Format and Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Example Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315 Event Measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316 Event Measure Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
vi
| Contents
requestProcessDurationMeasure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322 requestProcessTemplateMeasure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325 requestWorkItemPerformanceForTemplate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
Contents vii
Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355 setPushDestinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
viii
| Contents
Chapter 17 BusinessService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
listCategories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388 queryCategories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 listBusinessServices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 392 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393 queryBusinessServices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395 startBusinessService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 398 updateBusinessService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401 injectBusinessServiceEvent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406 cancelBusinessService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Contents ix
| Contents
Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462 isQueryRegistered . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464 registerQuery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467 unRegisterQuery. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469 lookupQueryByTag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
Contents xi
Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500 listLDAPAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503 listLDAPAttributeNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507 listContainerResources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 509 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
xii
| Contents
Chapter 27 PageFlowService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
listPageFlows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540 startPageFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 541 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543 updatePageFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 545 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 547 injectPageFlowEvent. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 548 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 549 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 550 cancelPageFlow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551
Contents xiii
Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573 listProcessInstanceAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 574 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 577 listSetofProcessInstanceAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 578 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 580 listProcessInstances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 581 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 583 listProcessTemplateAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 586 listProcessTemplates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 588 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 589 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 590 listStarterOperations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593 queryDone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596 queryFirstPage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600 queryLastPage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603 queryNextPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 607 queryPreviousPage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 608 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 609 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 611 queryProcessInstanceCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 613 queryProcessInstances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 615 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616 queryProcessInstancesAlt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 617
xiv
| Contents
SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 619 queryProcessTemplateCount . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 620 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 621 queryProcessTemplates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 623 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 625 queryProcessTemplatesAlt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628 resumeProcessInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 629 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 630 resumeProcessInstances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632 setDeadlineExpiration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 633 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 setPriority . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636 suspendProcessInstance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 637 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638 suspendProcessInstances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640 getMigrationPoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642 setMigrationRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645 unsetMigrationRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 647 clearMigrationRules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 648 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649 Java Method. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 649
Contents xv
isSetMigrationRule. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 650 SOAP Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 Java Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 651 listMigrationRules. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 652 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 653 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
xvi
| Contents
Chapter 32 WorkItemManagementService . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
getWorkItemHeader . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 682 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 openWorkItem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 685 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687 closeWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 688 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 689 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691 allocateWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694 allocateAndOpenWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698 allocateAndOpenNextWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702 unallocateWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705 completeWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 707 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709 skipWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 711 reallocateWorkItem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 714 reallocateWorkItemData . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 715 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718 getOfferSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 720 saveOpenWorkItem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 721 Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 722 Service Connector API (Java Method). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 724 pendWorkItem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 725
Contents xvii
Web Service API (SOAP Operation) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726 Service Connector API (Java Method) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726
xviii Contents
| xix
Preface
TIBCO ActiveMatrix BPM is TIBCOs next-generation business process management platform. This document provides information for developers producing applications to be used with TIBCO ActiveMatrix BPM. For demonstration purposes only, Web service API (SOAP) examples shown in this guide have been generated using the open source tool soapUI (available from http://www.soapui.org.).
Topics
Changes from the Previous Release of this Guide, page xx Typographical Conventions, page xxi Connecting with TIBCO Resources, page xxiii
xx
Preface xxi
Typographical Conventions
The following typographical conventions are used in this manual. Table 1 General Typographical Conventions Convention
TIBCO_HOME
Use Many TIBCO products must be installed within the same home directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\Program Files (x86)\tibco. TIBCO ActiveMatrix BPM installs into a directory within TIBCO_HOME. The value depends on the operating system. For example on Windows systems, the default value is C:\Program Files (x86)\tibco\amx-bpm.
code font
Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example: Use MyCommand to start the foo process.
Bold code font is used in the following ways: In procedures, to indicate what a user types. For example: Type admin. In large code samples, to indicate the parts of the sample that are of particular interest. In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, MyCommand is enabled:
MyCommand [enable | disable]
italic font
Italic font is used in the following ways: To indicate a document title. For example: See TIBCO ActiveMatrix BPM Concepts. To introduce new terms For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal. To indicate a variable in a command or code syntax that you must replace. For example: MyCommand PathName
Key combinations
Key name separated by a plus sign indicate keys pressed simultaneously. For example: Ctrl+C. Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q.
xxii
| Typographical Conventions
Table 1 General Typographical Conventions (Contd) Convention Use The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances. The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result. The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken. Table 2 Syntax Typographical Conventions Convention
[ ]
A logical OR that separates multiple items of which only one may be chosen. For example, you can select only one of the following parameters:
MyCommand para1 | param2 | param3
{ }
A logical group of items in a command. Other syntax notations may appear within each logical group. For example, the following command requires two parameters, which can be either the pair param1 and param2, or the pair param3 and param4.
MyCommand {param1 param2} | {param3 param4}
In the next example, the command requires two parameters. The first parameter can be either param1 or param2 and the second can be either param3 or param4:
MyCommand {param1 | param2} {param3 | param4}
In the next example, the command can accept either two or three parameters. The first parameter must be param1. You can optionally include param2 as the second parameter. And the last parameter is either param3 or param4.
MyCommand param1 [param2] {param3 | param4}
Preface xxiii
|1
Chapter 1
Introduction
This chapter provides some introductory material that you should be aware of before using the TIBCO ActiveMatrix BPM API to invoke BPM web services.
Topics
TIBCO ActiveMatrix BPM Components and Services, page 2 TIBCO ActiveMatrix BPM APIs and How to Obtain Them, page 4 Obtaining Information From TIBCO Business Studio, page 7 Migration Issues, page 9
| Chapter 1
Introduction
Service virtualization
Work Manager Business Resource Management services Work Presentation services Pageflow services BPM Node BPM runtime Directory services Business services
Table 3 briefly summarizes the main functions provided by each logical node type.
Table 3 TIBCO ActiveMatrix BPM logical node and service summaries Logical Node Process Manager Description Provides the following services: Process services - which execute business process management applications that have been designed in TIBCO Business Studio and deployed to the BPM runtime. Event Collection services - which collect and correlate business process events. Calendar services - which provide services such as working time and working availability information for BPM entities.
Work Manager
Provides a collection of services that deals with the management of human resources: Business Resource Management services - which are responsible for distributing and managing work. Directory services - which maintain the runtime organization model and provide all authentication and authorization services. Work Presentation services - which are used to get work presentation details for and perform actions on work items. Pageflow services - which are used to get information about and interact with deployed pageflows. Business services - which are used to get information about and interact with deployed business services.
| Chapter 1
Introduction
You can generate WSDL files for individual BPM services directly from TIBCO ActiveMatrix Administrator, as shown in the following example.
See the TIBCO ActiveMatrix Administrator documentation for more information about how to do this. A generated WSDL file contains just the definition of a specific service, including all XSD data types used by that service. Which Method Should I Use? If you are writing a large application that needs to access multiple BPM services, using the BPM public web service API may be preferable. When generating code-bindings, using external, shared XSDs can often produce easier to use code than duplicating the types at the top of each WSDL file.
TIBCO ActiveMatrix BPM - BPM Developers Guide
| Chapter 1
Introduction
If you are developing lightweight applications that access only a limited number of services, generated WSDLs may be suitable. For example, if you only wanted to access the EntityResolverService, using a generated WSDL would avoid the overhead of parsing the entire de.wsdl file, which provides access to all BPM Directory Services.
You will need this information to handle a work item, pageflow or business service that uses any data fields or formal parameters that are defined (by external reference) as types in these schemas. See Handling a Work Item That Contains Business Data on page 216 for more information.
| Chapter 1
File wt.xml
Introduction
Description Contains the XML data structures of all work types used in the project. (Each user activity in a business process has a work type associated with it. A work type defines the interface - input, output and inout parameters - to a work item.) You will need this information to display a work item using a custom form. See Using Custom Forms for more information.
pfActivityType.xml
Contains the XML data structure for each user activity in a pageflow process (or business service) in the project. You will need this information to display a page (for a pageflow or business service) using a custom form. See Using Custom Forms for more information.
wm.xml
Contains the XML data structures of all work models used in the project. Currently you do not need this information. For more information about Work Data Models and how to export them, see "Exporting Projects to a Work Data Model" in TIBCO Business Studio Process Modeling.
Formal Parameters
Various operations require you to specify the details of formal parameters used by a process. You cannot determine which data fields are formal parameters programmatically. Instead, you must obtain this information directly from the relevant project in TIBCO Business Studio.
Migration Issues 9
Migration Issues
This section describes issues that you should be aware of when migrating client applications to new versions of TIBCO ActiveMatrix BPM.
Version 1.3
Using getWorkListItems in a Client Application Up to and including version 1.2, the entityID element used by getWorkListItems is contained within a choice element.
In some programming environments (such as .NET in its default form), choice elements are represented by a parent entity (in this case, Item) which can be cast to any of the types which the choice allows. See Handling Choice Elements in the BPM API Schemas on page 16.
10
| Chapter 1
Introduction
An existing application built using the version 1.2 BPM web service API will continue to run against TIBCO ActiveMatrix BPM version 1.3. However, if you rebuild an existing application (that uses getWorkListItems) against the version 1.3 BPM web service API, you should change your code to directly use entityID (instead of casting).
| 11
Chapter 2
This chapter outlines the basic steps involved in using the web service API to develop a custom client application. It also describes an example .NET client application that is supplied with this guide to illustrate these steps.
Topics
The BPMTestApplication Example Client, page 12 Generating Service Model Code for BPM Services, page 15 Configuring Service Endpoints, page 19 Authenticating the Calling User, page 23 Obtaining the Calling Users GUID, page 25 Writing Adapter Methods, page 28 Writing the Application Layer, page 31 Rendering a Form for a Work Item, page 34
12
| Chapter 2
It allows you to open, close and submit work items from the work list, using standard TIBCO forms.
System Requirements
To be able to examine and run BPMTestApplication you must have the following software installed: Microsoft Visual Studio 2010 Microsoft .NET Framework 4
14
| Chapter 2
BPMTestApplication Architecture
The BPMTestApplication solution contains two projects: BPMTestApplication - implements the application layer, which provides the client user interface and end-user functionality. ProxyLayer - provides the interface between the application layer and BPM services.
Implementation
BPMTestApplication uses Windows Communication Foundation (WCF) to manage its communication with BPM services. The services.cs file, in the ProxyLayer project of the BPMTestApplication solution, is a service model code file that represents the Business Resource Management Services, Directory Services and Work Presentation Services. The services.cs file was created using the following procedure: 1. Download the zip file containing the BPM public web service API. 2. Open a Microsoft Visual Studio command prompt. 3. Change to the directory containing the WSDL/XSD files. 4. Run the command:
Svcutil.exe /out:Services.cs brm.wsdl de.wsdl wp.wsdl *.xsd
Alternatively, you could use the following command to generate a service model code file that contains the entire BPM web service API:
Svcutil.exe /out:Services.cs *.wsdl *.xsd
16
| Chapter 2
The definition contains an xsd:choice element that determines whether the field value is of type: simpleSpec - a simple data type (such as an integer or string) complexSpec - a business data type (derived from a Business Object Model class).
When you generate the services.cs file, the .NET Framework translates this part of the XML schema into the following code:
public partial class FieldType { . . /// <remarks/> [System.Xml.Serialization.XmlElementAttribute("complexSpec", typeof(FieldTypeComplexSpec), Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 0)] [System.Xml.Serialization.XmlElementAttribute("simpleSpec", typeof(FieldTypeSimpleSpec), Form = System.Xml.Schema.XmlSchemaForm.Unqualified, Order = 0)] public object Item { get { return this.itemField; } set { this.itemField = value; } } . .
The field is given the object type, but also carries two XmlElementAttribute attributes - one tells the serialization engine to serialize the type as a fieldTypeComplexSpec instance, the other to serialize the type as a fieldTypeSimpleSpec instance. This indicates that the field could be either a simple type or a complex type. If you need to handle a piece of FieldType data in your code, at runtime you must programmatically determine whether the instance is of type fieldTypeComplexSpec or fieldTypeSimpleSpec. For example: 1. Use an if .. is condition to determine the objects data type. 2. Explicitly cast the object to the correct data type before processing it.
18
| Chapter 2
if (field.Item is FieldTypeSimpleSpec) { FieldTypeSimpleSpec item = (FieldTypeSimpleSpec)field.Item; // Process item as a piece of simple data } else { FieldTypeComplexSpec item = (FieldTypeComplexSpec)field.Item; // Process item as a piece of business data }
<wsdl:service name="EntityResolverService"> <wsdl:port name="EntityResolverService_EP" binding="impl:EntityResolverService_EP"> <soap:address location="http://localhost:8080/amxbpm/EntityResolverService"/> </wsdl:port> </wsdl:service> <wsdl:service name="WorkListService"> <wsdl:port name="WorkListService_EP" binding="impl:WorkListService_EP"> <soap:address location="http://localhost:8080/amxbpm/WorkListService"/> </wsdl:port> </wsdl:service>
A WSDL generated for a service from TIBCO Administrator uses a default of http://0.0.0.0:8080/servicePath. For example:
<wsdl:service name="WorkManager_implementation.de_1.2.0.001_service_EntityResolverService_1.2. 0_EntityResolverService_EntityResolverService"> <wsdl:port name="EntityResolverService.soap" binding="tns:EntityResolverService.soap"> <soap:address location="http://0.0.0.0:8080/amxbpm/EntityResolverService"/> </wsdl:port> </wsdl:service>
If necessary, you should reconfigure these endpoints to values appropriate to your requirements (either programmatically or via configuration).
20
| Chapter 2
Implementation
BPMTestApplication allows a user to select the BPM runtime to which they want to connect. It therefore includes logic to dynamically set the endpoint before calling a BPM service. The ServiceClientFactory.cs file defines the ServiceClientFactory class. This class is the central entry point used to acquire the WCF client classes (defined in the services.cs file) which are used to call the BPM services. ServiceClientFactory uses the following methods to configure the endpoints to be used to contact each BPM service. The methods use the data gathered from the user in the login dialog (Host, Port and Use HTTPS values) to dynamically configure each endpoint. Method GetEntityResolverClient, GetWorkItemManagementServiceClient, GetWorkListServiceClient GetEntityUrl, GetWorkItemManagementServiceURL, GetWorkListServiceURL GetUrl, GetBaseURL CreateHttpBinding Description Gets the WCF client that calls the indicated service
Generic methods, used by the Get*Url methods, to generate a URL for the service endpoint Creates an HTTP or HTTPS binding for the endpoint
GetWorkListServiceClient uses the following methods: CreateHttpBinding is used to create the appropriate HTTP binding type defining whether the SOAP message will be sent over HTTP (unsecured) or
HTTPS (secured). The _secure value is derived from the Use HTTPS checkbox in the login dialog.
private BasicHttpBinding CreateHttpBinding(String name) { BasicHttpBinding binding; if (_secure) { binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport); binding.Security.Transport.ClientCredentialType= HttpClientCredentialType.None; } else { binding = new BasicHttpBinding(BasicHttpSecurityMode.None); } binding.Name = name; return binding; }
The name parameter supplied can be any string. There is no requirement to match the port name value used in the WSDL file. GetWorkListServiceUrl is used to build the endpoint address string. The _host, _port and _secure values are derived from the Host, Port and Use HTTPS fields from the login dialog.
private string GetWorkListServiceUrl() { return GetUrl("amxbpm/WorkListService"); } private string GetUrl(string endpoint) { string protocol; if (_secure) { protocol = "https://"; } else { protocol = "http://"; } return protocol + _host + ":"+_port+"/" + endpoint; }
22
| Chapter 2
The path component of the endpoint address (amxbpm/WorkListService) must match the one shown in the WSDL file from which the WorkListServiceClient object was derived. For simplicity, it is passed directly to GetURL as a hard-coded string in this example.
A TIBCO ActiveMatrix BPM LDAP authentication application (for example, amx.bpm.auth.easyAs) uses this token to authenticate the calling user. If the token does not identify a known TIBCO ActiveMatrix BPM user, the call is rejected. See Authenticating Access to a TIBCO ActiveMatrix BPM Service for more information about direct and SSO authentication methods and how to use them in different situations.
Implementation
BPMTestApplication uses a UsernameToken to authenticate the calling user. WCF provides standard mechanisms to add a UsernameToken to the SOAP header of an outgoing message. However, these mechanisms cannot be used for authentication against a BPM service because the UsernameToken produced does not comply with the WS-Security standard. (See http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4df3354f-0627-4 2d9-b5fb-6e880b60f8ee.) Instead, BPMTestApplication implements a custom behavior to insert a WS-Security-compliant UsernameToken into the SOAP header of an outgoing message: 1. UsernameHeader.cs defines a custom SOAP header that includes a WS-Security-compliant UsernameToken, using the username and password supplied in the login dialog. (See Obtaining the Calling Users GUID.) 2. UsernameBehavior.cs and UsernameHeaderInspector.cs define a custom endpoint behavior which overwrites the default SOAP header with the custom header when a message to the endpoint is constructed. 3. A ServiceClientFactory constructor (in ServiceClientFactory.cs) adds the custom endpoint behavior to each WCF client object.
24
| Chapter 2
public ServiceClientFactory(string user, string password, string host, string port, bool secure) : this(host,port,secure) { SecurityBehavior = new UsernameBehavior(user, password); } public IEndpointBehavior SecurityBehavior { get; set; } public WorkListServiceClient GetWorkListServiceClient() { WorkListServiceClient clnt = new WorkListServiceClient( CreateHttpBinding("WorkListService.soap"), new EndpointAddress(GetWorkListServiceUrl())); clnt.Endpoint.Behaviors.Add(SecurityBehavior); return (clnt); }
Implementation
BPMTestApplication obtains the users GUID when they log in: 1. The Main method (in BPMTestApplication.cs) creates a new loginForm object, which displays the LoginForm dialog in which the user can enter a name and password.
class BPMTestApplication { public static void Main() { LoginForm loginForm = new LoginForm(); DialogResult result = loginForm.ShowDialog(); if (result == DialogResult.OK) { Adapter _adapter = loginForm.ProxyAdapter; string _guid = loginForm.Guid; WorkList workList = new WorkList(_adapter,_guid); workList.ShowDialog(); } } }
26
| Chapter 2
2. The button1_Click method on the loginForm class (defined in LoginForm.cs): a. creates a new Adapter object, passing the data collected in the LoginForm dialog. b. calls the getGUID method on the ProxyAdapter object to obtain the GUID associated with that username.
private void button1_Click(object sender, EventArgs e) { // Gather the information required from the various fields // Now call into our adapter, to make the "login" try { ProxyAdapter = new Adapter(usernameBox.Text, passwordBox.Text, hostBox.Text, portBox.Text, useHTTPS.Checked); Guid = ProxyAdapter.GetGUID(usernameBox.Text); // Login worked, return the LoginCredentials object which will be used later DialogResult = DialogResult.OK; Hide(); } catch (Exception ex) { // Login failed, display an error dialog with the information MessageBox.Show(this, "Error logging in: " + ex.Message, "Error"); } }
If a login failure occurs, it indicates that the user name or password included in the SOAP header has been rejected by the TIBCO ActiveMatrix BPM LDAP authentication application. Although BPMTestApplication uses GetGUID to handle the users login, it is important to realize that GetGUID is not being used to authenticate the users credentials. 3. GetGUID (defined in Adapter.cs) obtains the GUID by invoking the lookupUser operation.
public string GetGUID(string resource) { EntityResolverServiceClient entityClient = _handler.GetEntityResolverClient(); lookupUser user = new lookupUser(); user.name = resource; user.getdetail = true; lookupUserResponse response = entityClient.lookupUser(user); return response.detail[0].guid; }
4. The GUID is passed back up to Main, from which it is used to obtain the users worklist.
class BPMTestApplication { public static void Main() { LoginForm loginForm = new LoginForm(); DialogResult result = loginForm.ShowDialog(); if (result == DialogResult.OK) { Adapter _adapter = loginForm.ProxyAdapter; string _guid = loginForm.Guid; WorkList workList = new WorkList(_adapter,_guid); workList.ShowDialog(); } } }
28
| Chapter 2
Implementation
The Adapter class (in Adapter.cs) implements the following methods to call specific BPM service operations. Method CancelWorkItem CloseWorkItem GetWorkList OpenItem SubmitWorkItem GetGUID Description Cancels a work item Closes a work item Gets the worklist of a user identified by their GUID Allocates and opens a selected work item Completes a work item Gets the GUID for the username specified in the LoginForm dialog. (See Obtaining the Calling Users GUID for more information about this method.) Invokes... cancelWorkItem operation from the WorkPresentationService closeWorkItem operation from the WorkPresentationService getWorkListItems operation from the WorkListService openWorkItem operation from the WorkPresentationService completeWorkItem operation from the WorkPresentationService lookupUser operation from the EntityResolverService.
Each method uses a similar structure to provide its interface. For example, the GetWorkList method: 1. Creates an object from the class that represents the operation to be invoked - in this case, getWorkListItems.
public WorkItem1[] GetWorkList(string guid) { getWorkListItems getItems = new getWorkListItems();
2. Populates the object with appropriate parameter values for the request message. In this case, the required values have been determined by referencing the getWorkListItemsRequest element.
getItems.Item = new XmlModelEntityId(); getItems.getTotalCount = true; getItems.numberOfItems = 100; getItems.startPosition = 0; getItems.Item.entitytype = OrganisationalEntityType.RESOURCE; getItems.Item.guid = guid; getItems.Item.modelversion = -1;
3. Invokes the appropriate WCF client, calls the operation and stores the response - which in this case will be a getWorkListItemsResponse object.
WorkListServiceClient wlSvcClient = _handler.GetWorkListServiceClient(); getWorkListItemsResponse response = wlSvcClient.getWorkListItems(getItems);
30
| Chapter 2
The Adapter class also includes the GetBOMJSP, GetFormURL and GetJSURL methods. See Rendering a Form for a Work Item for more information about the use of these methods.
Implementation
The application layer is provided by the BPMTestApplication project. This project provides the following functionality: File BPMTestApplication.cs Description Creates and manages the BPMTestApplication object. This contains the program entry point method, Main, which manages the users login and displays their work list. Creates and manages the LoginForm object, which provides the LoginForm dialog. Creates and manages the WorkList object, which controls the users interaction with the work list. Creates and manages the ViewWorkItem object, which controls the users interaction with a specific work item. Manages the users interaction with the form that is displayed when a user opens a specific work item. See Rendering a Form for a Work Item for more information.
32
| Chapter 2
The ShowWorkList method (defined in ViewWorkList.cs) illustrates how adapter functions are used to insulate the application layer from the implementation details of the BPM services.
private void ShowWorkList() { workListTable.Enabled = false; workListTable.ForeColor = Color.Gray; try { WorkItem1[] items = _adapter.GetWorkList(_guid); _items = items; DataSet dsForDGV = new DataSet(); BindingSource bs = new BindingSource(); DataTable dataTable1 = ConvertWorkItemsToDataTable(items); dsForDGV.Tables.Add(dataTable1); bs.DataSource = dsForDGV; bs.DataMember = dsForDGV.Tables[0].TableName; workListTable.DataSource = bs; workListTable.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill; } catch (Exception ex) { MessageBox.Show(this,"Error getting work list: "+ex.Message,"Error"); } workListTable.Enabled = true; workListTable.ForeColor = Color.Black; }
ShowWorkList is called by the Main method when a user has successfully logged in. ShowWorkList retrieves the contents of the users work list by calling the Adapter.GetWorkList method (which in turn calls the getWorkListItems operation provided by the WorkListService). The response, stored in items, is a getWorkListItemsResponse object, which contains full details of all the work items in the work list. ShowWorkList presents the data using a .NET dataTable. The ConvertWorkItemsToDataTable method is used to filter and convert the data
returned in the getWorkListItemsResponse object into a dataTable object containing just the data to be displayed in the work list.
private DataTable ConvertWorkItemsToDataTable(WorkItem1[] items) { dataTable dataTable1 = new DataTable("MyTable"); dataTable1.Columns.Add(new DataColumn("Work Item ID")); dataTable1.Columns.Add(new DataColumn("State")); dataTable1.Columns.Add(new DataColumn("Name")); dataTable1.Columns.Add(new DataColumn("Description")); dataTable1.Columns.Add(new DataColumn("Process Template")); dataTable1.Columns.Add(new DataColumn("Work Item Priority")); dataTable1.Columns.Add(new DataColumn("Attribute 2")); int i = 0; foreach (WorkItem1 item in items) { dataTable1.Rows.Add(item.id); dataTable1.Rows[i][0] = item.id.id; dataTable1.Rows[i][1] = item.state; dataTable1.Rows[i][2] = item.header.name; dataTable1.Rows[i][3] = item.header.description; dataTable1.Rows[i][4] = item.header.itemContext.appName; dataTable1.Rows[i][5] = item.header.priority; if ((item.attributes != null) && (item.attributes.attribute2 != null)) { dataTable1.Rows[i][6] = item.attributes.attribute2; } else { dataTable1.Rows[i][6] = ""; } i++; } return dataTable1; }
34
| Chapter 2
The Forms Runtime Adapter is a JavaScript API provided as part of the BPM runtime. To display a TIBCO form, a client application must load and use the Forms Runtime Adapter in the browser control containing the form. See the TIBCO Business Studio Forms Users Guide for detailed information about the Forms Runtime Adapter.
Implementation
BPMTestApplication displays work item data as a TIBCO form. The ViewWorkItem method (defined in ViewWorkList.cs): 1. creates a web browser control to hold the form. 2. calls Adapter.OpenItem to open the work item and fetch its associated data. 3. calls ShowItem (which works with FormRedirect.htm) to render the form and display it to the user.
public ViewWorkItem(Adapter adapter, string guid, WorkItem1 workItem) { InitializeComponent(); webBrowser1.AllowWebBrowserDrop = false; //webBrowser1.IsWebBrowserContextMenuEnabled = false; webBrowser1.WebBrowserShortcutsEnabled = false; webBrowser1.ObjectForScripting = this; this.StartPosition = FormStartPosition.CenterParent; _adapter = adapter; _guid = guid; _workItem = workItem; try { _item = _adapter.OpenItem(_guid, workItem); ShowItem(); } catch (Exception ex) { MessageBox.Show("ERROR: Failed to open item: " + ex.Message); throw ex; } } public void ShowItem() { Text = "Viewing item: " + _item.presentation.activityName; HtmlDocument doc = webBrowser1.Document; string pathToHTML = Environment.CurrentDirectory + "/FormRedirect.htm"; StreamReader streamReader = new StreamReader(pathToHTML); string htmlText = streamReader.ReadToEnd(); streamReader.Close(); htmlText = htmlText.Replace("%%SCRIPT_LOCATION%%", _adapter.GetJSURL()); // Now create a temporary file for the HTML page with the correct host location string tempFile = Path.GetTempFileName(); FileStream File_Stream = new FileStream(tempFile, FileMode.Create, FileAccess.Write); StreamWriter FileWriter = new StreamWriter(File_Stream); try { FileWriter.BaseStream.Seek(0, SeekOrigin.End); FileWriter.Write(htmlText); } finally { FileWriter.Close(); } webBrowser1.Url = new Uri(tempFile); }
36
| Chapter 2
FormRedirect
FormRedirect.htm performs the following tasks: 1. Loading the Forms Runtime Adapter 2. Creating the onTIBCOFormRunnerLoad Function Loading the Forms Runtime Adapter The SCRIPT_LOCATION tag is used to define the runtime address of the Forms Runtime Adapter.
<html> <head> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <!-- The following line uses a tag which will be substituted out for the real location of the Forms Runtime Adapter script file once we know which host we are connecting to --> <script type="text/javascript" language="javascript" src="%%SCRIPT_LOCATION%%"></script> <script type="text/javascript">
The following line in the ViewWorkItem.ShowItem method is used to replace the SCRIPT_LOCATION tag and load the Forms Runtime Adapter into the form object.
htmlText = htmlText.Replace("%%SCRIPT_LOCATION%%", _adapter.GetJSURL());
This method builds the runtime address of the Forms Runtime Adapter: GetBaseURL (from ServiceClientFactory.cs) is used to obtain the endpoint URL of the BPM runtime - for example, http://10.100.87.112:8080/. bpmresources is the name of the BPM runtime component that provides access to the Forms Runtime Adapter. formsclient/formsclient.nocache.js is the location of the Forms Runtime Adapter.
Creating the onTIBCOFormRunnerLoad Function FormRedirect.htm must contain a function called onTIBCOFormRunnerLoad. The Forms Runtime Adapter automatically searches for and runs this function as soon as it has loaded. The function must be called onTIBCOFormRunnerLoad. if you use a different name the form will not load.
Setting the Form URL The formURL variable holds the URL containing the JSON representation of the form, in the format required by the Forms Runtime Adapter loadForm method.
var formURL = window.external.GetFormURL();
38
| Chapter 2
This method builds the form URL: GetBaseURL (from ServiceClientFactory.cs) is used to obtain the endpoint URL of the BPM runtime - for example, http://10.100.87.112:8080/. bpmresources is the name of the BPM runtime component that provides access to the form resources of deployed BPM applications. response.presentation.formIdenitifier is the formIdentifier of the form used by this work item, obtained from the previous OpenItem call - for example, 1.0.0.201107291435/openspaceGWTPull_DefaultChannel/FindAddress/Get Address/Getuserdetails/Getuserdetails.gwt.json.
Obtaining the Initial Data to Populate the Form The initData variable holds the JSON data stream that will be used to populate the form when it is rendered.
var initData = window.external.GetInitData();
_item.payloadModel.Item is the payloadModel containing the JSON data stream for the work item, obtained from the previous OpenItem call.
Setting the BOM JavaScript path The bomJSPath variable holds the root folder path used for loading the BOM JavaScript files used by the form, in the format required by the Forms Runtime Adapter loadForm method.
var bomJSPath = window.external.GetBOMJSPath();
This method builds the URL as follows: GetBaseURL (from ServiceClientFactory.cs) is used to obtain the endpoint URL of the BPM runtime - for example, http://10.100.87.112:8080/. bpmresources is the name of the BPM runtime component that provides access to the form resources of deployed BPM applications. formURL is the formIdentifier of the form used by this work item, obtained from the previous OpenItem call. formURL.Substring(0, formURL.IndexOf('/')) extracts the initial part of this string (the version number of the form resources), which identifies the root folder path used for loading the BOM JavaScript files used by the form - for example, 1.0.0.201107291435.
40
| Chapter 2
Creating Action Handlers for User Actions The form provides Submit, Close and Cancel actions (displayed to the user as buttons). Handlers for these actions are added using the Runtime Forms Adapter setActionHandler method. The handlers are added once the form is successfully initialized, via the formLoadSuccessCallback function
var cancelHandler = function (actionName, form) { try { window.external.CancelForm(); form.destroy(); } catch (err) { alert("Error cancelling form: " + err.Description); } }; var closeHandler = function (actionName, form) { try { var data = form.getSerializedParameters(); window.external.CloseForm(data); } catch (err) { alert("Error closing form: " + err.Description); } } var submitHandler = function (actionName, form) { try { var data = form.getSerializedParameters(); window.external.SubmitForm(data); } catch (err) { alert("Error submitting form: " + err.Description); } } var formLoadSuccessCallback = function (form) { form.setActionHandler(form.ACTION_CANCEL, cancelHandler); form.setActionHandler(form.ACTION_CLOSE, closeHandler); form.setActionHandler(form.ACTION_SUBMIT, submitHandler); }; var formLoadErrorCallback = function (error) { alert('Form load failed with error: ' + error); };
When the user performs an action by clicking a button, the handler calls an appropriate method to process the action. For a Close or Submit action, data is passed back.
which in turn calls the Adapter.SubmitWorkItem method. This method completes the work item, by building the request data for and then invoking a completeWorkItem operation from the WorkPresentationService.
public void SubmitWorkItem(WorkItem1 item, string workTypeUid, string workTypeVersion, string guid, string data) { WorkPresentationServiceClient wpSvcClient = _handler.GetWorkPresentationServiceClient(); WorkRequest workRequest = new WorkRequest(); WorkRequest.responsePayloadMode = payloadModeType.JSON; workRequest.payloadDetails = new dataPayload(); workRequest.payloadDetails.payloadMode = payloadModeType.JSON; workRequest.payloadDetails.Item = data; workRequest.channelId = "openspaceGWTPull_DefaultChannel"; workRequest.channelType = ChannelType.openspaceChannel; workRequest.workItem = new WorkItem(); workRequest.workItem.id = item.id.id; workRequest.workItem.version = -1; workRequest.workTypeDetail = new BaseWorkRequestWorkTypeDetail(); workRequest.workTypeDetail.uid = workTypeUid; workRequest.workTypeDetail.version = workTypeVersion; workRequest.workTypeDetail.openNextPiled = false; workResponse response = wpSvcClient.completeWorkItem(workRequest); }
42
| Chapter 2
Rendering the Form The Forms Runtime Adapter loadForm method is used to render the form for the user.
com.tibco.forms.client.FormRunner.loadForm(formURL, initData, bomJSPath, null, "formContainer", formLoadSuccessCallback, formLoadErrorCallback, useJSONP); } </script> <title>Form</title> </head> <body> <div id="formContainer"></div> </body> </html>
| 43
Chapter 3
This chapter outlines the basic steps involved in using the Java Service Connector API to develop a custom client application. It also describes an example client application that is supplied with this guide to illustrate these steps.
Topics
Overview of the Java Service Connector, page 44 The Sample Client Application, page 46 Instantiating and Configuring the Service Connector, page 50 Setting up the Security Handler, page 54 Authenticating the Calling User, page 55 Executing the Service Connector API Calls, page 58 Implementing the Client User Interface, page 59 Rendering a Form for a Work Item, page 62
44
| Chapter 3
the servlet containers library folder. To avoid any conflicts, you must delete the servlet-api-2.5.jar from the location where you unzipped the Service Connector archive file. 3. Edit the CLASSPATH to ensure that all the binary contents of the archive file are in the CLASSPATH. For example, add all the files available in C:\temp\serviceConnectorto the CLASSPATH.
46
| Chapter 3
It allows you to open, complete (submit), cancel, or close the work items from the work list using standard TIBCO forms.
System Requirements
To be able to examine and run the SampleApp you must have the following software installed: A Java IDE such as Eclipse if you want to develop a client application. Apache Ant to build SampleApp and generate the deployable artifact. A servlet container such as Apache Tomcat (Version 6.0 or above) to deploy the client application. A browser such as Internet Explorer, Google Chrome, or Mozilla Firefox to run the sample client application.
48
| Chapter 3
3. To view the source files and enhance the sample provided, open SampleApp in Eclipse or a suitable IDE. The solution project contains: Source files containing the classes and methods to develop the basic client application. JSP files which provide the client user interface. Other resources such as CSS files, images, etc. Libraries required to build and run the client application. SampleApp.zip does not include the Service Connector libraries. You must copy the libraries into the CLASSPATH of the sample application. For example, copy the libraries to WEB-INF\lib. Also, ensure that the Build Path is configured properly before running the sample application. 4. To run SampleApp, perform the following tasks: a. Edit the C:\temp\SampleApp\config.properties file to specify the location where all the binary files of the service connector are available. For example: service-connector-dir=C:\\temp\\service-connector See Enabling the Java Service Connector for Your Development Environment for details on how to obtain the service connector binaries. b. Open a console window and navigate to C:\temp\SampleApp. This folder contains the build.xml file. Execute the following command:
ant clean war
Upon successful completion, the script will have performed the following: copies the service connector binaries to the SampleApp WEB-INF folder (C:\temp\SampleApp\WebContent\WEB-INF\lib). builds the sampleapp.war file at C:\temp\SampleApp\build\dist which can be used to deploy the sample application to any web server. c. Copy the sampleapp.war file to the webapps folder of the servlet container. For example, C:\Program Files
(x86)\apache-tomcat-6.0.32\webapps.
d. Start the servlet container (or restart if it is already running). e. Open a browser window and navigate to http://localhost:9090/sampleapp to open the login form.
Architecture
The following diagram illustrates the architecture of the Java Service Connector example client.
action=<userAction>
Browser Login.jsp
UserName Password Server IP Port Is Secure
act
ion
= l
n ogi
Controller Servlets
Service Connector
BPM Services
Login
Display
J SP
JSP Files
The client user interface is designed using JSP files. These files are used for presentation and help communicate the user inputs to the Service Connector through the controller servlet and vice versa. The controller servlet handles the application flow. It also passes on the action performed by the user and any data supplied to the appropriate Service Connector API. The Service Connector converts the data object and security information into an appropriate SOAP request message and calls the corresponding BPM service. It also converts the SOAP response back into the corresponding data object before handing it over to the controller servlet. The controller servlet returns the appropriate JSP page to the user along with the data returned in the response. JSP renders the data returned by the controller servlet. TIBCO Forms are used to display any work related data such as work items, pageflows, and business services.
50
| Chapter 3
/* * ===================================================== * METHOD : setServiceConnector * ===================================================== */ /** * Reads the protocol, host, and port values from the request and * initializes the ServiceConnector. * * @param req * @throws ServletException */ private void setServiceConnector(HttpServletRequest req) throws ServletException { // Read the protocol, host, and port values from the request. Configuration.Protocol protocol = req.getParameter("secure") == null ? Configuration.Protocol.HTTP : Configuration.Protocol.HTTPS; req.getSession().setAttribute("protocol", protocol.toString().toLowerCase()); String host = req.getParameter("host") == null ? "localhost" : req.getParameter("host"); req.getSession().setAttribute("host", host); int port = req.getParameter("port") == null ? 8080 : Integer.parseInt(req.getParameter("port")); req.getSession().setAttribute("port", port); initializeServiceConnector(req, protocol, host, port); }
52
| Chapter 3
The method initializeServiceConnector creates an instance of the Service Connector serviceConnector using the ServiceConnectorFactory. The Service Connector Factory provides a factory interface to get the reference of the service connector instance associated with a particular BPM server. This enables the same client application to communicate with multiple BPM servers which can be hosted in different locations. The serviceConnector instance created for the user is cached within the HTTP session associated with the logged in user.
private static final String SERVICECONNECTOR = "serviceConnector"; ... /* * ===================================================== * METHOD : initializeServiceConnector * ===================================================== */ /** * Creates the ServiceConnector instance. This example shows several ways to create the ServiceConnector. * Use of the ServiceConnectorFactory is recommended since it creates a single instance for a given * protocol, host, and port. * * @param protocol The protocol value. * @param host The host value. * @param port The port value. * @throws ServletException * @see ServiceConnector, ServiceConnectorFactory */ private void initializeServiceConnector(HttpServletRequest req, Configuration.Protocol protocol, String host, int port) throws ServletException { // Create a security handler for the logged in user. SecurityHandler securityHandler = new DefaultSecurityHandler(getUserName(req), getPassword(req)); ServiceConnector serviceConnector; // Example of passing the protocol, host, port, and securityHandler into the constructor. serviceConnector = ServiceConnectorFactory.getServiceConnector(protocol, host, port, securityHandler); // The ServiceConnector constructors can be used directly but use of the ServiceConnectorFactory is recommended. //serviceConnector = new ServiceConnector(protocol, host, port, securityHandler); req.getSession().setAttribute(SERVICECONNECTOR, serviceConnector); }
The Service Connector constructors can be used directly. However, the use of the Service Connector Factory is recommended. The method getServiceConnector is used to return the serviceConnector instance stored in the session.
/* * ===================================================== * METHOD : getServiceConnector * ===================================================== */ /** * Returns the ServiceConnector instance stored in the session. * * @param req * @return The ServiceConnector instance stored in the session. * @throws ServletException */ private ServiceConnector getServiceConnector(HttpServletRequest req) throws ServletException { ServiceConnector serviceConnector = (ServiceConnector) req.getSession().getAttribute(SERVICECONNECTOR); if (serviceConnector == null) { throw new ServletException("ServiceConnector is missing. A valid login is required."); } return serviceConnector; }
You can also configure the protocol, host, and port number properties after creating the service connector by passing properties to the configuration instance,.
// Example of passing configuration instance in. //Properties properties = new Properties(); // properties.setProperty(Configuration.Property.AMX_BPM_INSTANCE_P ROTOCOL.getValue(), protocol.toString()); // properties.setProperty(Configuration.Property.AMX_BPM_INSTANCE_H OST.getValue(), host); // properties.setProperty(Configuration.Property.AMX_BPM_INSTANCE_P ORT.getValue(), String.valueOf(port)); //Configuration configuration = new Configuration(properties); ////serviceConnector = new ServiceConnector(configuration, securityHandler); //serviceConnector = ServiceConnectorFactory.getServiceConnector(configuration, securityHandler);
54
| Chapter 3
A TIBCO ActiveMatrix BPM LDAP authentication application (for example, amx.bpm.auth.easyAs) uses this token to authenticate the calling user. If the token does not identify a known TIBCO ActiveMatrix BPM user, the call is rejected. See Authenticating Access to a TIBCO ActiveMatrix BPM Service for more information about direct and SSO authentication methods and how to use them in different situations. Implementation SampleApp uses UsernameToken to authenticate the calling user. The sample application allows a user to provide the username and password through the USERNAME and PASSWORD fields in login.jsp.
private String getUserName(HttpServletRequest req) throws ServletException { /**return the user name passed in the request*/ String username = req.getParameter("userName"); if (null == username) throw new ServletException("User Name cannot be null"); return username; } private String getPassword(HttpServletRequest req) throws ServletException { /**return the password passed in the request*/ String password = req.getParameter("pass"); if (null == password) throw new ServletException("Password cannot be null"); return password; }
56
| Chapter 3
Every BPM runtime user is identified by a Global Unique IDentifier (GUID). This GUID is needed to identify the user when calling various API methods - for example, to display a work list. The method authenticate in the SampleApp authenticates the username specified using the BPM service API lookupUser. The method lookupUser looks up the username and returns the corresponding GUID. This information is then saved for that particular session.
/* * ===================================================== * METHOD : authenticate * ===================================================== */ /** * Authenticates the user login and retrieves the user guid. * * @param req * @param resp * @throws ServletException */ private void authenticate(HttpServletRequest req, HttpServletResponse resp) throws ServletException { try { String username = getUserName(req); String guid = null; LookupUserResponse lookupUserResponse = getServiceConnector(req).getEntityResolverService().lookupUser( getUserName(req), null, null, true); if (lookupUserResponse.getDetailArray().length > 0) { guid = lookupUserResponse.getDetailArray(0).getGuid(); } else { throw new ServletException("Unable to lookup user guid."); } lookupUserResponse.getDetailArray(0).getGuid(); LoginInfo loginInfo = new LoginInfo(username, guid); /**store the user info in the session*/ req.getSession().setAttribute(USER_INFO, loginInfo); displayWorklist(req, resp); } catch (InternalServiceFault e) { throw new ServletException(e); } catch (InvalidServiceRequestFault e) { throw new ServletException(e); } catch (com.tibco.n2.de.services.SecurityFault e) { throw new ServletException(e); } }
58
| Chapter 3
Schema validation When executing the Service Connector API calls, you must ensure that the inputs conform to the schema. This is necessary as schema validation for the inputs is not available in the Service Connector. For example, ensure that you provide values for all the mandatory fields.
Implementation
The application layer is provided by the SampleApp project. This project contains the following: File WorkProcessingServlet.java Description Creates and manages the SampleApp. The class WorkProcessingServlet contains all the methods required to handle the flow of the sample application. It orchestrates the JSP pages that are displayed and calls the appropriate Service Connector method based on the users actions and data supplied by the user. login.jsp Creates and manages the Login form, which provides the Login dialog. The Login form provides the entry point to the sample application. Creates and manages the users interaction with work lists. Creates and manages the users interaction with a specific work item. The process method in WorkProcessingServlet.java is called whenever the user performs an action. Based on the action performed, it calls the method to be executed next.
worklist.jsp openworkitem.jsp
60
| Chapter 3
For example, when a user submits the login information, the following information is sent to the servlet by login.jsp:
<form action=""> <label for="username">Username:</label> <input type="text" name="userName" class="text" id="username"> <br /> <label for="password">Password:</label> <input type="password" name="pass" class="text" id="password"> <br /> <serverLabel for="protocol">Server:</label> <input type="checkbox" name="secure" value="secure" checked="checked">Secure (https)</input> <!-- <serverLabel for="protocol">Protocol:</serverLabel> <input type="radio" name="protocol" value="HTTP" checked="checked">HTTP</input> <input type="radio" name="protocol" value="HTTPS">HTTPS</input> --> <br /><br /> <serverLabel for="host">Host:</serverLabel> <input class="serverInput" type="text" name="host" class="text" id="host" value="localhost"> <br /><br /> <serverLabel for="port">Port:</serverLabel> <input class="serverInput" type="text" name="port" class="text" id="port" value="8080"> <br /><br /> <input type="submit" onclick="submitData('login');" class="submit" name="submit" value="Submit"> </form> </div> </body> </html>
The process method in WorkProcessingServlet.java identifies the action as login and hence executes the following:
public void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {if (getAction(req).equals(Actions.LOGIN)) { setServiceConnector(req); authenticate(req, resp); } ... orchestratePages(req, resp); }
Once the user is authenticated, it calls the orchestratePages method which displays pages according to the action invoked by the user. For example, after the action LOGIN is completed, worklist.jsp is displayed to the user. worklist.jsp displays the list of worklist items available for the logged in user in a tabular form.
private void orchestratePages(HttpServletRequest req, HttpServletResponse resp) throws ServletException,IOException { if (getAction(req).equals(Actions.LOGIN)) { getServletContext().getRequestDispatcher("/worklist.jsp").forward(req, resp); } ... }
62
| Chapter 3
The Forms Runtime Adapter is a JavaScript API provided as part of the BPM runtime. To display a TIBCO form, a client application must load and use the Forms Runtime Adapter in the browser control containing the form. See the TIBCO Business Studio Forms Users Guide for detailed information about the Forms Runtime Adapter.
Implementation
SampleApp displays work item data as a TIBCO form.
The login.jsp creates the HTML page containing the Login form. This form provides the entry point to the sample application. The form action submitted by the user is passed to the WorkProcessingServlet.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> ... <SCRIPT LANGUAGE="JavaScript"> function submitData(action){ document.forms[0].action="workprocessor?action="+action; document.forms[0].method="post"; document.forms[0].submit(); } </SCRIPT> </head> ... <form action=""> <label for="username">Username:</label> <input type="text" name="userName" class="text" id="username"> <br /> <label for="password">Password:</label> <input type="password" name="pass" class="text" id="password"> <br /> <serverLabel for="protocol">Server:</label> <input type="checkbox" name="secure" value="secure" checked="checked">Secure (https)</input> <!-- <serverLabel for="protocol">Protocol:</serverLabel> <input type="radio" name="protocol" value="HTTP" checked="checked">HTTP</input> <input type="radio" name="protocol" value="HTTPS">HTTPS</input> --> <br /><br /> <serverLabel for="host">Host:</serverLabel> <input class="serverInput" type="text" name="host" class="text" id="host" value="localhost"> <br /><br /> <serverLabel for="port">Port:</serverLabel> <input class="serverInput" type="text" name="port" class="text" id="port" value="8080"> <br /><br /> <input type="submit" onclick="submitData('login');" class="submit" name="submit" value="Submit"> </form> </div> </body> </html>
64
| Chapter 3
The process method in WorkProcessingServlet.java handles all the requests and calls the appropriate method. The WorkProcessingServlet.java contains all the methods and control is passed over to the appropriate method. For example, when a user submits the username and password on the login page, the request is handled by the method process and the methods setServiceConnector, setServiceConnector and authenticate are called. Once completed, the method orchestratePages is called.
/* * ===================================================== * METHOD : process * ===================================================== */ /** * Selects the method called based on the request action. * * @param req * @param resp * @throws ServletException * @throws IOException */ public void process(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (getAction(req).equals(Actions.LOGIN)) { setServiceConnector(req); authenticate(req, resp); } else if (getAction(req).equals(Actions.OPEN_WORKITEM)) { openworkItem(req, resp); } ... else if (getAction(req).equals(Actions.SHOW_WORKLIST)) { displayWorklist(req, resp); } ... orchestratePages(req, resp); }
The method orchestratePages checks for the action that has been processed and displays an appropriate JSP file to the user.
/* * ===================================================== * METHOD : orchestratePages * ===================================================== */ /** * Orchestrates JSP page flow for the application. * * @param req * @param resp * @throws ServletException * @throws IOException */ private void orchestratePages(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (getAction(req).equals(Actions.LOGIN)) { getServletContext().getRequestDispatcher("/worklist.jsp").forward(req, resp); } else if (getAction(req).equals(Actions.OPEN_WORKITEM)) { getServletContext().getRequestDispatcher("/openworkitem.jsp").forward(req, resp); } else if (getAction(req).equals(Actions.CLOSE_WORKITEM)) { displayWorklist(req, resp); getServletContext().getRequestDispatcher("/worklist.jsp").forward(req, resp); } else if (getAction(req).equals(Actions.COMPLETE_WORKITEM)) { displayWorklist(req, resp); getServletContext().getRequestDispatcher("/worklist.jsp").forward(req, resp); } else if (getAction(req).equals(Actions.SHOW_WORKLIST)) { getServletContext().getRequestDispatcher("/worklist.jsp").forward(req, resp); } ... else if (getAction(req).equals(Actions.LOGOUT)) { getServletContext().getRequestDispatcher("/login.jsp").forward(req, resp); } }
66
| Chapter 3
The details about the BPM runtime is obtained from the session and the string /bpmresources/formsclient/formsclient.nocache.js is the location of the Forms Runtime Adapter. Creating the onTIBCOFormRunnerLoad Function openworkitem.jsp must contain a function called onTIBCOFormRunnerLoad. The Forms Runtime Adapter automatically searches for and runs this function as soon as it has loaded. The function must be called onTIBCOFormRunnerLoad. if you use a different name the form will not load.
function onTIBCOFormRunnerLoad(){ loadForm(); }
All the Forms resources are served from the context bpmresources on the BPM runtime. Obtain the Initial Data to Load the Form The initData variable holds the data that will be used to populate the form when it is loaded.
var initData = '<%=workItem.getPayloadModel().getSerializedPayload()%>';
This data is obtained from the work item object returned by the previous openWorkItem call (in worklist.jsp).
68
| Chapter 3
Set the BOM JavaScript Path The bomJSPath variable holds the root folder path used for loading the BOM JavaScript files used by the form, in the format required by the Forms Runtime Adapter loadForm method.
var bomJSPath = "<%=bpmJSPath%>";
Create Action Handlers for User Actions The form provides Submit, Close, and Cancel actions which are displayed to the user as buttons. Handlers for these actions are added using the Runtime Forms Adapter setActionHandler method. The handlers are added once the form is successfully initialized, via the formLoadSuccessCallback function.
var cancelHandler = function(actionName, form) { var jsonPayload = "nodata"; // document.getElementById('jsonpayload').value = jsonPayload; submitData("cancelworkitem", jsonPayload); form.destroy(); }; var closeHandler = function(actionName, form) { var jsonPayload = form.getSerializedParameters(); document.getElementById('jsonpayload').value = jsonPayload; submitData("closeworkitem", jsonPayload); form.destroy(); }; var submitHandler = function(actionName, form) { var jsonPayload = form.getSerializedParameters(); document.getElementById('jsonpayload').value = jsonPayload; submitData("completeworkitem",jsonPayload); form.destroy(); }; var formLoadSuccessCallback = function(form) { form.setActionHandler(form.ACTION_CANCEL, cancelHandler); form.setActionHandler(form.ACTION_CLOSE, closeHandler); form.setActionHandler(form.ACTION_SUBMIT, submitHandler); }; var formLoadErrorCallback = function(error) { alert('Form load failed with error: ' + error); };
When the user performs an action by clicking a button, the handler calls an appropriate method to process the action.
70
| Chapter 3
Render the Form The Forms Runtime Adapter loadForm method is used to render the form for the user.
if (initData.charAt(0) == '{') com.tibco.forms.client.FormRunner.loadForm(formURL, initData,bomJSPath, null, "formContainer", formLoadSuccessCallback,formLoadErrorCallback, true); else com.tibco.forms.client.FormRunner.loadFormWithRemoteData(formURL,initData, bomJSPath, null,"formContainer", formLoadSuccessCallback,formLoadErrorCallback, true); } </script> <div id="formContainer" width="100%"></div> <form name="workitemform" id="workitemform" method="post"><input type="hidden" id="jsonpayload" value="" /></form> </body> </html>
| 71
Chapter 4
This chapter describes the different methods you can use to include authentication information when invoking a TIBCO ActiveMatrix BPM service.
Topics
Introduction, page 72 Direct Authentication, page 73 Single Sign-on (SSO) Authentication, page 74 Using TIBCO ActiveMatrix BPM as the Authority for SSO Authentication, page 82
72
| Chapter 4
Introduction
At runtime, security policies are enforced on the endpoint of every TIBCO ActiveMatrix BPM service to ensure that access is restricted to authenticated users. Every API call to a TIBCO ActiveMatrix BPM service must be made using the identity of a user who is registered in the BPM organization model. An API call that does not meet this requirement will be rejected. Web service security (WS-security) protocols are used to enforce authentication requirements. Every API call to a BPM service must include an appropriate token in the SOAP header that can be used to authenticate the calling user. The token must comply with one of the following WS-Security token validation protocols: Web Services Security UsernameToken Profile 1.0. This profile provides direct authentication - see Direct Authentication on page 73. Web Services Security X.509 Certificate Token Profile, or Web Services Security: SAML Token Profile (using the "sender-vouches" subject confirmation method). These profiles enable the use of single sign-on authentication - see Single Sign-on (SSO) Authentication on page 74.
Direct and single sign-on authentication, described in the following sections, are the basic methods required to authenticate access to a BPM service. Additional security mechanisms or techniques can be used to enhance the security of any call to a BPM service according to specific business requirements for example, the use of SSL or message-level encryption. These mechanisms and techniques are, however, not specifically needed to access BPM services, and so are not discussed further here. See the TIBCO ActiveMatrix runtime documentation for more information about security mechanisms and techniques used by the TIBCO ActiveMatrix runtime.
Direct Authentication 73
Direct Authentication
Direct authentication requires the calling application to provide valid TIBCO ActiveMatrix BPM login credentials when calling a TIBCO ActiveMatrix BPM service: 1. An API call to a BPM service must include a UsernameToken in the SOAP header, which specifies the username and password of the user on whose behalf the call is being made. 2. A TIBCO ActiveMatrix BPM LDAP authentication application (for example, amx.bpm.auth.easyAs) validates: the supplied username against the BPM organization model. the supplied password against the LDAP entity represented by that BPM user. Use of HTTPS is not mandatory when using direct authentication with a UsernameToken. However, if HTTPS is not used, every service invocation will include an unencrypted user name and password within the SOAP header. It is therefore essential for a secure system to use HTTPS. Direct authentication is the default method used by TIBCO ActiveMatrix BPM (and the only method supported by Workspace and Openspace). The sample client applications provided with this guide provide examples of how to implement direct authentication using a UsernameToken. If you are accessing BPM services using: the BPM public web service API, see Authenticating the Calling User. the Service Connector, see Setting up the Security Handler.
74
| Chapter 4
2. validates that the supplied DN is associated with a registered user in the BPM organization model. This confirms that the subject of the message is a registered BPM user. No LDAP lookup or password checking is performed. The users credentials are assumed to have been validated already because the message has been received from a trusted source.
76
| Chapter 4
Establishing a Trust Relationship Between TIBCO ActiveMatrix BPM and the Client Application
TIBCO ActiveMatrix BPM must have runtime access to the corresponding public certificate of the private certificate that the client application used to sign the incoming message. To set up this trust relationship, obtain the relevant public certificate, then: 1. Add the public certificate to the appropriate TIBCO ActiveMatrix BPM trust store. 2. Configure the TIBCO ActiveMatrix BPM Web Service Security authentication application (amx.bpm.auth.wss.app) and its dependent resource templates and resources instances to use the truststore containing this certificate. See "Configuring TIBCO ActiveMatrix BPM to Use SSO to Authenticate Web Service Requests", in the BPM Administration guide, for detailed information about how to do this.
Runtime Authentication
Once the trust relationship has been established, runtime authentication is carried out using the following steps (see Figure 2): Figure 2 SSO runtime authentication
1 Login session Keystore Client application Sign message 2 Private key
3 Authenticate
1. A user logs in to the client application, which verifies their username and password against the corporate LDAP directory. 2. An API call to a BPM service on behalf of that user must include an X.509 certificate and/or SAML token, that: a. is signed using the appropriate private key. b. identifies the user as the subject of the certificate or token (either by their username or LDAP Distinguished Name). If an LDAP DN is used, the DN must match the DN of the primary LDAP source of the LDAP container from which the user was derived.
78
| Chapter 4
3. The TIBCO ActiveMatrix BPM Web Service Security authentication application (amx.bpm.auth.wss.app), on the BPM runtime: a. verifies the signature on the incoming message, using the appropriate public certificate. b. validates the user identified in the subject of the certificate/token against the BPM organization model.
Handling Time Differences Between the Client System and the BPM Runtime When Using Validity Periods in a SAML Assertion
A SAML assertion can contain conditions limiting the validity period of a request. (This provides an additional precaution against identity theft.) When a validity period is defined, if the clocks on the client system and the BPM runtime are not synchronized, you must ensure that time differences between the two systems do not cause authentication failures due to the unexpected expiry of an assertions validity period. For example, suppose a client application is attempting to invoke a service on a BPM runtime. The client application generates a SAML assertion containing the following condition:
<saml:Conditions NotBefore="2011-09-01T14:25:54.622Z" NotOnOrAfter="2011-09-01T14:35:54.622Z" />
where the NotBefore condition is set to the clock time on the client system. However, the BPM runtimes clock has not yet reached this time, and it therefore rejects the call because the assertion is invalid. The methods used to handle this depend on which API the client application is using to invoke BPM runtime services: Web Service API - The client application generates (or obtains) the SAML assertion, so can control what timestamp it puts in the NotBefore and NotOnOrAfter fields in the assertion (or indeed if it uses them at all). Java Service Connector API - The SAMLSenderVouchesSecurityHandler generates the SAML assertion. Optional parameters can be defined to define and insert a validity period. (By default, no validity period is set.) See Using the Service Connector SamlSenderVouchesSecurityHandler Method for more information.
Whichever API it uses, the client application must ensure that any validity period used in the SAML assertion will be valid when the request is authenticated by the BPM runtime.
80
| Chapter 4
where: issuer identifies the issuer of the assertion (the Issuer value in the assertion). If this value is omitted, a default value of "www.tibco.com" is used. keystoreFilePath is the pathname for the private keystore file used to sign the assertion. Note that this is not an absolute path to the keystore file on the hosts file system. It is a pathname that needs to be resolved via the classpath (the same as for regular property files). The following are two examples: keystoreFilePath = /com/tibco/sample/app/amx-bpm-wss-keystore.jk The package name is com.tibco.sample.app (the .jar containing the package is in the classpath). keystoreFilePath = /resources/keystores/admin_keystore.jks The classpath contains the current directory (.), which causes the file ./resources/keystores/admin_keystore.jks to be readable. The BPM runtime must hold the corresponding public certificate of the private certificate used to sign the SAML assertion keystorePassword is the password for the keystore file.
aliasKey is the alias for the keystore certificate used to sign the SAML assertion. aliasKeyPassword is the password of the alias for the keystore certificate used to sign the SAML assertion. ldapDistinguishedName is the LDAP Distinguished Name (DN) of the BPM user to be authenticated. This DN must match the DN of the primary LDAP source of the LDAP container from which the BPM user was derived.
applyConditions specifies whether you want to define a validity period for the assertion, using the timeStamp and validityDuration values. The default value (0) is not to define these values, generating an assertion that is permanently valid. (See Handling Time Differences Between the Client System and the BPM Runtime When Using Validity Periods in a SAML Assertion.) timeStamp is the date/time that used to define when the assertion was issued (the IssueInstant value in the assertion). If this value is omitted, the current timestamp of the client machine will be used. validityDuration is the period of time for which the assertion will remain valid, in minutes. (The timeStamp and validityDuration values are used to set the NotBefore and NotOnOrAfter values in the assertion.) If this value is omitted or set to -1, a default value of 20 minutes is used.
82
| Chapter 4
3. Using TIBCO ActiveMatrix Administrator, configure the TIBCO ActiveMatrix BPM Web Service Security authentication application (amx.bpm.auth.wss.app) and its dependent resource templates and resources instances to use this truststore. TIBCO ActiveMatrix BPM can now use this public root certificate to verify the signature of incoming messages.
84
| Chapter 4
| 85
Chapter 5
This chapter describes the web service operations and Service Connector methods that allow you to work with organization models and LDAPs.
Topics
Creating an LDAP Container, page 86 Mapping Users, page 92 Navigating the Organization Model, page 109 Listing Capabilities and Privileges, page 111 Using LDAP Filters, page 113 Defining Secondary LDAP Sources in an LDAP Container, page 115 Mapping Resource Attributes to LDAP Attributes, page 118 Organization Relationships, page 123
86
| Chapter 5
listLDAPSources
1
LDAPService
listLDAPAttributes
2
saveLDAPContainerDetail
3
1. Lightweight Directory Access Protocol, which is an application protocol for querying and modifying directory services.
TIBCO ActiveMatrix BPM - BPM Developers Guide
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Creating an LDAP ContainerService Connector API Example (Java) on page 90.) 1. Find out the LDAP sources that are registered on the Directory Engine by calling the listLDAPSources operation. One of the returned sources must be specified as the primary LDAP source when calling the saveLDAPContainerDetail operation to create the LDAP container.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ldap="http://ldapservice.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <ldap:listLDAPSources> </ldap:listLDAPSources> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPSourcesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <LdapSource ldap-alias="deLdap5" xmlns=""/> <LdapSource ldap-alias="deLdap4" xmlns=""/> <LdapSource ldap-alias="system" xmlns=""/> <LdapSource ldap-alias="deLdap6" xmlns=""/> <LdapSource ldap-alias="deLdap3" xmlns=""/> <LdapSource ldap-alias="deLdap2" xmlns=""/> <LdapSource ldap-alias="easyAs" xmlns=""/> </listLDAPSourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
88
| Chapter 5
2. Use the listLDAPAttributes operation (or listLDAPAttributeNames) to get LDAP attributes that can be used in the required LDAP search string when calling the listLDAPSources operation (see step 3).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ldap="http://ldapservice.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <ldap:listLDAPAttributes alias="easyAs" dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees"> </ldap:listLDAPAttributes> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPAttributesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <req-attributes ldap-alias="easyAs" ldap-attribute="departmentnumber" ldap-dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees" name="departmentnumber" xmlns=""> <value>FNB3</value> </req-attributes> <req-attributes ldap-alias="easyAs" ldap-attribute="employeetype" ldap-dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees" name="employeetype" xmlns=""> <value>Permanent</value> </req-attributes> <req-attributes ldap-alias="easyAs" ldap-attribute="employeenumber" ldap-dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees" name="employeenumber" xmlns=""> <value>1201</value> . . . <req-attributes ldap-alias="easyAs" ldap-attribute="objectClass" ldap-dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees" name="objectClass" xmlns=""> <value>organizationalPerson</value> <value>person</value> <value>inetOrgPerson</value> <value>top</value> </req-attributes> </listLDAPAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Use the saveLDAPContainerDetail operation to create and save a new LDAP container.
The only required parameters are: name - This is the name you want assigned to the new LDAP container. It must be unique on the Directory Engine. primary-ldap.ldap-alias - You must specify a primary LDAP source. A list of the available LDAP sources on the Directory Engine can be obtained using the listLDAPSources operation on the LDAPService web service. primary-ldap.ldap-search-string - You must specify a query string for the primary LDAP (as well as each secondary LDAP, if they are being defined also). This string is used to identify the LDAP entries that are to be considered as candidates for resources (also referred to as "potential resources". For information about valid search strings, see Using LDAP Filters on page 113. LDAP attributes and their values can be obtained from listLDAPAttributeNames and listLDAPAttributes. Additional optional parameters are also available for adding secondary LDAP sources, setting up organizational relationships, etc. For information about those parameters, see saveLDAPContainerDetail on page 432. The following shows an example saveLDAPContainerDetail request containing the minimal amount of information, as well as the new LDAP container ID that is returned if the container creation is successful:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://container.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <con:saveLDAPContainerDetail name="Spokane" > <primary-ldap ldap-alias="easyAs" display-name-attributes="cn" ldap-search-string ="(objectClass=person)" /> </con:saveLDAPContainerDetail> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <saveLDAPContainerDetailResponse container-id="51" xmlns="http://container.api.de.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
90
| Chapter 5
Creating an LDAP ContainerService Connector API Example (Java) The following example code illustrates creating an LDAP container using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration, Creating an LDAP Container on page 86.
private long createLDAPContainerExample() { long containerId = 0; try { // Step 1 : Get a list of the LDAP Sources available LdapSource[] sourceArray = serviceConnectorInstance.listLDAPSources(0); // Step 2: Use the required LDAP source ldap-alias to get a list of attributes for a particular resource // if we wanted to use the first LDAP source we could use : sourceArray[0].getLdapAlias() // in this example we use "easyAs" XmlLdapAttribute[] ldapAttributesArray = serviceConnectorInstance.listLDAPAttributes("easyAs", "ou=Clint Hill, ou=Swindon, ou=AllEmployees", null); // Step 3: // Create an XmlLdapContainer with details of the container we are creating XmlLdapContainer container = XmlLdapContainer.Factory.newInstance(); container.setName("Spokane"); // Create an XmlLdapContainerResource with details of the Primary LDAP to use for this container XmlLdapContainerResource containerResource = XmlLdapContainerResource.Factory.newInstance(); containerResource.setLdapAlias("easyAs"); containerResource.setDisplayNameAttributes("cn"); containerResource.setLdapSearchString("(objectClass=person)"); // Set the Primary LDAP in the container container.setPrimaryLdap(containerResource); // Save the container and get back the ID containerId = serviceConnectorInstance.saveLDAPContainerDetail(container); } catch (InvalidLDAPSearchFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPSourceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.de.services.InternalServiceFault e)
{ // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPContainerFault e) { // TODO Auto-generated catch block e.printStackTrace(); } return (containerId); }
92
| Chapter 5
Mapping Users
Mapping resources is an administrative task that will typically be performed before users start using the TIBCO BPM application. Mapping resources can then be performed on an ongoing basis as resources are added or removed from the system, or if the organization model is revised (new positions, groups, etc.). Mapping resources involves assigning resources to specific groups and/or positions in an organization model, which results in the resources receiving work items that are sent to the groups/positions to which the resources have been mapped. Resources can be mapped to: A group, which represents a job type within the organization. It allows resources to be grouped by their job characteristics. Groups can be hierarchical, i.e., you can have parent groups with sub groups. For example, you can have a CustomerServiceRepresentative group with subgroups of MotorInsuranceSpecialist, TravelInsuranceSpecialist, and HomeInsuranceSpecialist. Typically, sub-groups are specializations of the parent group. Groups can be nested several layers deep. If a group has sub-groups, you can assign resources to either the parent group or the sub-group. Resources that belong to sub-groups receive work items that are offered to their parent groups, as well as to the sub-group to which they belong. Using the example above, resources in the MotorInsuranceSpecialist group will also receive work items offered to the CustomerServiceRepresentative group. A position, which represents a set of responsibilities for a job within an organization unit. It allows resources to be grouped by job responsibility. Positions are subordinate to an organization unit in the organization model. An organization unit can have many positions. For example, you can have a TravelInsurance organization unit with positions of OfficeManagerTravel and TravelInsuranceCSR. Positions cannot be nested, although organization units can. Resources can be mapped to positions, but not organization units. Resources that belong to a position receive work items offered to the position, as well as work items offered to the organization unit that is the immediate parent of the position.
Mapping Users 93
Creating Resources
Before resources can log into a BPM application, they must be created1. There are two operations available that you can use to create a resource: getResourceGuid - This operation creates a resource (including assigning a GUID to the resource), but does not map the resource to a group or position. It allows the resource to log into a BPM application, although the resource will typically not receive work items until being mapped to a group or position. (This operation will also return an existing resources name if a resource GUID is passed in, but thats not its primary purpose.) mapEntities - This operation both creates a resource (if it doesnt already exist) and maps the resource to the specified groups and positions. When mapping resources to groups or positions with this operation: If the resource already exists, you can pass in the resources GUID. The GUID can be obtained from the listContainerResources operation (which only returns information about existing resources). If the resource does not exist yet, you can pass in an LdapReference from which the resource can be derived. The LdapReference can be obtained from the listLDAPEntities operation (which can return information from existing resources, as well as potential resourcesthose that have not been created yet). Two examples are shown below for mapping resourcesthey both use mapEntities, but one maps existing resources using the resources GUID; the other maps new resources by passing the LdapReference: 1. Example 1Mapping an Existing Resource Using a GUID illustrates mapping resources that already exist, using the resources GUID. 2. Example 2Mapping a Resource that Does Not Currently Exist illustrates mapping resources that do not exist yet, using an LdapReference for the resource.
1. You will also see the term "exists" for a resource that has been "created". In this context they are synonymous.
TIBCO ActiveMatrix BPM - BPM Developers Guide
94
| Chapter 5
Example 1Mapping an Existing Resource Using a GUID The following diagram shows an example of how calls to the Directory Services API can be used to map an existing resource using the resources GUID. Figure 4 Mapping an Existing Resource Using a GUID
Client application Work Manager Services
listOrgModelOverview
1
BrowseModelService
listContainerResources
2
LDAPService
MappingService
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Mapping an Existing ResourceService Connector API Example (Java) on page 98.) 1. Find the available groups and positions to which resources can be mapped. The listOrgModelOverview operation can be used to list all available entities for a particular organization model version (model-version=-1 means to return entities from the latest organization model version).
Mapping Users 95
The response from the listOrgModelOverview operation provides GUIDs for the positions and groups in the organization model.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listOrgModelOverview model-version="-1"/> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listOrgModelOverviewResponse xmlns="http://browse.api.de.n2.tibco.com"> . . . <child entity-type="POSITION" guid="_9y7hYMpREd64gM7QE8RwxA" ideal-number="1" location-guid="_gqt1EMpREd64gM7QE8RwxA" model-version="3" name="VPIT" resource-count="9"> <selection-mode method="ANY" plugin=""/> </child> <child entity-type="POSITION" guid="_8NnJYMpREd64gM7QE8RwxA" ideal-number="1" location-guid="_gqt1EMpREd64gM7QE8RwxA" model-version="3" name="ITRepresentatives" resource-count="9"> <selection-mode method="ANY" plugin=""/> </child> . . . <root-node entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees" resource-count="9" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> <root-node entity-type="GROUP" guid="_mHwlMMpUEd64gM7QE8RwxA" model-version="3" name="Consultants" resource-count="9" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> . . . </listOrgModelOverviewResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
96
| Chapter 5
2. Find the available resources. The listContainerResources operation can be used to list all existing (already created) resources in the specified LDAP container (you can get the available LDAP containers using the listLDAPContainers operation). The response from the listContainerResources operation provides GUIDs for the resources in the container.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ldap="http://ldapservice.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <ldap:listContainerResources container-id="10"/> </soapenv:Body> </soapenv:Envelope> SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listContainerResourcesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> . . . <LdapResource guid="171DBF77-F205-4894-AEAA-F1941591548B" name="Richard Cresswell" resource-type="HUMAN" xmlns=""> <LdapReference container-id="10" container-name="easyAs" ldap-alias="easyAs" ldap-dn="OU=Richard Cresswell, OU=London, OU=AllEmployees, O=easyAsInsurance"/> <position entity-type="POSITION" guid="_XB0xADBTEd-x4cVy01Xlww" model-version="3" name="ReardenSalesManager"/> </LdapResource> . . . </listContainerResourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Mapping Users 97
3. Map the desired resource to the desired groups or positions. The mapEntities operation can be used to map resources. The response from the MapEntities operation returns the name of the resource mapped.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:map="http://mapping.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <map:mapEntities> <!--1 or more repetitions:--> <entityMapping> <target entity-type="POSITION" guid="_9y7hYMpREd64gM7QE8RwxA" > </target> <create resource-type="HUMAN" guid="D4E3C720-5500-4651-B105-6C60C613E226"> </create> </entityMapping> </map:mapEntities> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <mapEntitiesResponse xmlns="http://mapping.api.de.n2.tibco.com"> <result modified="1" xmlns=""> <resource guid="D4E3C720-5500-4651-B105-6C60C613E226" name="Leon Court" resource-type="HUMAN" xmlns:map="http://mapping.api.de.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></reso urce> </result> </mapEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
98
| Chapter 5
Mapping an Existing ResourceService Connector API Example (Java) The following example code illustrates mapping an existing resource using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration, Mapping an Existing Resource Using a GUID on page 94.
private void mapExistingUserExample(long containerID) { try { // Step 1: Get the Org Model Overview XmlOrgModelNode[] orgModelNodeArray = serviceConnectorInstance.listOrgModelOverview(-1); // Find a Group or Position to map the user to // In this example we will use the first Group we find. XmlOrgModelNode mappingGroup = null; if (orgModelNodeArray != null && orgModelNodeArray.length > 0) { for (XmlOrgModelNode node : orgModelNodeArray) { if (node.getEntityType() == OrganisationalEntityType.GROUP) { mappingGroup = node; break; } // Consider the children, here we just deal with the first level children, // in a real implementation this would need to be recursive to deal with the lower level children if (node.getHasChildren()) { for (XmlOrgModelNode childNode : node.getChildArray()) { mappingGroup = node; break; } } } } // Step 2: Find available resources // For this example we will map the first resource we find. XmlResourceDetail[] resourceArray = serviceConnectorInstance.listContainerResources(containerID); XmlResourceDetail mapResource = null; print(resourceArray[0]); if (resourceArray != null && resourceArray.length > 0) { mapResource = resourceArray[0];
Mapping Users 99
// Step 3: Map the resource // First create a mapping document XmlEntityMapping mapping = XmlEntityMapping.Factory.newInstance(); // Add a new create mapping element XmlLdapEntity mapping1 = mapping.addNewCreate(); // Set the Resource for the mapping mapping1.setGuid(mapResource.getGuid()); mapping1.setName(mapResource.getName()); mapping1.setResourceType(mapResource.getResourceType()); mapping1.setLdapReference(mapResource.getLdapReference()); // Add a target for the mapping XmlModelEntityId target = mapping.addNewTarget(); target.setGuid(mappingGroup.getGuid()); target.setEntityType(mappingGroup.getEntityType()); target.setModelVersion(mappingGroup.getModelVersion()); // Create an arry of the mappings, in this case we only have one. XmlEntityMapping[] mappingArray = new XmlEntityMapping[]{mapping}; // Do the mapping XmlEntityInstantiatedList result = serviceConnectorInstance.mapEntities(mappingArray); print(result); } } catch (InvalidOrgModelVersionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.de.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPSourceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPContainerFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityReferenceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidResourceMappingFault e) {
100
| Chapter 5
// TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityTypeFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidServiceRequestFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Example 2Mapping a Resource that Does Not Currently Exist The following diagram shows an example of how calls to the Directory Services API can be used to map a resource that has not been created yet by using an LdapReference for the resource. Figure 5 Mapping a Resource that Does Not Currently Exist
Client application Work Manager Services
listOrgModelOverview
1
BrowseModelService
listLDAPEntities
2
LDAPService
MappingService
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Mapping a New ResourceService Connector API Example (Java) on page 106.) 1. Find the available groups and positions to which resources can be mapped. The listOrgModelOverview operation can be used to list all available entities for a particular organization model version (model-version=-1 means to return entities from the latest organization model version).
102
| Chapter 5
The response from the listOrgModelOverview operation provides GUIDs for the positions and groups in the organization model.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listOrgModelOverview model-version="-1"/> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listOrgModelOverviewResponse xmlns="http://browse.api.de.n2.tibco.com"> . . . <child entity-type="POSITION" guid="_9y7hYMpREd64gM7QE8RwxA" ideal-number="1" location-guid="_gqt1EMpREd64gM7QE8RwxA" model-version="3" name="VPIT" resource-count="9"> <selection-mode method="ANY" plugin=""/> </child> <child entity-type="POSITION" guid="_8NnJYMpREd64gM7QE8RwxA" ideal-number="1" location-guid="_gqt1EMpREd64gM7QE8RwxA" model-version="3" name="ITRepresentatives" resource-count="9"> <selection-mode method="ANY" plugin=""/> </child> . . . <root-node entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees" resource-count="9" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> <root-node entity-type="GROUP" guid="_mHwlMMpUEd64gM7QE8RwxA" model-version="3" name="Consultants" resource-count="9" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> . . . </listOrgModelOverviewResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Find the available resources that can be mapped to the desired groups and positions. The listLDAPEntities operation can be used to list all resources in the specified LDAP container (you can get the available LDAP containers using the listLDAPContainers operation). Note that the example below shows passing "false" in the existing-only parameter of the listLDAPEntities operation, which causes the operation to return both existing and non-existing resources. For the existing resources, it returns both the resources GUID, as well as an LdapReference. For non-existing resources, it returns only the LdapReference (as resources are not assigned a GUID until they are created). The LdapReference will be passed in the mapEntities operation to both create and map the resource.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ldap="http://ldapservice.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <ldap:listLDAPEntities model-version="-1" container-id="1" existing-only="false"/> </soapenv:Body> </soapenv:Envelope>
104
| Chapter 5
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPEntitiesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <LdapResource name="Jon Parkin" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Jon Parkin,ou=Paris,ou=AllEmployees,o=easyAsInsurance"/> </LdapResource> <LdapResource guid="7AAB6AE7-CA2E-4211-BBF8-E081659526FE" name="Clint Hill" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Clint Hill,ou=Swindon,ou=AllEmployees,o=easyAsInsurance"/> <group entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees"/> <position entity-type="POSITION" guid="_yAXSQMpREd64gM7QE8RwxA" model-version="3" name="CFO"/> <privilege entity-type="PRIVILEGE" guid="_I8YiEMpSEd64gM7QE8RwxA" model-version="3" name="BaseUser"> <origin entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees"/> </privilege> <privilege entity-type="PRIVILEGE" guid="_HIl0IF-KEd-rno5lLiXABg" model-version="3" name="SuperviseVPs"> <origin entity-type="POSITION" guid="_yAXSQMpREd64gM7QE8RwxA" model-version="3" name="CFO"/> </privilege> . . . </listLDAPEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Create and map the desired resource to the desired groups or positions. The mapEntities operation can be used to create and map resources. The response from the mapEntities operation returns the name and GUID of the resource created and mapped.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:map="http://mapping.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <map:mapEntities> <entityMapping> <target model-version="-1" entity-type="POSITION" guid="_6lTHwMpREd64gM7QE8RwxA"/> <create resource-type="HUMAN" name="Jon Parkin" startDate="2011-07-22T06:59:59.000Z" endDate="2011-07-26T06:59:59.000Z"> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Jon Parkin,ou=Paris,ou=AllEmployees,o=easyAsInsurance"/> </create> </entityMapping> </map:mapEntities> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <mapEntitiesResponse xmlns="http://mapping.api.de.n2.tibco.com"> <result modified="1" xmlns=""> <resource endDate="2011-07-26T06:59:59.000Z" guid="C4A8178F-2E88-4187-9C5A-AA3F7673E0F3" name="Jon Parkin" resource-type="HUMAN" startDate="2011-07-22T06:59:59.000Z" xmlns:map="http://mapping.api.de.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Jon Parkin,ou=Paris,ou=AllEmployees,o=easyAsInsurance"/> </resource> </result> </mapEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
106
| Chapter 5
Mapping a New ResourceService Connector API Example (Java) The following example code illustrates mapping a new resource (that is, one that does not currently exist) using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration, Mapping a Resource that Does Not Currently Exist on page 101.
private void mapNewUserExample(long containerID) { try { // Step 1: Get the Org Model Overview XmlOrgModelNode[] orgModelNodeArray = serviceConnectorInstance.listOrgModelOverview(-1); // Find a Group or Position to map the user to // In this example we will use the first Group we find. XmlOrgModelNode mappingGroup = null; if (orgModelNodeArray != null && orgModelNodeArray.length > 0) { for (XmlOrgModelNode node : orgModelNodeArray) { if (node.getEntityType() == OrganisationalEntityType.GROUP) { mappingGroup = node; break; } // Consider the children, here we just deal with the first level children, // in a real implementation this would need to be recursive to deal with the lower level children if (node.getHasChildren()) { for (XmlOrgModelNode childNode : node.getChildArray()) { mappingGroup = node; break; } } } } // Step 2: Find available resources // For this example we will map the first resource we find. XmlResourceDetail[] resourceArray = serviceConnectorInstance.listLDAPEntities(containerID, false); XmlResourceDetail mapResource = null; print(resourceArray[0]); if (resourceArray != null && resourceArray.length > 0) { mapResource = resourceArray[0];
// Step 3: Map the resource // First create a mapping document XmlEntityMapping mapping = XmlEntityMapping.Factory.newInstance(); // Add a new create mapping element XmlLdapEntity mapping1 = mapping.addNewCreate(); // Set the Resource for the mapping mapping1.setName(mapResource.getName()); mapping1.setResourceType(mapResource.getResourceType()); mapping1.setLdapReference(mapResource.getLdapReference()); // Add a target for the mapping XmlModelEntityId target = mapping.addNewTarget(); target.setGuid(mappingGroup.getGuid()); target.setEntityType(mappingGroup.getEntityType()); target.setModelVersion(mappingGroup.getModelVersion()); // Create an arry of the mappings, in this case we only have one. XmlEntityMapping[] mappingArray = new XmlEntityMapping[]{mapping}; // Do the mapping XmlEntityInstantiatedList result = serviceConnectorInstance.mapEntities(mappingArray); print(result); } } catch (InvalidOrgModelVersionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.de.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPSourceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPContainerFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityReferenceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidResourceMappingFault e) { // TODO Auto-generated catch block
108
| Chapter 5
e.printStackTrace(); } catch (InvalidEntityTypeFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidLDAPSearchFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
listOrgModelOverviewResponse Type, name and GUID of every organization, organization unit, position, group and location
Initially, a listModelVersions call can be used to return a list of all major versions of the organization model that have been deployed. The listOrgModelOverview call specifies one of the versions returned from that list and returns a tree structure containing an outline of the organization model. It lists the following organization model entities: Organization
110
| Chapter 5
It also returns the unique ID of each of these entities. An application can select one of these entities and drill into it for further information by supplying the ID and version of the entity to the listAssociatedResources call. This call returns a list of those resources associated with the specified organization model entities, identified by their GUIDs. If a resource is associated with more than one of the identified model entities, it will only be listed once. If the type of organization model entity being queried is: an organization unit, the result includes those resources that hold positions within the organization unit. a group, the result includes resources that hold positions within the group being queried, and also includes resources associated with any of that group's sub-groups.
Combinations of these calls enable an application to navigate the organizational model tree to locate a required organization model entity. Navigating Large Organizations As shown above, the listOrgModelOverview operation can be used to get information for an entire organization model with one service call. This works fine for smaller organizations. However, if you have a large organization, it may be better to use the openOrgModel operation to get the root-nodes of the organization model, then the child elements from the openOrgModel response can be used to construct a request for the browseModelNode operation. Similarly, a child element from the browseModelNode response could then be used to create another request for browseModelNode, and so on, allowing you to "drill-down" into the organization model The "has-children" attribute of the child elements indicate whether passing that child identifier to browseModelNode would return entities nested beneath that child element in the organizational hierarchy.
listAssociatedResourcesResponse Gets the GUID of all resources associated with the specified entity
getPrivileges provides the same functionality for privileges rather than capabilities
BrowseModelService
You can use listAssociatedResources to obtain the ID of a resource. You can then use getCapabilities, specifying the resource ID, to return a list of the capabilities for a given organization model entity (such as a group or position) or for a resource (meaning a user mapped to an organization model entity). The getCapabilities call returns the following information:
112
| Chapter 5
For an organizational entity, the capabilities assigned to it in the organization model. These are the capabilities that the resource assigned to that entity should possess, which is the "entry criteria" for a group or position. For a resource, the actual capabilities that the selected resource possesses.
You can use updateCapabilityAssignments to change the capabilities assigned to a resource. The call specifies the ID of any capability to be changed, plus a remove flag, which is a Boolean value indicating whether or not the operation is to remove a capability that the resource may already possess (remove defaults to FALSE, which assigns the capability).
Meaning Wild card character. Matches zero or more of any character. Logical AND. Returns resources that satisfy the first string AND the second string. Place this special character to the left of the first query string, then enclose the entire expression in parentheses, as follows:
(&(string1)(string2))
Logical OR. Returns resources that satisfy the first string OR the second string. Place this special character to the left of the first query string, then enclose the entire expression in parentheses, as follows:
(|(string1)(string2))
NOT. This means that you want all resources that do NOT match the specified value. Place this special character to the left of the query string to which it applies, inside of the parentheses:
(!(string))
The following are some examples. The following query returns all resources that have sn attribute values beginning with s:
(sn=s*)
114
| Chapter 5
The following query returns all resources that have sn attribute values beginning with s or p:
(|(sn=s*)(sn=p*))
The following query returns all resources with carlicense attribute values equal to Full and employeetype attribute values equal to Permanent:
(&(carlicense=Full)(employeetype=Permanent))
The following query returns all resources where sn attribute values dont start with s and dont start with p:
(&(!(sn=s*))(!(sn=p*)))
Depending on the specific LDAP Server being used, the query syntax can vary. If the syntax described above does not return the expected results, consult the documentation for your LDAP Server.
116
| Chapter 5
If a potential resource is not found inside one or more of the secondary LDAP sources, the potential resource is eliminated from the list. If matches are found in every secondary LDAP source, they must uniquely identify only one LDAP entry in each source. If one or more match multiple items, the item remains in the potential resources list but is marked as invalid. This primary / secondary match is accomplished using the attributes specified in the container-mapping element when calling the saveLDAPContainerDetail operation:
<secondary-ldap ldap-alias="Global" ldap-search-string="(cn=*)" display-name-attributes="ou"> <container-mapping primary-attribute="ou" secondary-attribute="displayname"/> </secondary-ldap>
The goal of comparing primary / secondary attributes is to ensure that data from the secondary LDAP source is only merged together with the appropriate potential resource from the primary LDAP source. Where a match cannot be found, or where it is not one-to-one, the potential resource will not have a complete, accurate set of information, and it will be either omitted (where no match is found) or marked as invalid (where the match isn't one-to-one). For example, if there are several resources with the same last name, you need to map more than just the last name; maybe mapping first name too will be enough, or maybe you need to map more attributes (because there may be multiple resources in the secondary LDAP source with the same first and last nameit would not know which to include). Maybe there are other types of data, such as an employee ID that would work better and would avoid inconsistencies in data entry (typos, nicknames, abbreviations, etc.). You can get the LDAP attributes and their values to use in the primary-attribute and secondary-attribute attributes using the listLDAPAttributeNames operation. In the example shown above, we know that the ou attribute in the primary LDAP source contains the complete name of the resources, the displayname attribute in the secondary LDAP source contains the same information. So those attributes would be prime candidates to map the primary and secondary LDAP sources.
If you choose attributes that contain names, always be aware that there may be differences in the way those names were entered in the different LDAP sources, for example, Bob vs. Robert, Mike vs. Michael, or simple misspellings. Things like employee numbers tend to make good attributes to map.
118
| Chapter 5
These attributes are available for each resource that you create or map to groups or positions. For example, each resources cell phone number can be stored in the CellPhone attribute.
This example shows four resource attributes: CellPhone, ClearanceExpiration, DeskPhone, and DeveloperLevel. The DeveloperLevel attribute also has three enumerated values1.
1. Note that resource attributes of type "Enum" and "EnumSet" cannot be mapped to LDAP attributes.
TIBCO ActiveMatrix BPM - BPM Developers Guide
120
| Chapter 5
This example shows three LDAP attributes: departmentnumber, employeetype, and employeenumber.
Mapping Attributes
You may need to map one or more of the resource attributes to attributes in the LDAP sources you have defined in your LDAP container. You may need to do this because the business process does not have direct access to the attributes in the LDAP sources, but it does have access to the resource attributes in the organization model. When you map a resource attribute to an LDAP attribute, it gives the business process access to the data in the LDAP attribute at runtime. To map resource attributes to LDAP attributes, use the attribute-mapping element in the saveLDAPContainerDetail operation1. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://container.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <con:saveLDAPContainerDetail name="Field6" description="Field personnel" > <primary-ldap id="5" ldap-alias="deLdap2" ldap-search-string="(objectClass=person)" display-name-attributes="displayname"/> <secondary-ldap id="6" ldap-alias="easyAs" ldap-search-string="(objectClass=person)" display-name-attributes="ou"> <container-mapping primary-attribute="displayname" secondary-attribute="sn"/> </secondary-ldap> <secondary-ldap id="7" ldap-alias="deLdap4" ldap-search-string="(objectClass=person)" display-name-attributes="ou"> <container-mapping primary-attribute="displayname" secondary-attribute="sn"/> </secondary-ldap> <attribute-mapping ldap-resource-id="6" business-attribute-id="_7seVwMpSEd64gM7QE8RwxA" ldap-attribute="mail"/> <attribute-mapping ldap-resource-id="7" business-attribute-id="_nekK8AEZEd-SRt13X0LOYA" ldap-attribute="departmentnumber"/> </con:saveLDAPContainerDetail> </soapenv:Body> </soapenv:Envelope>
122
| Chapter 5
In this example, there are three LDAP sources: one primary and two secondary. And there are two resource attributes mapped to LDAP attributes. Note that the primary-ldap.id and secondary-ldap.id values are just made up they can be any value you choose. Their only purpose is to be able to reference that ID value in the attribute-mapping.ldap-reference-id attribute so that it knows which LDAP source to get the LDAP attribute from. So in the example above, the "mail" LDAP attribute is obtained from the LDAP source was identified as "6", and the "departmentnumber" LDAP attribute is obtained from the LDAP source that was identified as "7". If an LDAP container's details are retrieved with the getLDAPContainerDetail operation, the ldap-reference-id values will be assigned. The caller can re-use the same ID values when making a request to update the existing LDAP container, or they can be assigned arbitrary values againthey are only used to link the attribute-mapping element to the corresponding primary or secondary LDAP source element.
1. Note that TIBCO Business Studio refers to attributes defined there as "resource attributes", whereas the attribute-mapping element refers to them as "business attributes". They are the same thing.
TIBCO ActiveMatrix BPM - BPM Developers Guide
Organization Relationships
When you are creating or editing an LDAP container (using the saveLDAPContainerDetail operation), you can specify that that container have a relationship with one or more organizations. (This, of course, is applicable only if you have multiple organizations in your organization model.) When organization relationships are defined for any container, it can affect resources that are created in that container in the following ways: That resource will be able to view only the organization(s) to which his container has a relationship, as well as organizations that do not have any relationship with a container. This allows you to partition resources so that they cannot see organizations to which they dont belong. Note that this ability to partition does not apply to groups, as they are separate from, and outside, the organization structure in the organization model. That is, you cannot prevent a resource from seeing a particular group. It limits the positions into which the resource can be mapped. Resources can be mapped only to positions in organizations to which their container has a relationship, as well as to positions in organizations that have no explicit relationships to any container.
If a resource has been mapped to a position, then an organization relationship is set up that would bar that resource from membership to that position, it results in an invalid membership. Resources that have been mapped to invalid memberships should be removed (the mapEntities operation can be used to remove memberships). Organization relationships are specified using the administered-organisation element when calling the saveLDAPContainerDetail operation.
124
| Chapter 5
When a relationship is set up, it can effect the response from the following operations (unless the caller has a system action that overrides organization relationshipssee Overriding Organization Relationships on page 124): BrowseModelService listOrgModelOverview - Only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). openOrgModel - Only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). browseModelNode - Only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). ContainerService listLDAPContainers - Returns only the LDAP containers that have a relationship with the LDAP container in which the caller was created, or that have no organization relationships set up. LDAPService listContainerResources - Returns an empty response if the calling user does not have access to an organization to which a LDAP container is associated (because of organization relationships). listLDAPEntities - Returns an empty response if the calling user does not have access to an organization to which a LDAP container is associated (because of organization relationships).
LDAPAdmin - This system action is only applicable to ContainerService and LDAPService operations. Users with this system action will see all organizations when calling the listLDAPContainers, listContainerResources, and listLDAPEntities operations, regardless the organization relationships set up. Note that to call the listLDAPContainers, listContainerResources, and listLDAPEntities operations, the caller must possess either the resourceAdmin or LDAPAdmin system action. If the caller has the only resourceAdmin system action, the organizations he can see are restricted by organization relationship. If he also has (or has only) the LDAPAdmin system action, he can see all organizations, regardless the organization relationships set up.
You can determine if a user has a specific system action using the listAuthorisedOrgs operation.
126
| Chapter 5
| 127
Chapter 6
This chapter describes the web service operations and Service Connector methods that allow you to work with processes.
Topics
Listing Available Process Templates, page 128 Starting a Process Instance, page 138 Listing Available Process Instances, page 145 Sorting and Filtering Lists of Process Templates and Instances, page 151 Process Instance State Transitions, page 159 Migrating a Process Instance to a Different Version, page 161
128
| Chapter 6
Client application
basicProcessTemplates
-- or --
queryProcessTemplatesOutput
-- or --
listProcessTemplates
The listProcessTemplates operation returns the process templates that match the input criteria. It allows you to limit the process templates returned according to those in a specified module, those with a specified template name, or those of a specified version. Leaving all parameters blank causes the operation to return all process templates. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName></proc:moduleName> <proc:processName></proc:processName> <proc:version></proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope>
130
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <basicProcessTemplates xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <basicProcessTemplate> <processQName> <moduleName>/HelpDesk/Process Packages/HelpDesk.xpdl</moduleName> <processName>InternalHelpDesk</processName> <version>1.0.0.201105061158</version> </processQName> <description>*** Generated by TIBCO Business Studio.</description> </basicProcessTemplate> <basicProcessTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290831</version> </processQName> <description/> </basicProcessTemplate> . . . </basicProcessTemplates> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
132
| Chapter 6
queryProcessTemplates
The queryProcessTemplates operation returns the process templates that match the provided SQL query. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:queryProcessTemplatesInput> <proc:query>SELECT * FROM process WHERE DEFINITION.NAME='WelcomeUsers' ORDER BY DEFINITION.VERSION</proc:query> <proc:pageSize>0</proc:pageSize> </proc:queryProcessTemplatesInput> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessTemplatesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <processTemplates> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290731</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T07:29:58.943-07:00</creationTime> </processTemplate> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290831</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T08:30:30.543-07:00</creationTime> </processTemplate> </processTemplates> <pagingID>0</pagingID> </queryProcessTemplatesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
134
| Chapter 6
queryProcessTemplatesAlt
The queryProcessTemplatesAlt operation returns the process templates that match the specified set of search criteria. This operation is similar to the queryProcessTemplates operation, except the SQL query is broken into its constituent parts. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:queryProcessTemplatesAltInput> <proc:select></proc:select> <proc:where>DEFINITION.NAME='WelcomeUsers'</proc:where> <proc:orderBy>DEFINITION.VERSION</proc:orderBy> <proc:pageSize>0</proc:pageSize> </proc:queryProcessTemplatesAltInput> </soapenv:Body> </soapenv:Envelope>
136
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessTemplatesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <processTemplates> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290731</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T07:29:58.943-07:00</creationTime> </processTemplate> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290831</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T08:30:30.543-07:00</creationTime> </processTemplate> </processTemplates> <pagingID>0</pagingID> </queryProcessTemplatesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
138
| Chapter 6
Client application
listProcessTemplates
1
processManagement
listStarterOperations
2
processManagement
getStarterOperationInfo
3
processManagement
createProcessInstance
4
processManagement
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Starting a Process InstanceService Connector API Example (Java) on page 144.) 1. Find the available process templates. The listProcessTemplates operation can be used to list available process templates on the node. (You could also use the queryProcessTemplates or queryProcessTemplatesAlt operation to get a list of process templates.) The response from the listProcessTemplates operation provides module names, process name, and versions of the available process templates. These are needed when calling the createProcessInstance operation to start a process instance.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName></proc:moduleName> <proc:processName></proc:processName> <proc:version></proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope>
140
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <basicProcessTemplates xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <basicProcessTemplate> <processQName> <moduleName>/SalesCallback/Process Packages/SalesCallback.xpdl</moduleName> <processName>SalesCallbackProcess</processName> <version>1.0.0.201106301052</version> </processQName> <description/> </basicProcessTemplate> <basicProcessTemplate> <processQName> <moduleName>/Supply/Process Packages/Supply.xpdl</moduleName> <processName>Supply</processName> <version>1.0.0.201105061158</version> </processQName> <description/> </basicProcessTemplate> . . . </basicProcessTemplates> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Get starter operations. Starter operations refer to start events of processes. To be able to directly start an instance of a process template, the start event of the process must have a trigger type of "None" (as opposed to a trigger type of "Message", which requires that the process be started by a business service).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName>/Supply/Process Packages/Supply.xpdl</proc:moduleName> <proc:processName>Supply</proc:processName> <proc:version>1.0.0.201105061158</proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <starterOperations xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <starterOperation> <processQName> <moduleName>/Supply/Process Packages/Supply.xpdl</moduleName> <processName>Supply</processName> <version>1.0.0.201105061158</version> </processQName> <operation>StartEvent</operation> </starterOperation> </starterOperations> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. If the process template for which you are starting an instance has "start parameters" (also known as "formal parameters"), which are used to pass data into the process instance being started, you should also call the getStarterOperationInfo operation to get the names of the available start parameters.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:starterOperation> <proc:processQName> <proc:moduleName>/Supply/Process Packages/Supply.xpdl</proc:moduleName> <proc:processName>Supply</proc:processName> <proc:version>1.0.0.201105061158</proc:version> </proc:processQName> <proc:operation>StartEvent</proc:operation> </proc:starterOperation> </soapenv:Body> </soapenv:Envelope>
142
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <operationInfo xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <operationName>StartEvent</operationName> <parameters> <templateAttribute> <name>CustomerID</name> <type>java.lang.String</type> </templateAttribute> </parameters> </operationInfo> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
4. Start the process instance. The createProcessInstance operation is used to start the process instance and pass in start parameters, if required. The operation returns the process ID of the instance that is started.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:createProcessInstanceInput> <proc:processQName> <proc:moduleName>/Supply/Process Packages/Supply.xpdl</proc:moduleName> <proc:processName>Supply</proc:processName> <proc:version>1.0.0.201105061158</proc:version> </proc:processQName> <proc:operationName>StartEvent</proc:operationName> <proc:parameterMap> <!--Zero or more repetitions:--> <proc:parameter> <proc:name>CustomerID</proc:name> <proc:value>9987-345</proc:value> </proc:parameter> </proc:parameterMap> </proc:createProcessInstanceInput> </soapenv:Body> </soapenv:Envelope>
144
| Chapter 6
Starting a Process InstanceService Connector API Example (Java) The following example code illustrates starting a process instance using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration, Starting a Process Instance on page 138.
private void startProcessInstanceExample() { QualifiedProcessName process = QualifiedProcessName.Factory.newInstance(); try { // Step 1 : List the available templates BasicProcessTemplate[] templates = serviceConnectorInstance.listProcessTemplates(process); // Step 2 : Get the starter operations, in this example we use the first template we got back if (templates != null && templates.length > 0) { StarterOperation[] operations = serviceConnectorInstance.listStarterOperations(templates[0] .getProcessQName()); // Step 3 : Check the starter operation - in this example we use the first starter operation we got back if (operations != null && operations.length > 0) { OperationInfo info = serviceConnectorInstance.getStarterOperationInfo( templates[0].getProcessQName(), operations[0].getOperation()); String processId = serviceConnectorInstance.createProcessInstance(templates[0].getProcessQName(), operations[0].getOperation(), null); System.out.println(processId); } } } catch (IllegalArgumentFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (OperationFailedFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Client application
processInstances
-- or --
146
| Chapter 6
listProcessInstances
The listProcessInstances operation returns the process instances that match the input criteria. It allows you to limit the process instances returned according to those that were started from a template in a specified module, those started from a specified process template, or those of a specified template version. Leaving all parameters blank causes the operation to return all process instances. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName></proc:moduleName> <proc:processName>SalesCallbackProcess</proc:processName> <proc:version></proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <processInstances xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <processInstance> <processQName> <moduleName>/SalesCallback/Process Packages/SalesCallback.xpdl</moduleName> <processName>SalesCallbackProcess</processName> <version>1.0.0.201105061158</version> </processQName> <id>pvm:0a124</id> <state>ACTIVE</state> <startTime>2011-08-01T11:47:40.047-07:00</startTime> <completionTime xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <waitingWorkCount>1</waitingWorkCount> <parentProcessID/> </processInstance> </processInstances> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryProcessInstances
The queryProcessInstances operation returns the process instances that match the provided SQL query. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:queryProcessInstancesInput> <proc:query>SELECT ContactName FROM process WHERE INSTANCE.STATUS = 'ACTIVE'</proc:query> <proc:pageSize>10</proc:pageSize> <proc:attributeMap> <!--Zero or more repetitions:--> <proc:templateAttribute> <proc:name>ContactName</proc:name> <proc:type>string</proc:type> </proc:templateAttribute> </proc:attributeMap> </proc:queryProcessInstancesInput> </soapenv:Body> </soapenv:Envelope>
148
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessInstancesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <processInstances> <processInstance> <customAttributes> <customAttribute> <name>ContactName</name> <value>Ira Olson</value> </customAttribute> </customAttributes> </processInstance> <processInstance> <customAttributes> <customAttribute> <name>ContactName</name> <value>Walter Burfiend</value> </customAttribute> </customAttributes> </processInstance> </processInstances> <pagingID>-1859988354</pagingID> </queryProcessInstancesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryProcessInstancesAlt
The queryProcessInstancesAlt operation returns the process instances that match the specified set of search criteria. This operation is similar to the queryProcessInstances operation, except the SQL query is broken into its constituent parts. Web Service API example (SOAP):
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManag erType"> <soapenv:Header/> <soapenv:Body> <proc:queryProcessInstancesAltInput> <proc:select>INSTANCE.NAME,INSTANCE.ID,Issue</proc:select> <proc:where>INSTANCE.STATUS = 'SUSPENDED'</proc:where> <proc:orderBy>INSTANCE.START_DATE</proc:orderBy> <proc:pageSize>10</proc:pageSize> <proc:attributeMap> <!--Zero or more repetitions:--> <proc:templateAttribute> <proc:name>Issue</proc:name> <proc:type>string</proc:type> </proc:templateAttribute> </proc:attributeMap> </proc:queryProcessInstancesAltInput> </soapenv:Body> </soapenv:Envelope>
150
| Chapter 6
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessInstancesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerTyp e"> <processInstances> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> <id>pvm:0a12u</id> <customAttributes> <customAttribute> <name>Issue</name> <value>Forgot password</value> </customAttribute> </customAttributes> </processInstance> </processInstances> <pagingID>-94865740</pagingID> </queryProcessInstancesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
condition
where: attribute is a valid process data attribute. See Query Parameter Attributes on page 152 for a list of valid attributes. condition is an expression that defines the filter to be used. The condition expression must use the following syntax:
attribute operator value
152
| Chapter 6
where: attribute is a valid process data attribute for the WHERE clause. See Query Parameter Attributes on page 152 for a list of valid attributes. operator is a valid operator for the WHERE clause. See Query Parameter Operators on page 154 for a list of valid attributes. value is a constant literal. The constant literal can be a numeric type, date/time type or text type. A text literal must be enclosed in single quotes e.g. mytext. SQL keywords such as SELECT, FROM and WHERE are case insensitive. The ORDER BY clause can be used to sort the data. Filtering can be done based on multiple conditions by the use of the AND and OR logical operators. Parenthesis can be used to form complex expressions. For example:
SELECT SELECT SELECT
attribute(s) FROM process WHERE condition1 AND condition2; attribute(s) FROM process WHERE condition1 OR condition2;
Only a subset of the SQL SELECT statement is supported. For example, the following features are not supported: SELECT in the WHERE clause JOIN GROUP BY SQL FUNCTIONS SELECT INTO
The following attributes can be used to query process templates. Attribute Name DEFINITION.NAME DEFINITION.DESCRIPTION DEFINITION.VERSION DEFINITION.PRIORITY DEFINITION.CREATION_DATE MODULE.NAME Description Process name Process description Process version Process priority Process creation date Module name Type Text Text Text Numeric (short) Date/Time Text
The following attributes can be used to query process instances. Attribute Name MODULE.NAME INSTANCE.NAME INSTANCE.ID INSTANCE.VERSION INSTANCE.PRIORITY INSTANCE.STATUS INSTANCE.START_DATE INSTANCE.COMPLETION_DATE INSTANCE.WAITING_WORK_COUNT Description Module name Process instance name Process instance identifier Process instance version Process instance priority Process instance state/status Process instance start date Process instance completion date Process instance waiting work count Type Text Text Text Text Numeric (short) Text Date/Time Date/Time Numeric (integer)
154
| Chapter 6
Using User-Defined Attributes The attributeMap element (used by the queryProcessInstances and queryProcessInstancesAlt operations) should be used to specify the type of the user attributes for both the SELECT and ORDER BY clause. For a queryProcessInstanceCount operation (where the attributeMap element cannot be provided) you can specify a type casting as an in-place alternative. For example:
SELECT MODULE.NAME, INSTANCE.ID, LONG(BALANCE), DOUBLE(PAYMENT)
Unless otherwise noted, each operator can be applied to all data types (Text, Numeric, Boolean and DateTime) Operator = Description Equals - compares two values for equality. Wildcards can be used when comparing attributes of type string. See Using Wildcards on page 155. <> > Not equal to Greater than Examples
INSTANCE.NAME = LoanApproval INSTANCE.PRIORITY = 3 IsLoanApproved = TRUE INSTANCE.COMPLETION_DATE = '2008-06-20T10:30:20' INSTANCE.PRIORITY <> 3 INSTANCE. PRIORITY > 5000 Balance > 300.53 TS
<
Less than
Description Greater than or equal to Less than or equal to Pattern match comparison matches a string value against a pattern string containing wild-card characters. See Using Wildcards on page 155. Applies to Text data types only.
Examples
INSTANCE. PRIORITY >= 5000 INSTANCE. PRIORITY <= 5000
To match any processes with a module name that begins with module:
MODULE.NAME LIKE module%
To match any processes with a module name that begins with module number and ends with a single character):
MODULE.NAME LIKE module number _
BETWEEN
INSTANCE.PRIORITY BETWEEN 4000 AND 5000 INSTANCE.START_DATE between TS '2008-06-20T10:30:20' AND TS '2008-06-20T10:52:20';
IN
Implements comparison to a list of values, that is, it tests whether a value matches any value in a list of values. Applies to Text and Numeric data types only.
Tests whether the attribute has a value Inverts the result of a condition clause
MODULE.NAME IS NOT NULL Payment IS NULL MODULE.NAME NOT IN ('moduleBalance, 'modulePayment'); INSTANCE.PRIORITY NOT BETWEEN 4000 AND 5000
Using Wildcards The following wildcards can be used with the LIKE operator (and with the = operator when comparing attributes of type string): ? or _ matches any single character. * or % matches zero or more characters.
TIBCO ActiveMatrix BPM - BPM Developers Guide
156
| Chapter 6
Wildcards can be escaped using the \ character. For example, \%. Escape characters can be escaped using \\ which evaluates to matching \. If escaping a non-wildcard character, the escape character will be ignored. For example, \abc" evaluates to matching abc. Note that the * wildcard can be used in selection clauses only for non-paginated queries (that is when the PageSize parameter is specified as 0 (zero) when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt).
TS 1997-07-16T19:20-01:00
TS 1997-07-16T19:20Z
TS 1997-07-16T19:20:30
TS 1997-07-16T19:20:30+01:00
TS 1997-07-16T19:20:30-01:00
TS 1997-07-16T19:20:30Z
General Format YYYY-MM-DDThh:mm: ss.s YYYY-MM-DDThh:mm: ss.s+hh:mm YYYY-MM-DDThh:mm: ss.s-hh:mm YYYY-MM-DDThh:mm: ss.sZ where:
Example(s)
TS 1997-07-16T19:20:30.45
TS 1997-07-16T19:20:30.45+01:00
TS 1997-07-16T19:20:30.45-01:00
TS 1997-07-16T19:20:30.45Z
YYYY = four-digit year MM = two-digit month (01=January, etc.) DD = two-digit day of month (01 through 31) hh = two digits of hour (00 through 23) (am/pm NOT allowed) mm = two digits of minute (00 through 59) ss = two digits of second (00 through 59) s = one or more digits representing a decimal fraction of a second
If no time zone information is given with a time representation, the time is assumed to be in local time.
158
| Chapter 6
SELECT * FROM process WHERE (INSTANCE.ID > 20 AND MODULE.NAME = ModuleA AND order_amount > 10000) ORDER BY INSTANCE.ID DESC; SELECT * FROM process WHERE (INSTANCE.ID > 20 AND INSTANCE.ID < 100 ORDER BY INSTANCE.ID DESC; SELECT * FROM process WHERE (MODULE.NAME like 'module%'); SELECT * FROM process WHERE INSTANCE.START_DATE BETWEEN TS '2008-06-20T10:30:20Z' AND TS '2008-06-20T10:52:20Z'; SELECT MODULE.NAME, INSTANCE.VERSION, INSTANCE.NAME, INSTANCE.DESCRIPTION FROM process WHERE (MODULE.NAME = 'module_1' OR MODULE.NAME = 'module_2') ORDER BY MODULE.NAME DESC; SELECT * FROM process WHERE (isBalanceZero = TRUE) ORDER BY INSTANCE.ID DESC;
Create
createProcessInstance
Active
cancelProcessInstance cancelProcessInstances
X
Cancelling Failing Completing
Suspending
cancelProcessInstance cancelProcessInstances
Suspended
Cancelled
purgelProcessInstances
Failed
Completed
purgelProcessInstances
Legend Public API operation Private API operation (or other internal transition)
Purged
suspendOnError decision point Public state Intermediate state Start/End state (Private)
160
| Chapter 6
Notes
A failing process instance may change to Suspended instead of Failed in certain situations - see "Configuring suspendOnError Behavior for Process Instances" in BPM Administration for more information. The process instance is cancelled and is purged from the database. This change in state is the result of unsuccessful running of the process. There is no API call that produces this transition. The process instance is failed and is purged from the database.
Active Active
Cancelled Failed
Active
Completed
None
This change in state is the result of running the process successfully. There is no API call that produces this transition. The process instance is completed and is purged from the database.
Suspended Suspended
Active Cancelled
resumeProcessInstance resumeProcessInstances cancelProcessInstance cancelProcessInstances The process instance is cancelled and is purged from the database.
In some cases there are similarly-named singular and plural operations, such as suspendProcessInstance and suspendProcessInstances. In this case: suspendProcessInstance suspends the specified process instance, suspendProcessInstances suspends all process instances for the specified process template.
Valid migration points are automatically identified (and marked internally in the BPEL file) by TIBCO Business Studio at design time. There are restrictions on the types of change that can be made between the two versions (source and destination) of a migrated process template, as follows: In a normal flow (not a cycle), a task that precedes the migration point in the source version should not be rearranged so that it follows the migration point in the destination version. A task that is concurrent with the migration point in the source version should not be rearranged so that it follows the migration point in the destination version. If compensation is triggered in the destination version for a task that completed in the source version, the compensation defined in the source version will be performed.
162
| Chapter 6
Migration Rules A migration rule defines when, how and to what version a process instance will migrate. A migration rule identifies: a qualified task name (module name, module version, process template name and task name) from which a process instance will migrate. the module/process template version to which the process instance will migrate.
How Process Instances Are Migrated At runtime, when a process instance task that is defined as a migration point executes, Process Manager checks if a migration rule is set (using the qualified task name). If a migration rule is set, Process Manager: 1. migrates the process instance to the new version of the process template defined in the migration rule. 2. issues a BX_INSTANCE_PROCESS_MIGRATED audit event to indicate that the process instance has migrated. The managedObjectVersion for this event is the process template version after migration. The managedObjectId for this event is the ID of the process instance. This remains the same after migration as it was before, and so it can be used to connect audit events before and after migration. 3. continues execution of the task using the migrated to version of the process instance. Process Migration Operations The following Process Services service operations allow you to control process migration: listMigrationRules - List the process instance migration rules that are set for one or more process templates. isSetMigrationRule - Test whether any migration rules are set for a particular qualified task name. getMigrationPoints - List the permissible process instance migration points for one or more process templates. setMigrationRules - Set one or more process instance migration rules.
unsetMigrationRules - Unset one or more previously set process instance migration rules. clearMigrationRules - Clear all process instance migration rules for one or more process templates.
Authorization of Process Migration Operations A resource can only perform process migration if they have the necessary privileges to execute the handleProcessMigration system action. (The system-wide default value for this system action is Denied.) Process Manager will validate the calling resources privileges (by itself using Directory Services) whenever a process migration service operation is called. If the calling resource does not have the necessary authorization to execute the handleProcessMigration system action, the call will fail with an appropriate error. You can use Directory Services API SecurityService operations (for example, IsActionAuthorized) to test whether a resource has the necessary authorization before calling a process migration service operation. See System Actions on page 768 for more information about how to specify the handleProcessMigration system action when using the SecurityService operations.
164
| Chapter 6
| 165
Chapter 7
This chapter describes using the Business Resource Management Services API to work with work lists.
Topics
Introduction to Work Lists, page 166 Retrieving a Work List, page 167 Sorting and Filtering Work Lists, page 169 Creating and Managing Supervised Work List Views, page 180
166
| Chapter 7
The remainder of this chapter provides information about using these Business Resource Management Services operations to work with work lists. For information about working with the work items in a work list, see Working with Work Items on page 189.
getWorkListItems This operation returns items in the work list for a specified organizational entity. The request for this operation must specify the GUID of an organizational entity. You can get the GUID by various means, for example from a previous executeQuery operation, or for a resource (user) from a previous lookupUser operation. Optionally the request can also specify how many items from the work list to return, and whether to include the total number of work items in the work list. It can also specify sort and filter criteria to be applied to the work items returned. The request element (getWorkListItems) contains the following information: entityIDthe GUID of the organizational entity whose work list you want to retrieve. startPositionthe position in the work list from which to start the page of results. The list is zero-based. To start at the first item, specify 0. numberOfItemsthe number of items from the work list to include.
Optionally, it can contain: getTotalCountwhether to include a count of the total number of work items in the list. This defaults to true. The count is returned in the totalItems value in the response. You should set getTotalCount to false unless you specifically need the total figure, because setting it to true is expensive in terms of database access time. Note that if you pass false in this attribute, and there is at least one item in the list, the totalItems value returned in the response is -1. However, if you pass false and there are no work items in the list, the totalItems value in the response is 0 (zero). orderFilterCriteriasort or filter criteria, or both, to determine how the work items are to be filtered and presented. See Sorting and Filtering Work Lists on page 169 for details of the syntax and content of these criteria.
TIBCO ActiveMatrix BPM - BPM Developers Guide
168
| Chapter 7
The response for this operation returns full details of all the work list items that match the criteria specified in the request. For API reference information, see getWorkListItems on page 730. getAllocatedWorkListItems This operation is similar to getWorkListItems, except that: It returns only work items that are currently allocated to a resource, but were offered to an original offer set that included the specified organizational entity. It may not be used to get work list items for a resource (user).
The request element (getAllocatedWorkListItems) contains the following information: entityIDthe GUID of the organizational entity in the original offer set. This must not be a Resource. startPositionthe position in the work list from which to start the page of results. The list is zero-based. To start at the first item, specify 0. numberOfItemsthe number of items from the work list to include.
Optionally, it can contain: getTotalCountwhether to include a count of the total number of work items in the list. This defaults to true. The count is returned in the totalItems value in the response. You should set getTotalCount to false unless you specifically need the total figure, because setting it to true is expensive in terms of database access time. Note that if you pass false in this attribute, and there is at least one item in the list, the totalItems value returned in the response is -1. However, if you pass false and there are no work items in the list, the totalItems value in the response is 0 (zero). orderFilterCriteriasort or filter criteria, or both, to determine how the work items are to be filtered and presented. See Sorting and Filtering Work Lists on page 169 for details of the syntax and content of these criteria.
The response for this operation returns the same element as getWorkListItems. It contains full details of all the allocated work list items that match the criteria specified in the request. See Example 2 on page 184 for an example of the use of this operation. For API reference information, see getAllocatedWorkListItems on page 734.
These expressions can include an expression defining the sort and/or filter criteria to be applied to the work list. The following operations, used to retrieve work lists, can also include the same expressions: getWorkListItems (Request message)Get a work list for an organization model entity. getAllocatedWorkListItems (Request message)Get an allocated work list for an organization model entity.
The syntax and criteria for sort/filter expressions is the same for each of these operations. The default sort criteria, used to display a work list if no other sort is specified, are defined by the defaultSort property in the brm.properties file. See "Configuring TIBCO ActiveMatrix BPM Resource Management" in TIBCO ActiveMatrix BPM BPM Administration for this property. getWorkItemOrderFilter This operation returns a list of the work item fields that are defined by BRM as suitable to be used in expressions for sorting and filtering work items within work lists. See Sort/Filter Criteria for suitable fields. The request element (getWorktemOrderFilter) contains only: limitColumnsthe number of suitable fields about which information should be returned. Fields are returned in order of their ID, so if you enter a limitColumns value of 5, the response will include details of fields with id from 1 to 5. The table in Sort/Filter Criteria gives the IDs of the fields. Set limitColumns to 0 to get information about all fields.
170
| Chapter 7
The capability value in the response returned (getWorkItemOrderFilterResponse) includes whether each of the listed fields is suitable for sorting, for filtering, or for both. In the following example extract from a response, the id field (listed first because its own ID is 1) is suitable for both sort and filter expressions. The name field, however, can only be used in filter expressions.
<columnData capability="BOTH_ORDER_FILTER" description="The integer value that denotes the ID of the work item." id="1" name="id" type="COL_NUMERIC" xmlns=""/> <columnData capability="FILTER" description="The name of the work item." id="2" name="name" type="COL_STRING" xmlns=""/>
See Sort/Filter Criteria on page 172 for information on which types of field are defined as suitable for sort and filter expressions. For API reference information, see getWorkItemOrderFilter on page 741. setResourceOrderFilterCriteria This operation specifies a resource and sets the sort/filter criteria to be applied for that resources work lists. You would use this operation to enable a user to set their own sort and filter criteria; see Using Work Item Attribute Fields on page 178 for an example. The request element (setResourceOrderFilterCriteria) contains: resourceIDthe GUID of the resource for whom work list sort/filter criteria are to be set. You can get the GUID from a previous lookupUser operation. orderFilterCriteriathe criteria to be set.
For API reference information, see setResourceOrderFilterCriteria on page 745. getResourceOrderFilterCriteria This operation gets the currently defined sort/filter criteria for the work list for the specified resource. These would have been set by a previous setResourceOrderFilterCriteria operation. The request element (getResourceOrderFilterCriteria) contains: resourceIDthe GUID of the resource whose work list sort/filter criteria are to be retrieved. You can get the GUID from a previous lookupUser operation.
The response lists the sort and/or filter criteria that are set. For API reference information, see getResourceOrderFilterCriteria on page 743.
Text string fields are delimited using the ' character. Expressions denoting date/time ranges can use different delimiters with different meanings, as described in Using Date/Time Ranges on page 177. Other fields require no delimiters.
(priority = 1) OR ((priority < 12) AND (priority > 4)) OR (description='fred') (startDate>=2010-05-23T14:25:10) OR description='a_b*a' AND (priority<>13) OR (description='1?3*') (priority=35) OR description='a_b*a' AND (priority<>13) OR (description ='1?3*') visible=TRUE OR ((startDate>2010-05-23T14:25:10) AND (distributionStrategy=OFFERED)) [2010-05-23,2006-05-23T14:25:10.123Z] (startDate <= 2006-05-23T14:25:10.123Z) OR endDate<2010-05-23 priority=35 AND [2010-05-23T14:25:10,2006-05-23T14:25:10] attribute1=5346 OR attribute4=Urgent
Wildcard Characters The following wildcard characters can be used: ? can be used to match any single character. * can be used to match any string of zero or more characters.
If you wish to search for a string that actually contains these characters you must escape them using \. For example, the string "fr\?d", with the ? character escaped, results in a query using "fr?d". Sort Expressions Sort direction can be defined using the ASC (ascending sort) or DESC (descending sort) keywords. Multiple sort criteria can be used in a single expression. Individual criteria should be comma-separated. For example:
TIBCO ActiveMatrix BPM - BPM Developers Guide
172
| Chapter 7
Sort/Filter Criteria
The following table describes the criteria that can be used to filter and/or sort work items in a users work list. Field ID in API 1
Name id
Type Numeric
Operators = <> > < >= <= = <> > < >= <=
Description ID of the work item. Can be any number specified with or without a decimal point.
name
String
Filter expressions only. Cannot be used in sort expressions. Filter expressions only. Cannot be used in sort expressions. Sort and filter expressions.
The name of the work item. Can be any text. Wildcards are specified using ? and *, single and multiple character matching. Description of the work item. Can be any text. Wildcards are specified using ? and *, single and multiple character matching. Priority of the work item. Can be any number, with or without a decimal point.
description
String
priority
Numeric
Field ID in API 5
Name startDate
Operators = <> > < >= <= = <> > < >= <= = <>
Description Earliest date at which the work item can be started. See Using Date/Time Fields for details of the format. Date by which the work item should be completed. See Using Date/Time Fields for details of the format.
endDate
Date/ Time
distributionStrategy
Whether the item was offered or allocated when it was scheduled. Must be either ALLOCATED or OFFERED. Whether or not the item is currently visible. Must be either TRUE or FALSE.
visible
Boolean
= <>
state
Enum (State)
= <>
Current state of the work item. Must be one of: ALLOCATED OFFERED CREATED OPENED PENDED PENDHIDDEN CANCELLED SUSPENDED
174
| Chapter 7
Field ID in API 10
Name appInstance
Type String
Description The id of the application instance that created the work item. Can be any text. Wildcards are specified using ? and *, single and multiple character matching.
11
appName
String
The name of the application instance that created the work item. Can be any text. Wildcards are specified using ? and *, single and multiple character matching.
12
appInstance Description
String
The description of the application instance that created the work item. Can be any text. Wildcards are specified using ? and *, single and multiple character matching.
13
attribute1
Numeric (Integer)
The integer value of the first custom work item attribute defined. See Using Work Item Attribute Fields on page 178. Must be an integer.
Type String
Description The value of the second to fourth custom work item attributes defined. See Using Work Item Attribute Fields on page 178. Can be any text. Wildcards are specified using ? and *, single and multiple character matching.
17
attribute5
Numeric
The decimal value of the fifth custom work item attribute defined. See Using Work Item Attribute Fields on page 178. Must be a Decimal. In filter expressions, you can specify values in exponential notation. For example: =1.234E+11 =1.234e-1 =-.234e-2
18-19
attribute6 attribute7
Date/ Time
The value of the sixth to seventh custom work item attributes defined. See Using Work Item Attribute Fields on page 178. See Using Date/Time Fields for details of the format.
176
| Chapter 7
Field ID in API 20-27
Type String
Description The value of the eighth to fourteenth custom work item attributes defined. See Using Work Item Attribute Fields on page 178. Can be any text up to a maximum of 20 characters. Longer strings will be truncated to 20. Wildcards are specified using ? and *, single and multiple character matching.
Using Date/Time Fields Date/Time fields (startDate, endDate, and attribute6 - attribute7) can appear any number of times within a filter expression. No wildcards are supported. If no hours, minutes, seconds or milliseconds are specified then the field adds the time and milliseconds as required by the operations being performed. The following formats for date/times are allowed: yyyy yyyy-MM yyyy-MM-dd yyyy-MM-ddTHH yyyy-MM-ddTHH:mm yyyy-MM-ddTHH:mm:ss yyyy-MM-ddTHH:mm:ss.SSS yyyyTD yyyy-MMTD yyyy-MM-ddTD
Z <+|-><HHmm|HH:mm|HH>
2010-03-03T23:45+01 2010-03-03T23:45+01:30 2010-03TZ 2010T-0100
For example:
The operators given in the table are used as follows: <startDate | endDate> <operator> <date/time> For example: startDate >= 2010-05-23T14:25:10 endDate <= 2010-05-23T14:25:10Z startDate > 2010-05-23T14:25:10.123 endDate < 2010-05-23T14:25:10.123Z
Using Date/Time Ranges You can specify a query for a date/time range, and use it in filter expressions (but not in sort expressions) to query a range of endDates, a range of startDates, or a startDate to endDate period. Different separator characters have the following effects: Separator [ ] { } Specifies that... The start of the range is exclusive. The end of the range is exclusive. The start of the range is inclusive. The end of the range is inclusive.
178
| Chapter 7
Separator , ^ !
Specifies that... startDate is specified first, endDate next. The whole range is endDate values. The whole range is startDate values.
All the date formats supported by startDate and endDate (see Sort/Filter Criteria) are supported. The following examples all use the date format yyyy-MM-dd: Filter Expression
[2010-05-23,2010-07-23]
Description
(start_date>'2010-05-23T23:59:59.997' AND end_date<'2010-07-23T00:00:00.000') (start_date>='2010-05-23T00:00:00.000' AND end_date<='2010-07-23T23:59:59.997') (start_date>'2010-05-23T23:59:59.997' AND end_date<='2010-07-23T23:59:59.997') (start_date>='2010-05-23T00:00:00.000' AND end_date<'2010-07-23T00:00:00.000') (end_date>'2010-05-23T23:59:59.997' AND end_date<'2010-07-23T00:00:00.000') (start_date>='2010-05-23T00:00:00.000' AND start_date<='2010-07-23T23:59:59.997')
{2010-05-23,2010-07-23}
[2010-05-23,2010-07-23}
{2010-05-23,2010-07-23]
[2010-05-23^2010-07-23]
{2010-05-23!2010-07-23}
Using Work Item Attribute Fields You can use the values of the custom work item attribute fields as criteria in both sort and filter expressions. These fields correspond to the customizable attributes workItemAttributes.attribute1 to workItemAttributes.attributen that you can set using the work item scripting methods described in the "Work Item Scripting" section of the Business Data Services guide. See the "Using Scripts" chapter of the TIBCO Business Studio BPM Implementation guide for information on defining scripts in your processes at design time. You can use these attributes to hold data associated with the work item. For example, you could use them to track data about the customer with whom the work item is associated. Assume that a script in your business process sets the following values, mapping fields from the business process to work item attributes:
You could then use a setResourceOrderFilterCriteria operation to sort or filter by any of these values. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:setResourceOrderFilterCriteria resourceID="8D10C-42DEBD01-C23D2B4"> <orderFilterCriteria> <order>attribute3 ASC</order> <filter>attribute1=0435</filter> </orderFilterCriteria> </api:setResourceOrderFilterCriteria> </soapenv:Body> </soapenv:Envelope>
This example filters the specified resources work list to show only work items from the customer whose reference number is 0435. Those items that are displayed are then shown in order of the customer contact person specified on the work item.
180
| Chapter 7
See "System Actions" in TIBCO ActiveMatrix BPM Concepts for an overview of system actions. See Scope of System Actions on page 773 for information about scoped system actions. The following examples illustrate how you can use API operations to determine what supervised work lists a user has access to, then retrieve the contents of those work lists for display to the user.
Example 1 From the client applications user interface, a user requests a list of available supervised work lists: Figure 9 Supervised Work Lists
Browser Client application Work Manager Services
User requests list of available supervised work lists 1 listActionAuthorisedEntities [guids] SecurityService
BrowseModelService
Display list of available supervised work lists User selects a supervised work list getWorkListItems [work items] and/or getAllocatedWorkListItems Display contents of the selected supervised work list [work items] WorkListService WorkListService
1. Find out what work lists the user has access to, by calling listActionAuthorisedEntities for the viewWorkList system action. The
182
| Chapter 7
response contains a list of GUIDs. Each GUID identifies an organization model entity whose work list the calling user is authorized to view.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://security.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <sec:listActionAuthorisedEntities component="BRM" name="viewWorkList"/> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listActionAuthorisedEntitiesResponse xmlns="http://security.api.de.n2.tibco.com"> <guid xmlns="">_q2uCYDMeEeCrFvFvgjfN_w</guid> <guid xmlns="">_jWwQ4DMeEeCrFvFvgjfN_w</guid> <guid xmlns="">_i640QDMeEeCrFvFvgjfN_w</guid> <guid xmlns="">_pp_JgDMeEeCrFvFvgjfN_w</guid> </listActionAuthorisedEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. For each GUID returned in the listActionAuthorisedEntities response, call browseModelNode to obtain the organization model entitys entity-type, along with other detailsits name, whether it has any child entities and so on. You can use this information to present the available supervised work lists to the user in your desired manner. See also Navigating the Organization Model on page 109.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:browseModelNode guid="_i640QDMeEeCrFvFvgjfN_w"> </brow:browseModelNode> </soapenv:Body> </soapenv:Envelope>
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <browseModelNodeResponse entity-type="ORGANIZATIONAL_UNIT" guid="_i640QDMeEeCrFvFvgjfN_w" has-children="true" model-version="1" name="GroupB" xmlns="http://browse.api.de.n2.tibco.com"> <selection-mode method="ANY" plugin="" xmlns=""/> <child entity-type="POSITION" guid="_q2uCYDMeEeCrFvFvgjfN_w" has-children="true" ideal-number="1" model-version="1" name="BackOfficerWorker2" resource-count="1" xmlns=""> <selection-mode method="ANY" plugin=""/> </child> </browseModelNodeResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. When the user selects a supervised work list to view, call either or both of: getWorkListItems, to retrieve the list of work items currently offered to this user. getAllocatedWorkListItems, to retrieve the list of work items currently allocated to this user. In either case, specify the organization model entitys entity-type and GUID as parameters to this call.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:getWorkListItems startPosition="0" numberOfItems="5" > <entityID model-version="-1" entity-type="ORGANIZATIONAL_UNIT" guid="_i640QDMeEeCrFvFvgjfN_w" </entityID> </api:getWorkListItems> </soapenv:Body> </soapenv:Envelope>
184
| Chapter 7
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getWorkListItemsResponse xmlns="http://api.brm.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <endPosition xmlns="">3</endPosition> <totalItems xmlns="">4</totalItems> <workItems xmlns=""> <id id="5" version="0"/> <header distributionStrategy="OFFER" priority="50"> <name>GroupB</name> <description>GroupB</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i17</activityID> <activityName>GroupB</activityName> <appInstance>pvm:0a123</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>dfghfgfgfgf</appInstanceDescription> </itemContext> </header> <attributes attribute1="789" attribute2="fhfhfhfh" attribute3="123.45" attribute4="GroupB"/> <state>OFFERED</state> <visible>true</visible> </workItems> <workItems xmlns=""> <id id="8" version="0"/> . . . </workItems> </getWorkListItemsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Example 2 You may want to provide views based on different filters of the data. For example, to allow a supervisor to select a particular process instance and see a particular users outstanding, allocated work for that process instance: 1. Get the process instance ID. You can get this information from any of the listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt operations.
2. Use listActionAuthorisedEntities and browseModelNode in the same way described in Example 1. 3. Call getAllocatedWorkListItems, specifying the organizational entity whose list you want to view, and with a filter set for the appropriate process instance.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:getAllocatedWorkListItems numberOfItems="10" startPosition="0"> <entityID entity-type="ORGANIZATIONAL_UNIT" guid="_i640QDMeFvFvgjfN_w"/> <orderFilterCriteria> <filter>appInstance='pvm:0a125'</filter> </orderFilterCriteria> </api:getAllocatedWorkListItems> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getWorkListItemsResponse xmlns="http://api.brm.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <endPosition xmlns="">0</endPosition> <totalItems xmlns="">1</totalItems> <workItems xmlns=""> <id id="11" version="2"/> <header distributionStrategy="OFFER" priority="50"> <name>GroupB</name> <description>GroupB</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i21</activityID> <activityName>GroupB</activityName> <appInstance>pvm:0a125</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>turbot</appInstanceDescription> </itemContext> </header> <attributes attribute1="789" attribute2="major" attribute3="123.45" attribute4="GroupB"/> <state>PENDED</state> <visible>true</visible> </workItems> </getWorkListItemsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
186
| Chapter 7
Creating a Supervised Work List Service Connector API Example (Java) The following example illustrates creating a supervised work list and viewing work on a particular process instance, using the method calls available in the Java Service Connector API.
private void creatingAndManagingSupervisedWorkListViewsExample() { try { // Step 1: Find the GUIDS which we can view the work list for ListActionAuthorisedEntitiesResponse authorisedEntities = serviceConnectorInstance .listActionAuthorisedEntities("BRM", "viewWorkList"); // Step 2: Get the details of the GUIDS - in this example just the first one if (authorisedEntities.getGuidArray() != null && authorisedEntities.getGuidArray().length > 0) { XmlOrgModelNode node = serviceConnectorInstance.browseModelNode(-1, null, authorisedEntities.getGuidArray(0), null); // Step 3: Build up the entity we want to get the work list for XmlModelEntityId entity = XmlModelEntityId.Factory.newInstance(); entity.setGuid(node.getGuid()); entity.setEntityType(node.getEntityType()); entity.setModelVersion(node.getModelVersion()); // Get the work list for the specified GUID serviceConnectorInstance.getWorkListItems(OrderFilterCriteria.Factory.newInstance() , entity, 0, 100); // Example 2 for a specific instance ID OrderFilterCriteria oc = OrderFilterCriteria.Factory.newInstance(); oc.setFilter("appInstance='pvm:0a125'"); serviceConnectorInstance.getAllocatedWorkListItems(oc, entity, 0, 100); } } catch (SecurityFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidServiceRequestFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.de.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidOrgModelVersionFault e)
{ // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityReferenceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WorkItemOrderFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WorkItemFilterFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.SecurityFault e) { // TODO Auto-generated catch block e.printStackTrace(); }
188
| Chapter 7
| 189
Chapter 8
This chapter describes using the Business Resource Management Services API to work with work items.
Topics
Introduction to Work Items, page 190 Work Item Versions, page 192 Work Item States, page 193 Retrieving Information on Work Items, page 199 Offering and Allocating Work Items, page 201 Progressing a Work Item, page 212
190
| Chapter 8
list from which it was opened, and the process advances. This is typically called when the user clicks the Submit button on the work item form. openNextWorkItem - Opens the work item form for the next work item in the specified resources work list. getBusinessServiceDetailsByModule - Returns details of the forms used by the page activity in the business service. For more information about the operations in this service, see WorkPresentationService on page 747. WorkItemManagementService - This service contains many operations that can be used to manage work items, such as allocating, skipping, getting offer set, etc. The thing to keep in mind, however, is that the three operations that this service has in common with WorkPresentationService (openWorkItem, closeWorkItem, and completeWorkItem) should be called from WorkItemManagementService only when the work item does not present a form to the user. In most cases, a form is presented to the user; when a form is displayed, use the operations in WorkPresentationService instead. For more information about the operations available in this service, see WorkItemManagementService on page 681. Also see Progressing a Work Item on page 212 for information about using the operations in the services described above to progress a work item through a process.
192
| Chapter 8
As the closeWorkItem extract above shows, various operations also return a version number. If no version number is specified, the latest version is assumed. However, specifying the version can be good practice because it prevents clashes when two or more users attempt to operate on the same work item. For example, two users perform an allocateAndOpenWorkItem operation on a work item. If they do not specify a version number, the second allocateAndOpenWorkItem operation to be executed will fail because the work item is no longer in a suitable state to be allocated or opened. If both users specify the version number of the work item, the second operation will still fail, but it will do so with a version number error, as shown in the following extract:
<faultstring>The work item with id = 2 is currently at version 6, not at version 1</faultstring> <faultactor>PROVIDER</faultactor>
This enables your client application to know that you are attempting to use an out-of-date version of the work item, and to take appropriate action. For example, one possibility would be to use the getWorkItemHeader operation to retrieve the latest information for the work item and bring it back up to date. Another would be to use previewWorkItemFromList to obtain the current version of the work item.
Allocated
Opened
Suspended
Cancelled
194
| Chapter 8
Meaning If a work item is Pended with a hiddenPeriod specified, it cannot be accessed for the time defined in that hiddenPeriod. The final state of a work item in the BPM runtime, when work on an Opened work item has been completed. It is no longer on the system and cannot be affected by any API operations.
Completed
196
| Chapter 8
Created
scheduleWorkItem
Offered
closeWorkItem unallocate WorkItem allocate WorkItem
suspend WorkItem
Suspended
suspend WorkItem suspend WorkItem
Resume WorkItem
Allocated
allocateAndOpen reallocateWorkItem WorkItem openWorkItem
reallocateWorkItem
Opened
openWorkItem
Cancel WorkItem Cancel WorkItem
completeWorkItem
Completed
Cancel WorkItem
Cancelled
closeWorkItem
Cancel WorkItem
Pend WorkItem
resumeWorkItem
Pended
Internal function calls (or timer expires)
Pend WorkItem
(with hiddenPeriod=0 or negative) resumeWorkItem (with hiddenPeriod)
PendHidden
Pend WorkItem Legend
(with hiddenPeriod)
The Business Resource Management Services API includes a number of private services which are intended only for internal use by the BPM runtime. These services should not be used by an external application. State transitions caused by private API service operations have been omitted from the following table.
Description The offered work item is allocated to the specified organization model entity. The allocated object is returned to its original offered state. The allocated work item is opened. The allocated work item is put into the pendHidden state for the duration of the specified hiddenPeriod. Note - The work item cannot be accessed while it is hidden. See Accessing Hidden Work Items on page 218.
Allocated
198
| Chapter 8
Description The open work item (which must contain no data changes) is closed and returned to its offered state. The open work item is reallocated to the specified organization model entity. It will be in the allocated state. The opened work item is complete. The open work item is closed and any new data copied. It is then put into the pended state. The pended work item is reallocated to another organization model entity and put into the allocated state. The pended work item is opened.
Allocated
reallocateWorkItem
Complete Pended
completeWorkItem closeWorkItem
Pended
Allocated
reallocateWorkItem
Opened
openWorkItem
previewWorkItemFromList Use this operation to retrieve information on one or more specified work items in a work list. The request specifies the GUID of the requesting organizational entity, the IDs of one or more work items, and optionally a list of the fields about which information is required. You can use this operation: To get the type and value of one or more specific fields. You can filter the information returned by specifying one or more field names as requiredField parameters. If you do so, the operation returns information only on those named fields. To get information on all fields. If you do not include the requiredField parameter, the response returns the name, type, and value of all fields.
For API reference information, see previewWorkItemFromList on page 738. getWorkItemHeader Use this operation to retrieve the header information for a specified work item. The request specifies the workItemID of the required work itemwhich you can get from the response to a previous getWorkListItems or getAllocatedWorkListItems operationand the response returns the work item header information. The header information includes the work items: name description distributionStrategy priority startDate endDate
200
| Chapter 8
These attributes can be used as criteria for sorting or filtering work items in a work item listsee Sort/Filter Criteria on page 172. You can use this operation to bring a work item up to date if you have called an obsolete version. See Work Item Versions on page 192 for more information. For API reference information, see getWorkItemHeader on page 682. getOfferSet Use this operation to get the initial offered set for a work itemthat is, the collection of organizational entities to which the work item was initially offered. The request specifies the unique ID of the required work item and the response returns the GUIDs of all entities in the offer set. This information can then be used to allocate the work item to a particular resource from within this setsee Allocating Work Item to a Target Resource on page 201. For API reference information, see getOfferSet on page 719.
allocateAndOpenNextWorkItem
The following sections describe how to allocate work items to a target resource: Allocating Work Item to a Target Resource on page 201 Reallocating a Work Item on page 207 Reoffering a Work Item on page 209
202
| Chapter 8
World. If your system privileges include the reallocateWorkItemToWorld system action scoped at the organization model level, you can allocate the work item to a resource that was not included in the initial offered set. If there is more than one organization in your organization model, this can be any resource in an organization with which the current LDAP container has a relationship. See Organization Relationships for more details. Self. You can allocate the work item to yourself.
The following diagram shows an example of how you might take a work item from the list of items offered to an organizational entity such as a group or position, and allocate it to a specific resource within the original offer set. Figure 11 Allocating a Work Item
getOfferSet
1
[work item ID] getOfferSetResponse [list of GUIDs of entities in the offer set]
WorkListManagement
ListAssociatedResources
2
[GUID of one entity in the offer set] ListAssociatedResourcesResponse [list of GUIDs of resources mapped to that entity] allocateWorkItem
WorkItemManagement Service
[work item ID and GUID of a user from the offer set] allocateWorkItemResponse
WorkItemManagement Service
1. Use getOfferSet, specifying the ID of a work item, to list the entities to which this work item was offered.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:getOfferSet> <workItemID id="51"/> </api:getOfferSet> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getOfferSetResponse xmlns="http://api.brm.n2.tibco.com"> <entityGuid xmlns="">_5i1V0CfLEeChutsy_vK9tg</entityGuid> </getOfferSetResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Use listAssociatedResources to identify the GUID of one resource (user) from the offer set.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://resolver.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <res:listAssociatedResources model-version="-1" start-index="0" soft-limit="0"> <entity-guid>_fE8zxSfJEeChutsy_vK9tg</entity-guid> </res:listAssociatedResources> </soapenv:Body> </soapenv:Envelope>
204
| Chapter 8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listAssociatedResourcesResponse xmlns="http://resolver.api.de.n2.tibco.com"> <resource guid="846D100C-77C8-42DE-BD01-C23D214D2BB4" name="Liam Lawrence" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance"/> </resource> <resource guid="931F96FA-EC57-43B5-AA61-613784B1BD10" name="Leon Court" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Leon Court, OU=Paris, OU=AllEmployees, O=easyAsInsurance"/> </resource> </listAssociatedResourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Use allocateWorkItem to allocate the required work item to an individual resource. In this case it is Liam Lawrence, as you can see by comparing the resource GUID with the two GUIDs returned in the previous operation.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:allocateWorkItem> <workItemID id="51" <resource>846D100C-77C8-42DE-BD01-C23D214D2BB4</resource> </api:allocateWorkItem> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <allocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="51" version="1"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i11</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a124</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>ALLOCATED</state> <visible>true</visible> </workItem> </allocateWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>>
206
| Chapter 8
Allocating a Work Item Service Connector API Example (Java) The following example illustrates allocating a work item to a target resource, using the method calls available in the Java Service Connector API. The step numbers in the comments correspond to the steps shown in Allocating a Work Item on page 202.
private void allocateWorkItemExample() { // Setup the ManagedObjectID for the work item we want the offer set for ManagedObjectID id = ManagedObjectID.Factory.newInstance(); id.setId(10); try { // Step 1: Get the offer set GUIDs for the work item String[] offerGUIDs = serviceConnectorInstance.getOfferSet(id); if (offerGUIDs != null && offerGUIDs.length > 0) { // Step 2: Get the associated resources for the offer set GUIDs XmlLdapEntity[] entities = serviceConnectorInstance.listAssociatedResources(offerGUIDs, 0, 100); if (entities != null && entities.length > 0) { // Step 3: For this example allocate the work item to the first GUID we found serviceConnectorInstance.allocateWorkItem(new ManagedObjectID[]{id}, new String[]{entities[0].getGuid()}); // Now re-offer the work item to put it back to how we found it serviceConnectorInstance.unallocateWorkItem(new ManagedObjectID[]{id}); } } } catch (InvalidVersionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidWorkItemFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityReferenceFault e) { // TODO Auto-generated catch block e.printStackTrace(); }
catch (com.tibco.n2.de.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidOrgModelVersionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.SecurityFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
208
| Chapter 8
getWorkListItems
1
WorkListManagement
Depending on the work item State ... openWorkItem [id of the required work item] openWorkItemResponse
WorkItemManagement Service
reallocateWorkItemData
4
[work item ID; GUID of a user; new work item data] reallocateWorkItemDataResponse
WorkItemManagement Service
1. To determine whether the work item is in a suitable state, call getWorkListItems, specifying the resource (user) or other organizational entity on whose work list the work item currently appears. The response to this operation returns among other data the work item state. 2. Determine whether the required work item is in a state in which the reallocateWorkItemData operation can be usedthat is, if it is in an Opened or Pended state. 3. If it is not, call the openWorkItem operation to put the work item in a suitable state to be reallocated. 4. Finally call the reallocateWorkItemData operation to reallocate the work item to a new user and pass new data to them. Reallocating to Offer Set or to World Depending on the system actions a user holds, they may be able to reallocate a work item more or less widely:
reallocateToOfferSet This system action authorizes you to reallocate a work item to a resource in the original offer set. If for example the originally allocated resource is absent or overloaded, this might typically be sufficient to reallocate a work item to another member of the same team. reallocateWorkItemToWorld This system action authorizes you to reallocate a work item to any resourcethat is, to anybody in the "world" of the BPM runtime. You might need this level of authorization if for example it was decided that a work item needed reallocating to another department or to a resource with significantly different expertise, who was not in the original offer set.
210
| Chapter 8
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <unallocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="3" version="17"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001io</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a123</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>OFFERED</state> <visible>true</visible> </workItem> </unallocateWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Note that you cannot change the resources to which the work item is offered; you can only reallocate to the original offer set. If you need the work item to be assigned to a completely different resource you must possess the reallocateWorkItemToWorld system action and reallocate the work item using reallocateWorkItem, as described in Reallocating to Offer Set or to World.
212
| Chapter 8
To identify which work item is affected, the requests for these operations require the unique ID of the work item as input. You can obtain the work item ID by several methods, for example from the response to a previous getWorkListItems or getAllocatedWorkListItems operation.
openWorkItem
Use this operation to open a work item and to retrieve the associated data. The work item must be Allocated or Pended, and its state is changed to Opened. The operation returns the body of the work item. Note that this operation is available in two different services: WorkPresentationService - The openWorkItem operation in this service should be used in the following situations: If the user task is designed to display a form. This is typical for most client applications. (If the work item is designed to display a custom form, rather
than a TIBCO Business Studio form, also see Using Custom Forms on page 256.) If the user task is designed to start a pageflow. The response from the openWorkItem request contains the pageflow details, which you use with the startPageFlow operation in the WorkPresentationService to start the pageflow. For API reference information for the openWorkItem operation in this service, see openWorkItem on page 748. WorkItemManagementService - The openWorkItem operation is this service is used only if the user task does not open a form nor start a pageflow. This would be used only in special use-case client applications. For API reference information for the openWorkItem operation in this service, see openWorkItem on page 685.
closeWorkItem
Use this operation to close a work item and to update the associated data with any changes the user has made while it was open. This operation is for work items that are not completed, but on which work has been paused. The work item must be Opened. The operation sets the state to either PendHidden, if a hiddenPeriod is specified as an input parameter for this operation, or to Pended. Note that this operation is available in two different services: WorkPresentationService - The closeWorkItem operation in this service should be used to close a form that was opened when the work item was opened with the openWorkItem operation. This is typically called in response to a user clicking the Close button on a work item form. For API reference information for the closeWorkItem operation in this service, see closeWorkItem on page 753. WorkItemManagementService - The closeWorkItem operation in this service is used only if the user task did not open a form when the work item was opened. This would be used only in special use-case client applications. One special use-case for using the closeWorkItem operation in WorkItemManagementService is to set the work item state to PendHidden so that it does not appear in the work list for a specified period of time. For more information, see Accessing Hidden Work Items on page 218. For API reference information for the closeWorkItem operation in this service, see closeWorkItem on page 688.
TIBCO ActiveMatrix BPM - BPM Developers Guide
214
| Chapter 8
completeWorkItem
Use this operation when work on a work item or pageflow has completed, and to update the associated data with any changes the user has made while the work item or pageflow was open. The work item must be Opened, and its state is changed to Completed. Note that this operation is available in two different services: WorkPresentationService - The completeWorkItem operation in this service should be used in the following situations: To complete a work item when a form was opened when the work item was opened with the openWorkItem operation. Input and output data associated with the work item is saved to the database. This is typically called in response to a user clicking the Submit button on a work item form. To complete the parent work item when a pageflow was started after the work item was opened with the openWorkItem operation. The work item form is closed and input and output data associated with the work item (and pageflow) is saved to the database. For API reference information for the completeWorkItem operation in this service, see completeWorkItem on page 756. WorkItemManagementService - The completeWorkItem operation in this service is used only if the user task does not open a form nor start a pageflow. This would be used only in special use-case client applications. For API reference information for the completeWorkItem operation in this service, see completeWorkItem on page 706.
cancelWorkItem
Use this operation (which is available in the WorkPresentationService) to cancel any changes that a user has made on a work item form. It closes the work item form, discards any changes on the form, and leaves the work item in the users work list. For API reference information for the cancelWorkItem operation in this service, see cancelWorkItem on page 751.
skipWorkItem
Use this operation (which is in the WorkItemManagementService) to skip a work item, so that no action is carried out on it. This has a very similar effect to completing a work item, in that it means that no further work is required. However it can only be carried out: By a user who has authorization for the skipWorkItem system action, and On work items for which all required output and in/out data fields either: have default values defined, or in the case of input/output fields, have been give values before this work item, by a script or another activity. The work item must be Allocated, and once skipped its state is changed to Completed. For API reference information, see skipWorkItem on page 710.
saveOpenWorkItem
Use this operation (which is in the WorkItemManagementService) to save an open work item, updating the associated data with any changes the user has made while it was open. The work item must be Opened, and its state is not changed. For API reference information, see saveOpenWorkItem on page 721.
pendWorkItem
Use this operation (which is in the WorkItemManagementService) to set aside an unfinished work item as pending, and optionally to make that work item inaccessible for a specified period of time. Use the hiddenPeriod as follows: If no hiddenPeriod is specified, the work item must be Offered or Allocated, and its state is changed to Pended. A pendWorkItem call with a hiddenPeriod specified can be used to transition an Offered, Allocated or Pended work item into the PendHidden state. A pendWorkItem call with a hiddenPeriod of zero or a negative time specified can be used to change an item from a PendHidden state to a Pended state.
216
| Chapter 8
See Accessing Hidden Work Items on page 218 for detail on the effects of specifying various hiddenPeriods. Note that you can transition an Opened work item into a Pended state using closeWorkItem, not pendWorkItem. For API reference information, see pendWorkItem on page 725.
The business data passed into these requests is in the form of a dataModel element. The parameter data passed into the request can be either a simple type (simpleSpec) or a complex type (complexSpec, which is a BOM). For example, the following shows the saveOpenWorkItem request, in which inputs, outputs, or inouts can be passed as either simpleSpec or complexSpec data:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:saveOpenWorkItem> <workItemID id="?" version="?"/> <workItemPayload> <dataModel> <inputs name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </inputs> <outputs name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </outputs> <inouts name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </inouts> </dataModel> </workItemPayload> </api:saveOpenWorkItem> </soapenv:Body> </soapenv:Envelope>
If you pass ComplexSpec business data into one of the requests listed above (closeWorkItem, completeWorkItem, reallocateWorkItemData, or saveOpenWorkItem), the value can be either element-based or type-based.
218
| Chapter 8
The following shows the valid format for element-based and type-based complexSpec data values. Element-based complexSpec Example
<value> <businessserviceformediation:CustomerElement xsi:type="businessserviceformediation:Customer" xmlns:businessserviceformediation= "http://example.com/businessserviceformediation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <age>40</age> <name>Fred</name> <address xsi:type="businessserviceformediation:Address"> <firstLine>First Line</firstLine> <secondLine>Second Line</secondLine> </address> </businessserviceformediation:CustomerElement> </value>
When either of these occurs, the work item then transitions back to the Pended state.
The duration of a hiddenPeriod can also be extended or reduced by issuing a further pendWorkItem operation with a new hiddenPeriod. The new hiddenPeriod overrides the existing hiddenPeriod and is calculated from the current date/time. For example, suppose that a work item was pended at 14:30 with a hiddenPeriod of 30 minutes. If a further pendWorkItem is issued at 14:45 with: a hiddenPeriod of 2 hours, the work item will remain hidden until 16:45. a hiddenPeriod of 5 minutes, the work item will remain hidden until 14:50. a hiddenPeriod of 0, the work item will immediately transition to the Pended state. a hiddenPeriod of -5 minutes, the work item will immediately transition to the Pended state.
220
| Chapter 8
allocateWorkItem
OFFERED ALLOCATED
openWorkItem
WorkPresentationService
OPENED
OPENED
closeWorkItem
hiddenPeriod expires
openWorkItem
WorkPresentationService
C PENDED OPENED
C COMPLETED
In this example: 1. A work item appears in an organizational entitys work list. Its initial state is Offered. 2. To direct it to a resource (user) within that organizational entity, use the allocateWorkItem call, specifying the ID of the work item and the GUID of the resource as input parameters. The state of the work item changes to Allocated. 3. When the user opens the work item from their client user interface, the client application calls the openWorkItem operation, with the work item ID as an input parameter. The status of the work item changes to Opened. 4. The client application may make provision for the user to save the work item part way through completing it. This would be particularly useful if the work item displays a form containing a large number of fields or that may take some time to complete. In such circumstances the client application can call the saveOpenWorkItem operation. This saves the data associated with the work item, but does not change its stateit remains Opened. 5. In some applications a user may have to wait some time before finalizing a work item, for example to wait for another process to complete or for information to come in from an outside source. In that case the work item can be pended. If it is in an Opened state as in this example, that can be achieved by calling the closeWorkItem operation. If you call closeWorkItem and specify a hiddenPeriod, then that work item cannot be operated on for the specified period of time, or until the specified date and time is reached. Until then it is in the PendHidden state. 6. When the pendHidden deadline is reached a timer expires and the work item is put in the Pended state. 7. The user can now resume work on it. This is done by calling openWorkItem again, and returning the work item to the Opened state. 8. When the user has finished with the work item, and indicates this by pressing a Submit button or similar in their client applications user interface, the completeWorkItem operation is called and the state of the work item changed to Completed.
222
| Chapter 8
openWorkItem
4 5
User clicks Close button. Forms runtime notifies client and submits data
completeWorkItem
In this example: 1. A work item appears in an organizational entitys work list. To direct it to a resource (user) within that organizational entity, use the allocateWorkItem call from WorkItemManagementService, specifying the ID of the work item and the GUID of the resource as input parameters. 2. When the user opens the work item from their client user interface, the client application calls the openWorkItem operation from WorkPresentationService, with the work item ID as an input parameter. The WorkPresentationService operation is used instead of the operation of the same name in the WorkItemManagementService, because the work item makes a visual presentation to the user, and WorkPresentationService is optimized for the presentation of forms.
3. The client application invokes the Forms runtime to display the work items initial form. It may make other calls to the Forms runtime for subsequent forms within the work item. See Working With Forms for further information on using the Forms runtime. 4. When the user has finished with the work item, and indicates this by pressing a Close button or similar in their client applications user interface, the Forms runtime notifies the client application. 5. The client then invokes the completeWorkItem operation from WorkItemManagementService. Throughout this example the state of the work item changes as described in Example of Processing a Work Item.
224
| Chapter 8
openWorkItem 2
completeWorkItem
In this example: 1. A work item is assigned to a resource (user) by the allocateWorkItem call from WorkItemManagementService, as in Example of Processing a Work Item. 2. When the user opens the work item from their client user interface, the client application calls the openWorkItem operation from WorkPresentationService, with the work item ID as an input parameter. 3. When the user has finished with the work item, the client application invokes the completeWorkItem operation from WorkItemManagementService. The response to completeWorkItem returns the ID of the next work item in the chained subprocess.
4. The completeWorkItem response automatically opens the next chained work item; the client application does not need to call openWorkItem again. Note that the next chained work item must arrive within the timeout period specified by the CHAINED_TIMEOUT property in the WPProperties.properties file. If no response is received within that period, the chain "breaks", and no further chained work items are executed. For more details of this and other properties, see the WPProperties.properties file in the "BPM Properties Files" section of the TIBCO ActiveMatrix BPM BPM Administration guide. 5. The completeWorkItem operation is called for as many times as necessary, each time returning the ID of the next chained work item. 6. Eventually completeWorkItem returns no chained work item information, which indicates that the chained subprocess is completed. Processing Chained Work Items Web Service API Example The following example shows the web service calls from WorkItemManagementService that this sequence of events would produce. It uses the "WelcomeUsersChained" process, produced in the BPM tutorial "How to Ensure that a Sequence of Tasks is Performed by the Same User". First, use openWorkItem to open the first work item (workItemID 24) and assign it to a resource. The resource in this case is the user Clint Hill, with the ID
2D6430DC-9A65-4F21-A3BE-798AA192E468:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.wp.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:baseWorkRequest> <resourceId>2D6430DC-9A65-4F21-A3BE-798AA192E468</resourceId> <workItem id="24">?</workItem> <workTypeDetail/> </api:baseWorkRequest> </soapenv:Body> </soapenv:Envelope>
226
| Chapter 8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="JSON" xmlns=""> <serializedPayload>{items:[{"$param":"UserName","$value":[],"typ e":"String","mode":"OUT"}]}</serializedPayload> </payloadModel> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__D1uKcCoHEeCmTZqrA21YZg" version="1.0.0.201108121142" xmlns=""/> <presentation activityName="GetUsersName" formIdenitifier="1.0.0.201108121142/GIGWTPull_DefaultChannel/.de fault/ProcessPackage/WelcomeUsersChained/GetUsersName/GetUsersNa me.gwt.json" type="GI_FORM" version="1.0.0.201108121142" xmlns=""/> <workItem id="24" version="1" xmlns=""/> </workResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="" xmlns=""/> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__efo_sClUEeCJP69W825hSw" version="1.0.0.201108121142" xmlns=""/> <presentation activityName="SendOutWelcomePack" formIdenitifier="1.0.0.201108121142/GIGWTPull_DefaultChannel/.de fault/ProcessPackage/WelcomeUsersChained/SendOutWelcomePack/Send OutWelcomePack.gwt.json" type="GI_FORM" version="1.0.0.201108121142" xmlns=""/> <workItem id="25" version="1" xmlns=""/> </workResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
228
| Chapter 8
Call completeWorkItem again to complete work item 26. This time the response shows no chained work item information.
<api:workRequest> <resourceId>2D6430DC-9A65-4F21-A3BE-798AA192E468</resourceId> <workItem id="26">?</workItem> <workTypeDetail openNextPiled="true"/> <payloadDetails> <serializedPayload>[]}</serializedPayload> <XmlPayload/> </payloadDetails> </api:workRequest>
Processing Chained Work Items Service Connector API Example (Java) The following example code illustrates processing chained work items using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps shown in Chained Work Items on page 224.
private void completeChainedWorkItem() { try { // Step 1: Allocate the work item // First we setup arrays containing the items to allocate and the resources to allocate to // The items to allocate ManagedObjectID[] itemsToAllocate = new ManagedObjectID[1]; ManagedObjectID itemToAllocate = ManagedObjectID.Factory.newInstance(); itemToAllocate.setId(84); itemsToAllocate[0] = itemToAllocate; // The resource to allocate to String[] resourcesToAllocate = new String[]{"tibco-admin"}; // Do the allocation com.tibco.n2.brm.api.WorkItem[] itemsAllocated = serviceConnectorInstance.allocateWorkItem(itemsToAllocate, resourcesToAllocate); // Step 2: Open the work item // Create a request to open the work item we are interested in BaseWorkRequest openRequest = BaseWorkRequest.Factory.newInstance(); WorkItem item = openRequest.addNewWorkItem(); // Use the ID we got back from the allocateWorkItem call, in this case we only have 1
item.setId(itemsAllocated[0].getId().getId()); openRequest.setResourceId("tibco-admin"); // Open the item WorkResponse openResponse = serviceConnectorInstance.openWorkItem(openRequest); // Step 3: Complete the item ( continue until no more items are available ) // Setup variable to hold details of the item we will complete, initially this will be // the item we opened, then it will be the item returned by the complete call for each item in the chain. long itemIdToComplete = openResponse.getWorkItem().getId(); long itemVersionToComplete = openResponse.getWorkItem().getVersion(); String itemWTUidToComplete = openResponse.getWorkTypeDetail().getUid(); String itemWTVersionToComplete = openResponse.getWorkTypeDetail().getVersion();
// Flag to indicate whether we have run out of items and should break out of the loop boolean nextItemAvailable = true; while (nextItemAvailable) { // Create a request WorkRequest completeRequest = WorkRequest.Factory.newInstance(); // Add the item to the request item = completeRequest.addNewWorkItem(); item.setId(itemIdToComplete); item.setVersion(itemVersionToComplete); completeRequest.setResourceId("tibco-admin"); // Add the work type to the request WorkTypeDetail detail = WorkTypeDetail.Factory.newInstance(); completeRequest.setWorkTypeDetail(detail); detail.setUid(itemWTUidToComplete); detail.setVersion(itemWTVersionToComplete); // Add the data to the request DataPayload payload = DataPayload.Factory.newInstance(); payload.setPayloadMode(PayloadModeType.JSON); payload.setSerializedPayload(""); completeRequest.setPayloadDetails(payload); // Complete the item WorkResponse completeResponse = serviceConnectorInstance.completeWorkItem(completeRequest); // Check the response to see if another item is available if (completeResponse.getWorkItem() == null) { // If no item available break out of the loop - chaining is now finished nextItemAvailable = false; } else {
230
| Chapter 8
// Update the details for the item we will complete next itemIdToComplete = completeResponse.getWorkItem().getId(); itemVersionToComplete = completeResponse.getWorkItem().getVersion(); itemWTUidToComplete = completeResponse.getWorkTypeDetail().getUid(); itemWTVersionToComplete = completeResponse.getWorkTypeDetail().getVersion(); } } } catch (InvalidWorkRequestFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WorkItemUnavailableFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.wp.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (WorkProcessingFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ChainedTimeOutFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidWorkItemFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidEntityFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidVersionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.brm.services.SecurityFault e) { // TODO Auto-generated catch block e.printStackTrace();
} } }
232
| Chapter 8
| 233
Chapter 9
This chapter describes how to use the WorkPresentationService, PageFlowService and BusinessService APIs to display forms for work items and pageflow/business service page activities in a client application.
Topics
Overview, page 234 Using TIBCO Forms, page 235 Displaying a Work Item Form, page 239 Displaying a Form in a Pageflow, page 242 Displaying a Form in a Business Service, page 251 Using Custom Forms, page 256
234
| Chapter 9
Overview
A client application may need to display a form to a user when that user: opens a work item. opens a work item that starts a pageflow. starts a business service.
The client application can render the form using either: a TIBCO form, which provides a web-based user interface to the work item data. See Using TIBCO Forms. a custom form developed as part of the client application. See Using Custom Forms.
TIBCO Business Studio automatically generates an implementation of each form defined in a project for each channel type defined in the projects presentation channel(s). If no form has been defined for a user activity, default form implementations are automatically generated for the default presentation channel. When a project is deployed to the BPM runtime, the generated form artifacts are deployed as well. (bpmresources is the name of the BPM runtime component that provides access to the form resources of deployed BPM applications.) A client application can use the WorkPresentationService to access the form artifacts that have been deployed to the BPM runtime, and so display an appropriate TIBCO form for a work item or pageflow/business service page.
236
| Chapter 9
The BPM runtime uses this channel to select the correct form artifact to use to display a form. If the client is not explicitly bound to a channelId, the default openspaceGWTPull_DefaultChannel (see below) is used.
The following table shows: the channel types supported by TIBCO Business Studio. the format of different channelIds used to identify individual channels of each presentation type. ChannelName is the label of the parent presentation channel - for example, DefaultChannel or CustChannel1. the channelType enumeration that should be specified for each channelId. channelId openspaceGWTPull_ChannelName GIGWTPull_ChannelName MobileGWTPull_ChannelName GIGIPull_ChannelName EmailGIPush_ChannelName channelType openspaceChannel openspaceChannel MobileChannel GIChannel EmailChannel
TIBCO Business Studio channel type Openspace Google Web Toolkit Workspace Google Web Toolkit Openspace Mobile Workspace General Interface Workspace Email
The channelType enumerations JSPChannel, PageflowChannel and RssChannel are currently not supported. You cannot obtain channelIds programmatically. Instead, you must obtain them directly from TIBCO Business Studio. The following screenshot shows: the channel types used by the default presentation channel. (Form artifacts are automatically generated for each of these channel types.) how to obtain the channelId of a particular channel. In this example, openspaceGWTPull_DefaultChannel identifies the channel in the Default
Channel presentation channel that uses the Openspace Google Web Toolkit channel type.
See "Using Presentation Channels to Display Tasks to Users" in TIBCO Business Studio BPM Implementation for more information.
238
| Chapter 9
The Forms Runtime Adapter handles the users interaction with the form. When the user submits, closes or cancels the form, the Forms Runtime Adapter notifies the client application that this has happened (using the callback handler registered) and returns the data from the form. For more information about how to integrate use of the Forms Runtime Adapter with calls to the BPM services, see: Displaying a Work Item Form Displaying a Form in a Pageflow Displaying a Form in a Business Service
User opens a work item openWorkItem 1 [work item data, form details]
WorkPresentation Service
Client invokes the Forms Runtime Adapter to display form User clicks Submit, Cancel or Close button. Forms Runtime Adapter notifies client of the users action and submits data 2
WorkPresentation Service
The following step-by-step descriptions correspond to the numbered steps in the diagram. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). For an example of how to use the Service Connector API (Java) to display a work item, see Rendering a Form for a Work Item on page 62.
240
| Chapter 9
When a user opens a work item from the user interface: 1. Call openWorkItem. Use the following items in the baseWorkRequest element to specify form-related inputs to the call: channelId specifies the presentation channel to which the client application is bound. (If channelId is not specified, the default channel will be used.) channelType specifies the type of the channelId. responsePayloadMode specifies the format in which the work item data should be returned. This must be JSON. If the work item is associated with a single form (rather than a pageflow), the following items in the workResponse element contain the information needed to render the work item: payloadModel.serializedPayload contains the work item data as a JSON payload. presentation.formIdentifier identifies the JSON form artifact to be used to display the work item data). For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.wp.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:baseWorkRequest> <resourceId>A2DF6C05-AECA-4D59-A553-A7D029920D51</resourceId> <channelId>openspaceGWTPull_DefaultChannel</channelId> <channelType>openspaceChannel</channelType> <responsePayloadMode>JSON</responsePayloadMode> <workItem id="10" version="-1"></workItem> </api:baseWorkRequest> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="JSON" xmlns=""> <serializedPayload>{items:[{"$param":"PhoneNumber","$value":["666"], "type":"String","mode":"IN"},{"$param":"UserName","$value":["Martin"],"type":"St ring","mode":"IN"},{"$param":"Message","$value":["Please call Martin at 666."],"type":"String","mode":"INOUT"}]}</serializedPayload> </payloadModel> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__2H9PkMP5EeC3yLAVrheurQ" version="1.0.0.201108111305" xmlns=""/> <presentation activityName="Displayeverything" formIdenitifier="1.0.0.201108111305/openspaceGWTPull_DefaultChannel/.default/aph MyPackage/aphWelcomeUsers/Displayeverything/Displayeverything.gwt.json" type="GWT_FORM" version="1.0.0.201108111305" xmlns=""/> <workItem id="10" version="1" xmlns=""/> </workResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Pass the work item data and form details to the Forms Runtime Adapter, which renders the form and handles the users interaction with it. (See Rendering a TIBCO Business Studio Form.) When the user submits, closes or cancels the form, the Forms Runtime Adapter notifies the client application that this has happened and returns the data from the form. 3. Call closeWorkItem, cancelWorkItem or completeWorkItem as appropriate.
242
| Chapter 9
User opens a work item openWorkItem [pageflow details, form details] WorkPresentation Service
Pageflow Service
Client invokes Forms Runtime Adapter to display form for first page User clicks Submit or Cancel button. Forms Runtime Adapter notifies client of the users action and returns data 3
Pageflow Service
...if the user clicked Submit, repeat steps 3 and 4 until the pageflow has completed or is cancelled completeWorkItem or cancelWorkItem 6 [success]
WorkPresentation Service
The following step-by-step descriptions correspond to the numbered steps in the diagram. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). When a user opens a work item from the user interface: 1. Call openWorkItem. Use the following items in the baseWorkRequest element to specify form-related inputs to the call: channelId specifies the presentation channel to which the client is bound. (If channelId is not specified, the default channel will be used.) channelType specifies the type of the channelId. responsePayloadMode specifies the format in which the work item data should be returned. This must be JSON. If the work item is associated with a pageflow (rather than a single form), the following items in the workResponse element contain the information needed to render each page of the pageflow: pageFlowDetail.page-activity.page-reference.formIdentifier identifies the JSON form artifact that is to be used to display the data for the first page. pageFlowDetail.page-activity identifies the JSON form artifact to be used to display the page data. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.wp.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:baseWorkRequest> <resourceId>A2DF6C05-AECA-4D59-A553-A7D029920D51</resourceId> <channelId>openspaceGWTPull_DefaultChannel</channelId> <channelType>openspaceChannel</channelType> <responsePayloadMode>JSON</responsePayloadMode> <workItem id="14" version="-1"></workItem> </api:baseWorkRequest> </soapenv:Body> </soapenv:Envelope>
244
| Chapter 9
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="JSON" xmlns=""> <serializedPayload>{items:[]}</serializedPayload> </payloadModel> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__lgyB-MP5EeC3yLAVrheurQ" version="1.0.0.201108111305" xmlns=""> <dataModel/> </workTypeDetail> <presentation formIdenitifier="http://localhost:8080/bpm/" type="FORM" xmlns=""/> <workItem id="14" version="1" xmlns=""/> <pageFlowDetail id="_sFSQwMP5EeC3yLAVrheurQ" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" moduleVersion="1.0.0.201108111305" name="GetName" url="APH_WelcomeUsersImplementSolution/.bpm/.processOut/pageflow/aph_test.xpdl/G etName.bpel" xmlns=""> <page-activity id="_faDz8MP8EeC3yLAVrheurQ" name="ShowCustName" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="ShowCustName.gwt.json" version="1.0.0.201108111305"> <relative-path>1.0.0.201108111305/openspaceGWTPull_DefaultChannel/.default/aphMy Package/GetName/ShowCustName</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> <page-activity id="_s1Q8MMP5EeC3yLAVrheurQ" name="getFirstName" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="getFirstName.gwt.json" version="1.0.0.201108111305"> <relative-path>1.0.0.201108111305/openspaceGWTPull_DefaultChannel/.default/aphMy Package/GetName/getFirstName</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> <page-activity id="_tTg-cMP5EeC3yLAVrheurQ" name="getSecondName" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="getSecondName.gwt.json" version="1.0.0.201108111305"> <relative-path>1.0.0.201108111305/openspaceGWTPull_DefaultChannel/.default/aphMy Package/GetName/getSecondName</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> </pageFlowDetail> </workResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Call startPageFlow to open the first page in the pageflow. Use the following items in the startPageFlow element to specify form-related inputs to the call: formalParams specifies any data that needs to be passed to the pageflow as formal parameters. You cannot determine which data fields are formal parameters programmatically. Instead, you must obtain this information directly from TIBCO Business Studio. responsePayloadMode specifies the format in which the page data should be returned. This must be JSON. When the startPageFlowResponse element is returned: executionState indicates if the pageflow contains further pages (IN_PROGRESS) or if this is the last page (COMPLETED). pageData.payload.serializedPayload contains the page data as a JSON payload. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:startPageFlow> <pageFlowDefinition moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305"/> <responsePayloadMode>JSON</responsePayloadMode> </pag:startPageFlow> </soapenv:Body> </soapenv:Envelope>
246
| Chapter 9
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <startPageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305"/> <processReference> <id>pvm:0a10s</id> <name>GetName</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001gs.4" activityModelId="_s1Q8MMP5EeC3yLAVrheurQ" activityName="getFirstName" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" moduleVersion="1.0.0.201108111305" processName="GetName"/> <payload payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":[],"type":"String"," mode":"INOUT"},{"$param":"SecondName","$value":[],"type":"String","mode":"INOUT" }]}</serializedPayload> </payload> </pageData> </pageResponse> </startPageFlowResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Pass the page data and form details to the Forms Runtime Adapter, which renders the form and handles the users interaction with it. (See Rendering a TIBCO Business Studio Form.) When the user submits or cancels the form, the Forms Runtime Adapter notifies the client application that this has happened and returns the data from the form. 4. If the executionState returned by startPageFlow was IN_PROGRESS, call updatePageFlow to a) update the pageflow with any data added or changed by the user and b) open the next page in the pageflow. Use the following items in the updatePageFlow element to specify form-related inputs to the call: context.processReference.id specifies the pageflow process instance that is to be updated. This value can be obtained from the previous startPageFlowResponse element. context.activityReference.activityId specifies the pageflow activity that is to be updated. This value can be obtained from the
pageData.pageReference.activityId item in the previous startPageFlowResponse element. pageFields contains the page data that is to be updated, as returned by the form. responsePayloadMode specifies the format in which the page data should be returned for the next page. This must be JSON. When the updatePageFlowResponse element is returned: executionState indicates if the pageflow contains further pages (IN_PROGRESS) or if this is the last page (COMPLETED). pageData.payload.serializedPayload contains the page data for the next page as a JSON payload. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:updatePageFlow> <context> <processReference> <id>pvm:0a10s</id> </processReference> <activityReference activityId="pvm:001gs.4"/> </context> <pageFields payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":["Gerald"],"type":"S tring","mode":"INOUT"},{"$param":"SecondName","$value":["Durrel"],"type":"String ","mode":"INOUT"}]}</serializedPayload> </pageFields> <responsePayloadMode>JSON</responsePayloadMode> </pag:updatePageFlow> </soapenv:Body> </soapenv:Envelope>
248
| Chapter 9
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updatePageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305"/> <processReference> <id>pvm:0a10s</id> <name>GetName</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001gs.5" activityModelId="_tTg-cMP5EeC3yLAVrheurQ" activityName="getSecondName" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" moduleVersion="1.0.0.201108111305" processName="GetName"/> <payload payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":["Gerald"],"type":"S tring","mode":"INOUT"},{"$param":"SecondName","$value":["Durrel"],"type":"String ","mode":"INOUT"}]}</serializedPayload> </payload> </pageData> </pageResponse> </updatePageFlowResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
5. Loop through steps 3 and 4, making further updatePageFlow calls until a COMPLETED executionState is returned.
For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:updatePageFlow> <context> <processReference> <id>pvm:0a10s</id> </processReference> <activityReference activityId="pvm:001gs.7"/> </context> <pageFields payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":["Gerald"],"type":"S tring","mode":"INOUT"},{"$param":"SecondName","$value":["Fisher"],"type":"String ","mode":"INOUT"}]}</serializedPayload> </pageFields> <responsePayloadMode>JSON</responsePayloadMode> </pag:updatePageFlow> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updatePageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="COMPLETED" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305"/> <processReference> <id>pvm:0a10s</id> <name>GetName</name> </processReference> </context> <pageData> <payload payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":["Gerald"],"type":"S tring","mode":"INOUT"},{"$param":"SecondName","$value":["Fisher"],"type":"String ","mode":"INOUT"}]}</serializedPayload> </payload> </pageData> </pageResponse> </updatePageFlowResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
250
| Chapter 9
6. Call completeWorkItem to complete the pageflows parent work item. In the workRequest element, use payloadDetails to pass the final state of the pageflow data back to the work item. (If the pageflow was cancelled, call cancelPageFlow and then cancelWorkItem instead.) For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.wp.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:workRequest> <resourceId>A2DF6C05-AECA-4D59-A553-A7D029920D51</resourceId> <channelId>openspaceGWTPull_DefaultChannel</channelId> <channelType>openspaceChannel</channelType> <responsePayloadMode>JSON</responsePayloadMode> <workItem id="14" version="-1"></workItem> <payloadDetails payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"FirstName","$value":["Gerald"],"type":"S tring","mode":"INOUT"},{"$param":"SecondName","$value":["Fisher"],"type":"String ","mode":"INOUT"}]}</serializedPayload> </payloadDetails> </api:workRequest> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <workResponse isSuccessful="true" xmlns="http://api.wp.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
WorkPresentation Service
Client invokes Forms Runtime Adapter to display form for first page User clicks Submit or Cancel button. Forms Runtime Adapter notifies client of the users action and submits data 3
BusinessService Service
...if the user clicked Submit, repeat steps 3 and 4 until the business service has completed or is cancelled
The following step-by-step descriptions correspond to the numbered steps in the diagram. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP).
252
| Chapter 9
When a user starts a business service from the user interface: 1. Call startBusinessService to obtain the page data for the first page in the business service. Use the following items in the startBusinessService element to specify form-related inputs to the call: formalParams specifies any data that needs to be passed to the business service as formal parameters. You cannot determine which data fields are formal parameters programmatically. Instead, you must obtain this information directly from TIBCO Business Studio. responsePayloadMode specifies the format in which the page data should be returned. This must be JSON. When the startBusinessServiceResponse element is returned: executionState indicates if the business service contains further pages (IN_PROGRESS) or if this is the only page (COMPLETED). pageData.payload.serializedPayload contains the page data as a JSON payload For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:startBusinessService> <businessServiceDefinition moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="aphStartProc" version="1.0.0.201108111305"/> <responsePayloadMode>JSON</responsePayloadMode> </bus:startBusinessService> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <startBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="aphStartProc" version="1.0.0.201108111305"/> <processReference> <id>pvm:0a1012</id> <name>aphStartProc</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g12.3" activityModelId="_9IfurcQDEeC3yLAVrheurQ" activityName="UserTask" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" moduleVersion="1.0.0.201108111305" processName="aphStartProc"/> <payload payloadMode="JSON"> <serializedPayload>{"items":[{"$param":"UserName","$value":[],"type":"String","m ode":"INOUT"},{"$param":"PhoneNumber","$value":[],"type":"String","mode":"INOUT" }]}</serializedPayload> </payload> </pageData> </pageResponse> </startBusinessServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. Call getBusinessServiceDetailsByModule to get the details of the forms used by the page activity in the business service. The page-activity.page-reference element in the businessServiceDetailsResponse identifies the JSON form artifact to be used to display the page data for each page in the business service. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.wp.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:businessServiceDetailsRequest> <moduleName>/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl</moduleName> <processName>aphStartProc</processName> </api:businessServiceDetailsRequest> </soapenv:Body> </soapenv:Envelope>
254
| Chapter 9
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <businessServiceDetailsResponse id="_86Cb0MQDEeC3yLAVrheurQ" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" moduleVersion="1.0.0.201108111305" name="aphStartProc" url="APH_WelcomeUsersImplementSolution/.bpm/.processOut/pageflow/aph_test.xpdl/a phStartProc.bpel" xmlns="http://api.wp.n2.tibco.com"> <page-activity id="_9IfurcQDEeC3yLAVrheurQ" name="UserTask" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="UserTask.gwt.json" version="1.0.0.201108111305"> <relative-path>1.0.0.201108111305/openspaceGWTPull_DefaultChannel/.default/aphMy Package/aphStartProc/UserTask</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> </businessServiceDetailsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Pass the page data and form details to the Forms Runtime Adapter, which renders the form and handles the users interaction with it. (See Rendering a TIBCO Business Studio Form.) When the user submits or cancels the form, the Forms Runtime Adapter notifies the client application that this has happened and returns the data from the form. 4. If the executionState returned by startBusinessService was IN_PROGRESS, call updateBusinessService to a) update the business service with any data added or changed by the user and b) open the next page in the business service. Use the following items in the updateBusinessService element to specify form-related inputs to the call: context.processReference.id specifies the business service (pageflow) process instance that is to be updated. This value can be obtained from the previous startBusinessServiceResponse element. context.activityReference.activityId specifies the business service activity that is to be updated. This value can be obtained from the pageData.pageReference.activityId item in the previous startBusinessServiceResponse element. pageFields contains the page data that is to be updated, as returned by the form. responsePayloadMode specifies the format in which the page data should be returned for the next page. This must be JSON.
When the updateBusinessServiceResponse element is returned: executionState indicates if the business service contains further pages (IN_PROGRESS) or if this is the last page (COMPLETED). pageData.payload.serializedPayload contains the page data for the next page as a JSON payload. 5. Loop through steps 3 and 4, making further updateBusinessService calls until a COMPLETED executionState is returned. For example:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:updateBusinessService> <context> <processReference> <id>pvm:0a10t</id> </processReference> <activityReference activityId="pvm:001gt.3"/> </context> <responsePayloadMode>JSON</responsePayloadMode> </bus:updateBusinessService> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updateBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="COMPLETED" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="aphStartProc" version="1.0.0.201108111305"/> <processReference> <id>pvm:0a10t</id> <name>aphStartProc</name> </processReference> </context> <pageData> <payload payloadMode="JSON"> <serializedPayload>{"items":[]}</serializedPayload> </payload> </pageData> </pageResponse> </updateBusinessServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
256
| Chapter 9
Presentation Details
You should use the WorkPresentationService, PageFlowService and BusinessService APIs to display forms for work items and pageflow/business service page activities, but: ignore all elements concerned with presentation channel artifacts, as these can only be used to display TIBCO Business Studio forms. you cannot use the presentation details returned by openWorkItem when Displaying a Work Item Form or Displaying a Form in a Pageflow. you do not need to call getBusinessServiceDetailsByModule when Displaying a Form in a Business Service (as this will simply return presentation data that you cannot use).
Note any formal parameters required by business processes or pageflow processes. When you start or inject data into a pageflow process or business service that requires formal parameters, you must specify the data for those formal parameters. (See the following element definitions: startPageFlow, injectPageFlowEvent, startBusinessService, injectBusinessServiceEvent.)
258
| Chapter 9
| 259
Chapter 10
This chapter describes the web service operations that allow you to carry out the functions listed in the topics below.
Topics
Starting a Business Service, page 260 Displaying a Form in a Business Service, page 269 Injecting a Business Service Event, page 270
260
| Chapter 10
Business Service
Business Service
startBusinessService (moduleName, processName, and version) [executionState, process ID, activity ID, and the payload] getBusinessService DetailsByModule (moduleName, processName, and moduleVersion) [form details such as PageReference, FormIDentifier]
Business Service
WorkPresentation Service
Displays Form to user, if any User enters values in the Form fields and clicks Submit
updateBusinessService (process ID, activity ID, payload ) [executionState, process ID, activity ID, and the payload]
Business Service
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Starting a Business Service Service Connector API Example (Java) on page 266.) 1. When you login to a client, for example TIBCO Openspace, listCategories is called and all the available categories are listed in the Business Services tab. 2. When the user clicks on a category, queryBusinessServices is called and all the business services under the selected category are displayed. The response contains the details of all the business services under the selected category.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:queryBusinessServices> <category>PageflowSolution/ProcessPackage</category> </bus:queryBusinessServices> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryBusinessServicesResponse xmlns="http://business.api.busserv.n2.tibco.com"> <businessServiceTemplate hasFormalParameters="false" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516" xmlns=""/> </queryBusinessServicesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. Selecting a business service displays the details of that business service on the client, which are obtained from the response message of the queryBusinessServices call. 4. When the user clicks the button to start a new instance of business service, it calls the startBusinessService and passes the parameters module name, process name, and version number. The values for these parameters can be obtained by calling queryBusinessServices or listBusinessServices.
262
| Chapter 10
The response returns the execution state, process ID, activity ID, and the payload.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <Soapenv:Body> <bus:startBusinessService> <businessServiceDefinition moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516"/> <responsePayloadMode>XML</responsePayloadMode> </bus:startBusinessService> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <startBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516"/> <processReference> <id>pvm:0a101v</id> <name>RequestCall</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1v.3" activityModelId="_qTxqOlnREd-qRKl4nKSPqA" activityName="CollectData" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" moduleVersion="1.0.0.201108111516" processName="RequestCall"/> <payload payloadMode="XML"> <XmlPayload> <inouts array="false" name="UserName" optional="true" type="String"> <simpleSpec/> </inouts> <inouts array="false" name="PhoneNumber" optional="true" type="String"> <simpleSpec/> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </startBusinessServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
5. If the business service has a form associated with it, the operation getBusinessServiceDetailsByModule is called. The response contains the form details, which are then passed on to the Forms Adapter. 6. The Forms Adapter parses the data and displays an appropriate Form to the end user. Similarly, any input provided in the form is processed by the Form Adapter and handed back to the servlet.
264
| Chapter 10
For details about how the data is passed to and received from the Forms Adapter, see Working With Forms. See TIBCO Business Studio Forms Users Guide for details about the TIBCO Forms APIs. 7. Once the user enters values in the Forms fields and clicks submit, updateBusinessService is called with the payload containing the values entered by the and user. Repeat steps 5 and 6 until the business service completes or is cancelled. The response returns the execution state, process ID, activity ID, and the payload. If the business service is complete, the execution state is COMPLETED.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:updateBusinessService> <context> <processReference> <id>pvm:0a101v</id> </processReference> <activityReference activityId="pvm:001g1v.3"/> </context> <pageFields payloadMode="XML"> <XmlPayload> <inouts array="false" name="UserName" optional="true" type="String"> <simpleSpec> <value>TIB_USER1</value> </simpleSpec> </inouts> <inouts array="false" name="PhoneNumber" optional="true" type="String"> <simpleSpec> <value>987654321</value> </simpleSpec> </inouts> </XmlPayload> </pageFields> <responsePayloadMode>XML</responsePayloadMode> </bus:updateBusinessService> </soapenv:Body> </soapenv:Envelope>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updateBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="COMPLETED" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516"/> <processReference> <id>pvm:0a101v</id> <name>RequestCall</name> </processReference> </context> <pageData> <payload payloadMode="XML"> <XmlPayload xmlns:bus="http://business.api.busserv.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <inouts array="false" name="UserName" optional="true" type="String"> <simpleSpec> <value>TIB_USER1</value> </simpleSpec> </inouts> <inouts array="false" name="PhoneNumber" optional="true" type="String"> <simpleSpec> <value>987654321</value> </simpleSpec> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </updateBusinessServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
266
| Chapter 10
Starting a Business Service Service Connector API Example (Java) The following example code illustrates starting a business service using the method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration Starting a Business Service on page 260.
private void startBusinessServiceExample() { try { // Get all the business service categories that are available ListCategoriesResponse categories = serviceConnectorInstance.getBusinessService().listCategories( Long.valueOf(0), Long.valueOf(0), true, null, true, null); // Step 1: For this example we will pick the first category if (categories.getCategoryArray() != null && categories.getCategoryArray().length > 0) { // Query the business services for a particular category ( and all child categories by adding "/**" ) QueryBusinessServicesResponse response = serviceConnectorInstance.getBusinessService() .queryBusinessServices(categories.getCategoryArray(0).getName() + "/**", null, true); if (response.getBusinessServiceTemplateArray() != null && response.getBusinessServiceTemplateArray().length > 0) { // Get the first business service for the category BusinessServiceTemplate template = response.getBusinessServiceTemplateArray(0); // Step 2: Start the first business service StartBusinessServiceResponse startResponse = serviceConnectorInstance.getBusinessService() .startBusinessService(template, null, PayloadModeType.XML, Long.valueOf(0)); // Now we would use the forms API to open the Business Service and allow users to enter data // After form processing is complete update the business service with the new data // Build up a request context for the update call RequestContext requestContext = RequestContext.Factory.newInstance(); // We need a Process Reference for the context ProcessReference ref = ProcessReference.Factory.newInstance();
ref.setId(startResponse.getPageResponse().getContext().getProcessR eference().getId()); // We also need an Activity Reference for the context // For this example we will update the first activity in the business service ActivityReference actRef = ActivityReference.Factory.newInstance(); actRef.setActivityId(startResponse.getPageResponse().getPageDataAr ray(0).getPageReference() .getActivityId()); actRef.setActivityModelId(startResponse.getPageResponse().getPageD ataArray(0).getPageReference() .getActivityModelId()); actRef.setActivityName(startResponse.getPageResponse().getPageData Array(0).getPageReference() .getActivityName()); actRef.setModuleName(startResponse.getPageResponse().getPageDataAr ray(0).getPageReference() .getModuleName()); actRef.setModuleVersion(startResponse.getPageResponse().getPageDat aArray(0).getPageReference() .getModuleVersion()); actRef.setProcessName(startResponse.getPageResponse().getPageDataA rray(0).getPageReference() .getProcessName()); // update the request context with the Process Reference and Activity Reference requestContext.setProcessReference(ref); requestContext.setActivityReference(actRef); // setup the data payload with the new business service data, normally we would get this back when the form is closed or submitted DataPayload payload = DataPayload.Factory.newInstance(); payload.setPayloadMode(PayloadModeType.JSON); payload.setSerializedPayload(""); // Step 3: Update the business service UpdateBusinessServiceResponse updateResponse = this.serviceConnectorInstance.getBusinessService() .updateBusinessService(requestContext, null, PayloadModeType.XML); print(updateResponse); } } } catch (com.tibco.n2.busserv.services.InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace();
268
| Chapter 10
} catch (com.tibco.n2.busserv.services.InvalidArgumentFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (com.tibco.n2.busserv.services.PageFlowExecutionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
270
| Chapter 10
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP). (For an equivalent example using the Service Connector API (Java), see Injecting a Business Service Event Service Connector API Example (Java) on page 275.) 1. Find out the list of deployed business services by calling the listBusinessServices operation. This operation returns the module version
2. You can choose to start one of the business services returned in Step 1. Call the startBusinessService operation and specify the parameters module name and process name to start the selected business service. This operation returns the
272
| Chapter 10
instance ID which is required for the next step, injecting a business service event.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:startBusinessService> <businessServiceDefinition moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" version="1.0.0.201108161235"/> <responsePayloadMode>XML</responsePayloadMode> </bus:startBusinessService> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <startBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" version="1.0.0.201108161235"/> <processReference> <id>pvm:0a1022</id> <name>EventHandlerProcess</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g22.8" activityModelId="_NeC_EL0REeCCNPLAO2IuzQ" activityName="UserTask" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" moduleVersion="1.0.0.201108161235" processName="EventHandlerProcess"/> <payload payloadMode="XML"> <XmlPayload> <inouts array="false" name="Field" optional="true" type="String"> <simpleSpec/> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </startBusinessServiceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. While the business service is running, you can inject a business service event using the injectBusinessServiceEvent operation. The request message requires you to provide the following parameters: moduleName, processName, eventName, processInstanceId (optional), formal parameters, payload, and optionally, the responsePayloadMode. This operation updates the value of the specified parameter(s) with the value(s) injected by the intermediate event.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bus="http://business.api.busserv.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <bus:injectBusinessServiceEvent> <eventDefinition moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" eventName="ReceiveINOUT" processInstanceId="pvm:0a1022"/> <formalParams payloadMode="XML"> <XmlPayload> <inouts array="false" name="Parameter9" optional="false" type="String"> <simpleSpec length="50"> <value>TIBCO Software</value> </simpleSpec> </inouts> </XmlPayload> </formalParams> <responsePayloadMode>XML</responsePayloadMode> </bus:injectBusinessServiceEvent> </soapenv:Body> </soapenv:Envelope>
274
| Chapter 10
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <injectBusinessServiceEventResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" version="1.0.0.201108161235"/> <processReference> <id>pvm:0a1022</id> <name>EventHandlerProcess</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g22.d" activityModelId="_agO3UL6jEeCKPY5rB9JBjQ" activityName="UserTask5" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" moduleVersion="1.0.0.201108161235" processName="EventHandlerProcess"/> <payload payloadMode="XML"> <XmlPayload> <inouts array="false" name="Parameter9" optional="true" type="String"> <simpleSpec> <value>[Ljava.lang.String;@73e1829d</value> </simpleSpec> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </injectBusinessServiceEventResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Injecting a Business Service Event Service Connector API Example (Java) The following example code illustrates creating an LDAP container using method calls available in the Service Connector API. The step numbers in the comments correspond to the steps in the illustration Injecting a Business Service Event on page 270. private void injectBusinessServiceEventExample()
{ try { // Step 1: List the available business services ListBusinessServicesResponse businessServicesList = serviceConnectorInstance.getBusinessService() .listBusinessServices(Long.valueOf(0), Long.valueOf(0), true, null, true, null); print(businessServicesList); // Step 2: Start the business service // First we setup a BusinessServiceTemplate with details of the service to start // Normally these would be retrieved by parsing the businessServicesList returned from the listBusinessServices call, // in this example we are hard-coding the value BusinessServiceTemplate template = BusinessServiceTemplate.Factory.newInstance(); template.setModuleName("/TestBS/Process Packages/ProcessPackage.xpdl"); template.setProcessName("CatchEventBS"); template.setVersion("1.0.0.201108111511"); // Start the service StartBusinessServiceResponse startResponse = serviceConnectorInstance.getBusinessService() .startBusinessService(template, null, PayloadModeType.XML, Long.valueOf(0)); // Step 3: Inject the event // First we setup an event containing the business service details and the name of the event EventDefinitionType event = EventDefinitionType.Factory.newInstance(); // Details of business service event.setModuleName(template.getModuleName()); event.setProcessName(template.getProcessName()); // Name of the event event.setEventName("IntermediateEvent");
276
| Chapter 10
// The ID of the service we just started event.setProcessInstanceId(startResponse.getPageResponse().getCont ext().getProcessReference().getId()); // Now we need to setup the data to inject into the event the data is contained in a DataPayload DataPayload payload = DataPayload.Factory.newInstance(); payload.setPayloadMode(PayloadModeType.XML); // The DataModel contains FieldType values for each parameter we are passing DataModel model = DataModel.Factory.newInstance(); // Add a new In/Out field type and set its name, the parameter name is defined in the service in Business Studio FieldType field = model.addNewInouts(); field.setName("Parameter"); // For the field we must set the simple value, in this case it is a simple field type SimpleSpec simpleSpec = field.addNewSimpleSpec(); XmlString value = simpleSpec.addNewValue(); value.setStringValue("Example Value"); // Add the DataModel to the DataPayload payload.setXmlPayload(model); // Now we inject the event passing the event details, the data payload and the respose feed type InjectBusinessServiceEventResponse injectResponse = serviceConnectorInstance.getBusinessService() .injectBusinessServiceEvent(event, payload, PayloadModeType.XML); } catch (InternalServiceFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (InvalidArgumentFault e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (PageFlowExecutionFault e) { // TODO Auto-generated catch block e.printStackTrace(); } }
| 277
Chapter 11
This chapter describes the web service operations that allow you to carry out the functions listed in the topics below.
Topics
Starting and Processing a Pageflow, page 278 Injecting a Pageflow Event, page 279
278
| Chapter 11
PageFlowEngine Service
startPageFlow 2 startPageFlowResponse Returns the process ID, activity ID, and the payload along with the execution status injectPageFlowEvent 3 injectPageFlowEventResponse Returns the complete details of the injected pageflow instance
The following step-by-step descriptions correspond to the numbered steps in the illustration above. Note that the descriptions are from a web service operation point of view, and provide an example of performing the operations using the web service API (SOAP).
280
| Chapter 11
1. Find out the list of deployed pageflows by calling the listPageFlows operation. This operation returns the module version number, which is required as an input when calling the startPageFlow operation.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:listPageFlows startPosition="0" numberOfItems="10" getTotalCount="true"> <includeFormalParameters>true</includeFormalParameters> </pag:listPageFlows> </soapenv:Body> </soapenv:Envelope> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listPageFlowsResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">3</totalItems> <pageFlowTemplate hasFormalParameters="true" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestAdditionalDataPageflow" version="1.0.0.201108111516" xmlns=""/> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305" xmlns=""/> <pageFlowTemplate hasFormalParameters="true" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108161050" xmlns=""/> </listPageFlowsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
2. You can choose to start one of the pageflows returned in Step 1. Call the startPageFlow operation and specify the parameters module name and
process name to start the selected pageflow. This operation returns the instance ID, which is required for the next step, injecting a pageflow event.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:startPageFlow> <pageFlowDefinition moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108161050"/> <formalParams payloadMode="XML"> <XmlPayload> <inputs name="Names" type="Text" optional="true" array="false"> <simpleSpec length="50"> <value>TIBCO</value> </simpleSpec> </inputs> </XmlPayload> </formalParams> <responsePayloadMode>XML</responsePayloadMode> </pag:startPageFlow> </soapenv:Body> </soapenv:Envelope>
282
| Chapter 11
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <startPageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108161050"/> <processReference> <id>pvm:0a101f</id> <name>ProcessPackageProcess</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1f.5" activityModelId="_VK4SIKh8EeCt2PSB39ZXYA" activityName="UserTasks" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" moduleVersion="1.0.0.201108161050" processName="ProcessPackageProcess"/> <payload payloadMode="XML"> <XmlPayload/> </payload> </pageData> </pageResponse> </startPageFlowResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
3. While the pageflow is running, you can inject a pageflow event using the injectPageFlowEvent operation. The request message requires you to provide the following parameters: moduleName, processName, eventName, processInstanceId (optional), formal parameters, payload, and optionally,
the responsePayloadMode. This operation updates the value of the specified parameter(s) with the value(s) injected by the intermediate event.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pag="http://pageflow.api.pfe.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <pag:injectPageFlowEvent> <eventDefinition moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess2" eventName="IntermediateEvent" processInstanceId="pvm:0a101u"/> <formalParams payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="false" type="String"> <simpleSpec length="50"> <!--Zero or more repetitions:--> <value>TIBX</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="false" type="Integer Number"> <simpleSpec length="9"> <!--Zero or more repetitions:--> <value>147</value> </simpleSpec> </inputs> </XmlPayload> </formalParams> </pag:injectPageFlowEvent> </soapenv:Body> </soapenv:Envelope>
284
| Chapter 11
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <injectPageFlowEventResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess2" version="1.0.0.201108161235"/> <processReference> <id>pvm:0a101u</id> <name>EventHandlerProcess2</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1u.9" activityModelId="_eMANL720EeC61dgFHyHHpQ" activityName="UserTask3" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" moduleVersion="1.0.0.201108161235" processName="EventHandlerProcess2"/> <payload payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="true" type="String"> <simpleSpec> <value>[Ljava.lang.String;@2818fe57</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="true" type="Integer Number"> <simpleSpec> <value>[Ljava.lang.String;@e21652</value> </simpleSpec> </inputs> <inouts array="false" name="Field" optional="true" type="String"> <simpleSpec/> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </injectPageFlowEventResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
| 285
Chapter 12
This chapter provides information about using the Event Collection Services API.
Topics
Executing a Query, page 286 Defining Query Filter Strings, page 289 Using Attributes in Query Filters, page 293 Example Queries, page 315 Event Measures, page 316
286
| Chapter 12
Executing a Query
Queries can be executed as either dynamic or registered queries: Dynamic query: A query object is passed in at execution time, where it is parsed and executed by Event Collector. This approach is recommended for queries which are either performed infrequently, or which change often when called, because the filter expression has to be parsed whenever the query is run. Registered query: A query object is defined and registered with Event Collector, at which point it is parsed and stored. Whenever the query is subsequently called, a reference is made to the passed query, which improves efficiency both in data transport and in parsing costs. This approach is recommended for queries which are performed repeatedly over a period of time, because the filter expression only needs to be parsed once, but can be run many times. The target option specified in a query (in the Query object) defines the Event Collector database table against which the query will execute, which in turn determines the type of information to be retrieved. See Using Attributes in Query Filters on page 293 for more information.
Dynamic Queries
The following diagram shows how to execute a dynamic query.
Client Application Query Object EventCollector QueryService
new()
1
setFilter()
executeGenericQuery(Query, QueryOptions)
The client application does the following: 1. It instantiates a query object, which defines the filter expression and the list of attributes that are to be returned.
2. It performs an executeGenericQuery operation, which returns the list of events matching the filter criteria. The requested attributes and values are returned for each event. The executeQuery operation has been deprecated and should no longer be used. Use the executeGenericQuery operation instead. The executeRegisteredQuery operation has been deprecated and should no longer be used. Use the executeRegisteredGenericQuery operation instead.
Registered Queries
The following diagram shows how to create and use a registered query.
Client Application
Query Object
EventCollector QueryService
new()
1
setFilter()
isQueryRegistered(QueryIdentifier)
2
registerQuery()
Loop
3
executeRegisteredGenericQuery (QueryIdentifier,QueryOptions)
unRegisterQuery(QueryIdentifier)
The client application does the following: 1. It instantiates a query object, which defines the filter expression and the list of attributes that are to be returned. 2. It uses isQueryRegistered to determine if the query is already registered, and if not, it calls the registerQuery operation to register the query, using the defined query object. Event Collector parses and stores the query for later use.
TIBCO ActiveMatrix BPM - BPM Developers Guide
288
| Chapter 12
3. It performs an executeRegisteredGenericQuery operation each time the query is needed. QueryOptions can be used to dynamically alter the query parameters without having to alter and re-register the query itself. (See Using Late-Bound Parameter Literals on page 291.) The operation returns the list of events matching the filter criteria. The requested attributes and values are returned for each event. The executeRegisteredQuery operation has been deprecated and should no longer be used. Use the executeRegisteredGenericQuery operation instead. The QueryIdentifier can identify the query using either its descriptive name (tag) or its GUID. Performance is improved when using GUID, so when calling a query many times it is recommended to look up the querys GUID using the lookupQueryByTag operation. 4. It performs an unRegisterQuery operation to remove the query when it is no longer needed. This removes the query from the Event Collector database table.
Correlated Events
When a query is executed with the executeGenericQuery operation, or registered with the registerQuery operation, the correlate parameter can be used to request that the query return not only the events that match the query, but also all correlated events. Correlated events are those in which the CorrelationId is the sameevents with the same CorrelationId are all part of the same service call. This ability to return correlated events allows you to see all events that have been triggered within a service call. Note, however, that this can cause a large amount of data to be returneduse it only when necessary.
All queries must be supplied on a single line. All non-quoted whitespace will be ignored.
Operands
The following table lists the supported operands. Operand Type Attribute name Syntax
name
Description The name of an attribute - see Using Attributes in Query Filters on page 293 for more information. A string literal to be used for comparison. See Using String Literals on page 290 for more information.
String literal
12345 TRUE
or FALSE
290
| Chapter 12
Syntax
YYYY-MM-DDThh:mm:ss.SSS
Description A date-time literal consisting of the relevant components. For ranges, a curly bracket indicates an exclusive value; a square bracket indicates an inclusive value. See Using DateTime Literals on page 290 for more information.
or for a range:
{|[YYYY-MM-DDThh:mm:ss.SSS, YYYY-MM-DDThh:mm:ss.SSS}!]
(query)
A sub query to be evaluated before the main query A value which will be late bound to the expression. See Using Late-Bound Parameter Literals on page 291 for more information
::name
Using String Literals A string literal can be used to match strings. The following wildcards can be used: ? matches any single character * matches any number of characters.
Wildcards can be escaped using the \ character. For example, the literal my\?text will match the string my?text. Escape characters can be escaped using \\ characters. For example, the literal my\\text will match the string my\text. Using DateTime Literals A DateTime literal allows creation of an arbitrary DateTime which will be matched against any DateTime format AttributeValue. To allow for greater variety of matching, the following DateTime variations can be used:
YYYY[timzone] YYYY-MM[timzone] YYYY-MM-DD[timzone] YYYY-MM-DDTHhh[timzone] YYYY-MM-DDTHhh:mm[timzone] YYYY-MM-DDTHhh:mm:ss[timzone] YYYY-MM-DDTHhh:mm:ss.SSS[timzone]
Timezones
timezone is optional, and can be specified as shown in the following table.
Syntax
Z +|-HH[:MM]
For example:
2010Z 2010-01-01T01:00+01:00 2010-01-01T01:00.000-04:30
Ranges When specifying a range, a curly bracket indicates an exclusive value; a square bracket indicates an inclusive value. Square and curly brackets can be mixed in the same range. For example: Range
[2010,2011]
Description Greater than or equal to 01/01/2010 and less than or equal to 31/12/2011 Greater than 31/12/2010 and less than 01/01/2011 Greater than 31/12/2010 and less than or equal to 31/12/2011
{2010,2011} {2010,2011]
Using Late-Bound Parameter Literals A late-bound parameter literal (::name operand) can be used to assign a late bound parameter to the expression. The name parameter must be provided as part of the parameter array in the QueryOptions element, which is passed as part of an executeGenericQueryRequest or executeRegisteredGenericQueryRequest message. Late-bound parameters are useful when repeatedly executing the same query many times with different values. Using executeRegisteredGenericQuery with late-bound parameters means that the filter will be parsed once, then executed many times with the different values.
292
| Chapter 12
Operators
The following table lists the supported operators. Symbol = <> >= <= < > AND OR NOT IN Description Equal To Not Equal To Greater than or equal to Less than or equal to Less than Greater than AND OR NOT IN Both operators must be booleans. Restrictions on use Both operators must be of the same type.
Where brackets are used, the contents must evaluate to a boolean; a bracketed operation will be used as a boolean from that point on in the expression.
294
| Chapter 12
Description/Notes Unique identifier of the process activity associated with the event from the activity instance (runtime identifier). Unique identifier of the process activity associated with the event from the model (design time identifier). Name of the process activity associated with the event. For example: gateway, StartEvent, ScriptTask, DBTask, gateway, Success, Failure.
Name of the application that generated the event. Unique identifier of the presentation channel associated with the event. Identifier of the component that generated the event. The contextID is used with the correlationID and parentContextID to determine the series of events that have occurred. The contextID is set to a new value for each new service call made in a chain of events - thus identifying the contents of a specific service call.
Attribute correlationId
Description/Notes CorrelationID of the event. The correlationID is used with the contextID and parentContextID to determine the series of events that have occurred. The correlationID will be set when a service request is received from an external source. It remains the same for the duration of that request (including any child service calls made).
creationTime entities
Timestamp that the event occurred. The offer set for the work item. This is the GUID, entity type, and model version, separated by the tab character. Multiple entities are separated by the newline character. Identifier of the organization model entity associated with the event.
entityId
296
| Chapter 12
Attribute
Description/Notes Type of the organization model entity associated with the event. This must be one of the following values: ORGANIZATION ORGANIZATIONAL_UNIT GROUP POSITION PRIVILEGE CAPABILITY RESOURCE LOCATION ORGANIZATION_TYPE ORGANIZATIONAL_UNIT_TYPE POSITION_TYPE LOCATION_TYPE ORGUNIT_RELATIONSHIP_TYPE POSITION_HELD ORGUNIT_RELATIONSHIP ORGUNIT_FEATURE POSITION_FEATURE PARAMETER_DESCRIPTOR
entityType
Address of the host on which the event occurred. Name of the host on which the event occurred. Primary key of the event. Unique identifier of the primary LDAP container resource associated with the event. Valid values for this attribute depend on the value of the messageCategory attribute - see Message Categories and Attribute Contents on page 307.
Attribute managedObjectName
Description/Notes Valid values for this attribute depend on the value of the messageCategory attribute - see Message Categories and Attribute Contents on page 307. Valid values for this attribute depend on the value of the messageCategory attribute - see Message Categories and Attribute Contents on page 307. Valid values for this attribute depend on the value of the messageCategory attribute - see Message Categories and Attribute Contents on page 307. Description of the event. Identifies the entity which was being operated on causing this event to be produced. See Message Categories and Attribute Contents on page 307. Identifier of the event. For example:
messageId='BX_INSTANCE_PROCESS*'
managedObjectType
managedObjectVersion
message messageCategory
messageId
Process package name of the deployed process associated with the event. Name of the node on which the event occurred. Identifier of the parent activity associated with the event. The parentContextID is used with the correlationID and contextID to determine the series of events that have occurred. The parentContextID is set to a new value each time an internal (to a component) service call is made, and is set to the context ID of the calling service, thus identifying the parent of this service call.
parentObjectId
Valid values for this attribute depend on the value of the messageCategory attribute - see Message Categories and Attribute Contents on page 307. Identifier of the parent process associated with the event. Unique identifier of the security principal associated with the event.
parentProcessInstanceId principalId
298
| Chapter 12
Attribute
Description/Notes Name of the security principal associated with the event. Priority of the event. This must be one of the following: LOW MEDIUM HIGH
principalName priority
Identifier of the previous activity (to the one associated with the event). Priority of the process instance associated with the event. XML document representing the push destination associated with the event. Target of a push destination. For example, a business attribute or email address. Identifier of the resource associated with the event. Name of the resource associated with the event. Severity of the event. This must be one of the following: TRACE DEBUG INFO SERVICE AUDIT WARN ERROR FATAL
Identifier of the sub-process associated with the event. Name of the sub-process associated with the event. Version of the sub-process associated with the event.
Description/Notes Identifier of the component that requested a system action check. (Typically this will be BRM.) Unique identifier of the requested system action. Scheduled end date of the work item associated with the event. Scheduled start date of the work item associated with the event.
300
| Chapter 12
Attribute ref
Description/Notes Unique identifier of the process template. It includes the process template name, module name, and module version. This is stored in the ec_proc_template table. Name of the process template. Timestamp (in date format) of the hour. Average time (in milliseconds) during this hour that a work item was being actioned. A work item is defined as being actioned between its firstOpenTime and its completionTime. Total time (in milliseconds) during this hour that work items were being actioned. A work item is defined as being actioned between its firstOpenTime and its completionTime. Average time (in milliseconds) during this hour that a work item was active. A work item is defined as being active between its firstOfferTime and its completionTime, disregarding any intermediate states. Total time (in milliseconds) during this hour that work items were active. A work item is defined as being active between its firstOfferTime and its completionTime, disregarding any intermediate states. Total number of work items that were allocated or opened during this hour. Total number of work items that were cancelled during this hour. Total number of work items that were completed during this hour. Total number of work items that were opened during this hour. Total number of work items that were offered during this hour. Total number of work items that were pended during this hour. Total number of work items that were suspended during this hour. Total number of work items that existed during this hour. Average time (in milliseconds) during this hour that a work item was waiting. A work item is defined as waiting between its firstOfferTime and its firstOpenTime.
wi_action_dur
wi_active_avg
wi_active_dur
Attribute wi_wait_dur
Description/Notes Total time (in milliseconds) during this hour that work items were waiting. A work item is defined as waiting between its firstOfferTime and its firstOpenTime. Average time (in milliseconds) during this hour that a work item was being worked on. A work item is defined as being worked on between its first and last (form submission) activities. Total time (in milliseconds) during this hour that work items were being worked on. A work item is defined as being worked on between its first and last (form submission) activities.
wi_work_time_avg
wi_work_time_dur
302
| Chapter 12
Attribute userGuid userId version
Description/Notes Guid of the resource associated with this process instance. Resource associated with this process instance. Version number of the parent process template.
activityInstanceId
Attribute orgEntNames orgEntTypes orgEntVers processInstance processTemplate processTemplateId ref scheduleEnd scheduleStart statusChanged userGuid userId waitDuration wistatus workingTimeDuration
Description/Notes The comma-separated list of the organizational entity names to which this work item was offered. The comma-separated list of the organizational entity types to which this work item was offered. The comma-separated list of the organizational entity versions to which this work item was offered. Identifier of the parent process instance from which this work item was generated. Identifier (name) of the process template from which the parent process instance was generated. The reference to the process template, module name, and module version, referenced in the ec_proc_template table. Unique identifier of this work item. Scheduled end date/time (in UTC) for this work item. Scheduled start date/time (in UTC) for this work item. Time that the status of this work item was last changed. Guid of the resource associated with this work item. Resource associated with this work item. Total duration (in milliseconds) that this work item was waiting - that is, the time between its firstOfferTime and its firstOpenTime. Status of this work item. Total working time duration (in milliseconds) for this work item i.e. the cumulative time for between first and last (form submission) activities.
304
| Chapter 12
Description/Notes Description of this component. Primary key of this component. Identifier of the parent component. Unique identifier of this component. For example, BRM or DE. Deployed plugin revision number of this component. Deployed plugin version number of this component.
306
| Chapter 12
Description/Notes The user action for this work item. GUID of the resource associated with this work item. Resource associated with this work item. Status of the work item.
CHANNEL Attribute Name managedObjectId managedObjectName managedObjectVersion parentObjectId Contents Channel ID Channel name Channel version Name of the Distributed Application Archive (DAA) that contains this channel.
308
| Chapter 12
LDAP_CONTAINER Attribute Name managedObjectId managedObjectName Contents LDAP container ID LDAP container name
ORG_MODEL Attribute Name managedObjectId managedObjectName managedObjectVersion Contents Organization model ID Organization model name Organization model version number (in format major.minor.micro). -1 defines the latest version of the organization model.
ORGANIZATIONAL_ENTITY Attribute Name managedObjectId managedObjectName Contents Organization model entity GUID Organization model entity name
Contents Number indicating the type of the organization model entity. This must be one of the following: 1. ORGANIZATION 2. ORGANIZATIONAL_UNIT 3. GROUP 4. POSITION 5. PRIVILEGE 6. CAPABILITY 7. RESOURCE 8. LOCATION 9. ORGANIZATION_TYPE 10. ORGANIZATIONAL_UNIT_TYPE 11. POSITION_TYPE 12. LOCATION_TYPE 13. ORGUNIT_RELATIONSHIP_TYPE 14. POSITION_HELD 15. ORGUNIT_RELATIONSHIP 16. ORGUNIT_FEATURE 17. POSITION_FEATURE 18. PARAMETER_DESCRIPTOR
310
| Chapter 12
PROCESS_INSTANCE Attribute Name managedObjectId managedObjectName managedObjectVersion Contents ID of the process instance Name of the process template from which this process instance is generated Version of the process template from which this process instance is generated, in the format major.minor.micro.qualifier Type of the design-time process activity (only for BX_INSTANCE_TASKS* events). For example: StartEvent, exclusiveGateway or serviceTask parentObjectId applicationActivityName ID of the design-time process template Name of the design-time process activity (only for BX_INSTANCE_TASKS* events). For example: StartEvent, gateway or DBTask applicationActivityModelId applicationActivityInstanceId parentApplicationActivityId ID of the design-time process activity (only for BX_INSTANCE_TASKS* events) Run-time ID of the task (only for BX_INSTANCE_TASKS* events) Run-time ID of the tasks parent task (only for BX_INSTANCE_TASKS* events)
managedObjectType
The following attributes are not used for process instance lifecycle events such as BX_INSTANCE_PROCESS_STARTED or BX_INSTANCE_PROCESS_SUSPENDED: managedObjectType applicationActivityName applicationActivityModelId applicationActivityInstanceId parentApplicationActivityId
PROCESS_TEMPLATE Attribute Name managedObjectId managedObjectName managedObjectVersion Contents ID of the design-time process template Name of the design-time process template Version of the design-time process template, in the format major.minor.micro.qualifier
SCRIPT_TYPE Attribute Name managedObjectId managedObjectUrl Contents Script ID URL on registration failure
SECURITY Attribute Name managedObjectId managedObjectVersion Contents GUID of the organization model entity making the request Version number of the organization model in which the organization model entity resides. -1 means the latest organization model version.
312
| Chapter 12
WORK_GROUP Attribute Name managedObjectId managedObjectName managedObjectType Contents ID of work group Name of work group Type of work group
WORK_ITEM Attribute Name managedObjectId managedObjectVersion Contents ID of the work item Version number of the work item. The work item version is updated each time the work item is changed. parentObjectId workTypeId workTypeDesc workGroupId workGroupType workModelId ID of the process instance from which the work item is generated UID of the work type associated with the work item Description of the work type associated with the work item ID of the work group to which the work item belongs (if applicable) Type of the work group to which the work item belongs (if applicable) UID of the work model associated with the work item (if applicable)
Contents ID of the process template used to create the process instance from which the work item is generated Name of the process template used to create the process instance from which the work item is generated Runtime ID of the Task from which the work item was generated Name of the design-time process activity from which the work item was generated Name of the presentation channel associated with the work item ID of the presentation channel associated with the work item ID of the organization model entity associated with the work item Type of the organization model entity associated with the work item
applicationName
WORK_MODEL Attribute Name managedObjectId managedObjectName managedObjectDesc Contents Work model ID Work model name Work model description
314
| Chapter 12
Example Queries
The following table shows and describes some example queries. Query
((messageCategory='PROCESS_INSTANCE') AND (managedObjectId='pvm:0a121')) ((messageCategory='PROCESS_INSTANCE') AND (managedObjectId=::ProcID))
Returns all events referring to a process instance value that is defined by the ProcID late bound parameter literal. The executeGenericQueryRequest or executeRegisteredGenericQueryRequest message must include a value for ProcID as part of the QueryOptions element.
((messageCategory='WORK_ITEM') AND (parentObjectId='pvm:0a126')) ((messageCategory='PROCESS_INSTANCE') AND (managedObjectId='pvm:0a121') AND (messageId <> BX_INSTANCE_PROCESS_COMPLETED)) ((resourceName= Clint Hill) AND (messageCategory = WORK_ITEM)) (message = Start ??Service*)
Returns all events for work items generated by process instance pvm:0a126. Returns all events referring to process instance pvm:0a121 where the messageID is not
BX_INSTANCE_PROCESS_COMPLETED.0
Returns all events for work items associated with the resource (user) Clint Hill. Returns all events where the message attribute value is Start , followed by any two characters, followed by Service, followed by anything.
316
| Chapter 12
Event Measures
The EventCollectorMeasuresService is one of the Event Collection Services provided by Process Manager. This API provides a means of accessing statistical data for both processes and work items. The EventCollectorMeasuresService provides the following web service operations (SOAP) / Service Connector methods (Java): requestProcessDurationMeasure - This operation returns both counts and time measures for a given process. For example, it returns the total number of work items generated by a given process, within the specified time period. It also returns time measures, such as the amount of time a given process was active during the specified time period. For more detailed information about this operation, see requestProcessDurationMeasure on page 322. requestProcessTemplateMeasure - This operation returns the number of process instances, for the given process template, whose state changed to each of the available states (Started, Completed, etc.), during the specified time period. For more detailed information about this operation, see requestProcessTemplateMeasure on page 325. requestWorkItemPerformanceForTemplate - This operation returns the number of work items, generated by the given process, whose state changed to each of the available states (Offered, Allocated, etc.), during the specified time period. For more detailed information about this operation, see requestWorkItemPerformanceForTemplate on page 326.
Granularity - The period of time (hour, day, week, etc.) for which each piece of statistical data is returned (for example, number of process instances whose state was changed to "Suspended" during a particular month). Consolidation - Allows you to specify whether statistical data should be returned for each specified process, or consolidated, or both individually and consolidated.
These parameters are described in more detail in the following subsections. Process Template IDs Each event measure operation request identifies one or more process templates, for which statistical data is to be returned. These are specified in the <id> / <processTemplateName> elements:
Request: ... <id> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <id> <processTemplateName>HelpDeskProcess</processTemplateName> </id> ...
Start and End Date The start and end dates specify the total period of time for which statistical data is being returned. This period is then further subdivided into smaller periods according to the granularity specified for the operation (see Granularity on page 318). The start and end dates are specified in the <duration> / <endDate> and <startDate> elements:
Request: ... <duration> <endDate>2011-08-30T00:00:00.000Z</endDate> <startDate>2011-08-27T00:00:00.000Z</startDate> ...
318
| Chapter 12
Note that all statistical data is stored internally in one-hour blocks. Therefore, if the start and end dates specified in a request fall inside a one-hour block, they are always rounded to include the entire one-hour block, as follows: startDate is rounded down to the nearest hour boundary endDate is rounded up to the nearest hour boundary For example, if the following dates are specified:
<endDate>2011-08-25T08:23:55.829Z</endDate> <startDate>2011-08-25T10:45:12.000Z</startDate>
The operation response will include the measures (times or counts) stored in the one-hour blocks after the date/time is rounded. For example:
Granularity Granularity specifies the periods into which you want the larger time period, specified by the start and end dates, subdivided. The following are the granularity periods that can be specified: HOUR DAY WEEK MONTH YEAR
This example is specifying start and end dates that encompass three days, with a granularity of one day. This causes the response to include statistical data in three, one-day periods. For each granularity period, a <period> element is returned, which contains the event measures data (in the <entry> elements) for that particular time period:
Response: ... <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-08-27T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>19</value> <type>STARTED</type> </entry> ... </period> ...
In this example, three <period> elements are returned, each contained the event measures data for one day.
320
| Chapter 12
Also note that when the granularity period is specified as DAY, it means 24 hours, starting at the beginning of the hour block according to the start date (as described above), to the next day at the same time (that is, it is not from the beginning of the day to the end of the day). For example, if the startDate is 2011-08-27T07:00:00.000Z, a granularity of DAY means the granularity period is from 7:00 on Aug. 27 to 7:00 on Aug. 28. Consolidation Consolidation allows you to specify whether or not to consolidate the returned event measures data for each process template specified, as follows: NO_CONSOLIDATION - The event measures data for each specified process template is returned in a separate <measure> element. CONSOLIDATE - The event measures data for all specified process templates is consolidated in a single <measure> element. BOTH - The event measures data for each specified process template is returned in a separate <measure> element, plus it is also consolidated in a single <measure> element.
Note that this capability is most applicable when the request specifies multiple process templates. Consolidation is specified in the <options> / <consolidation> element. For example:
Request: ... <options> <consolidation>BOTH</consolidation> </options> ...
The following example shows the response from an event measure operation where consolidation is specified as BOTH:
Response: ... <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> ... </measure> <measure xmlns=""> <index>1</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>HelpDeskProcess</processTemplateName> </id> ... </measure> ... <measure xmlns=""> <index>-1</index> <isConsolidatedMeasure>true</isConsolidatedMeasure> ... </measure> ...
The <measure> elements for the individual process templates contain an index, starting at 0, as well as the name of the process template for which the event measure data inside the <measure> element applies. The <measure> element that contains the consolidated event measure data always has an index of -1, as well as a <isConsolidatedMeasure> element with a value of "true".
322
| Chapter 12
requestProcessDurationMeasure
This operation returns both count and time measures for: the process instances of the specified process templates, and the work items generated by the instances of the specified process templates.
Each count/time measure is returned inside of an <entry> element, inside of the <period> element that represents the granularity period (see Granularity on page 318). The following example shows that 15 instances of CSCallbackProcess were started during the first granularity period (index=0). Plus, the instances of CSCallbackProcess were active for a total of 2884367898 milliseconds during that same period.
Response: ... <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-08-01T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>15</value> <type>PROCESS_TOTAL</type> </entry> <entry> <index>1</index> <value>2884367898</value> <type>PROCESS_TOTAL_TIME</type> </entry> ...
The counts and times returned by the requestProcessDurationMeasure operation are defined in the following table: Type PROCESS_TOTAL Description Total number of instances of the process template started during the specified granularity period (note that this is a deltait is only the number that were started during the period). Total time (in milliseconds) that instances of the process template were active during the specified granularity period. Average time (in milliseconds) that instances of the process template were active during the specified granularity period. Total number of work items generated by the instances of the process template during the specified granularity period (note that this is a deltait is not the number that existed, but rather the number that were generated during the period). Total time (in milliseconds) that a work item generated by the process template was active during the specified granularity period. A work item is defined as being active between the time it first entered the OFFERED state, and the time it entered the COMPLETED state, disregarding any intermediate states. Average time (in milliseconds) that work items generated by the process template were active during the specified granularity period. A work item is defined as being active between the time it first entered the OFFERED state, and the time it entered the COMPLETED state, disregarding any intermediate states. Total time (in milliseconds) that work items generated by the process template were waiting during the specified granularity period. A work item is defined as waiting between the time it first entered the OFFERED state, and the time it first entered the OPENED state.
TIBCO ActiveMatrix BPM - BPM Developers Guide
PROCESS_TOTAL_TIME
PROCESS_AVERAGE_TIME
WORKITEM_TOTAL
WORKITEM_ACTIVE_TOTAL_TIME
WORKITEM_ACTIVE_AVERAGE_TIME
WORKITEM_WAIT_TOTAL_TIME
324
| Chapter 12
Type
Description Average time (in milliseconds) that a work item generated by the process template was waiting during the specified granularity period. A work item is defined as waiting between the time it first entered the OFFERED state, and the time it first entered the OPENED state. Total time (in milliseconds) that work items generated by the process template were being actioned during the specified granularity period. A work item is defined as being actioned between the time it first entered the OPENED state, and the time it entered the COMPLETED state (that is, when the user submitted the form). Average time (in milliseconds) that a work item generated by the process template during the specified granularity period. A work item is defined as being actioned between the time it first entered the OPENED state, and the time it entered the COMPLETED state (that is, when the user submitted the form). Total time (in milliseconds) that users spent processing work items generated by the process template during the specified granularity period. A work item is defined as being worked on between the accumulated time between when it entered the OPENED state, and the time it entered a PENDED, SUSPENDED, CANCELLED, or COMPLETED state. Average time (in milliseconds) that a work item generated by the process template was worked on by users during the specified granularity period. A work item is defined as being worked on between the accumulated time when it entered the OPENED state, and the time when it entered a PENDED, SUSPENDED, CANCELLED or COMPLETED state.
WORKITEM_WAIT_AVERAGE_TIME
WORKITEM_ACTION_TOTAL_TIME
WORKITEM_ACTION_AVERAGE_TIME
WORKITEM_WORKINGTIME_TOTAL_TIME
WORKITEM_WORKINGTIME_AVERAGE_TIME
requestProcessTemplateMeasure
This operation returns the number of process instances that changed to the following states, for the given process template, during the granularity period: STARTED COMPLETED SUSPENDED CANCELLED FAILED
Note that the counts returned by this operation are deltas, that is, it is the number that changed to each state during the period, not the number that were in that state during the period. Each state change count is returned inside of an <entry> element, inside of the <period> element that represents the granularity period (see Granularity on page 318). The following example response from a requestProcessTemplateMeasure operation shows that 15 instances of CSCallbackProcess were started, and 12 were completed, during the first granularity period (index=0):
Response: ... <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-08-27T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>15</value> <type>STARTED</type> </entry> <entry> <index>1</index> <value>12</value> <type>COMPLETED</type> </entry> ...
326
| Chapter 12
requestWorkItemPerformanceForTemplate
This operation returns the number of work items that changed to the following states, for the given process template, during the granularity period: OFFERED ALLOCATED PENDED COMPLETED SUSPENDED CANCELLED
Note that the counts returned by this operation are deltas, that is, it is the number that changed to each state during the period, not the number that were in that state during the period. Each state change count is returned inside of an <entry> element, inside of the <period> element that represents the granularity period (see Granularity on page 318).
The following example response from a requestWorkItemPerformanceForTemplate operation shows that 7 work items generated from instances of CSCallbackProcess were changed to an OFFERED state, and 5 were changed to an ALLOCATED state, during the first granularity period (index=0):
Response: ... <measure xmlns=""> <index>0</index> <id xsi:type="base:ProcessTemplateId" xmlns:api="http://api.ec.n2.tibco.com" xmlns:base="http://base.api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-08-27T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>7</value> <type>OFFERED</type> </entry> <entry> <index>1</index> <value>5</value> <type>ALLOCATED</type> </entry> ...
328
| Chapter 12
| 329
Chapter 13
This chapter summarizes the public services provided by TIBCO ActiveMatrix BPM, and provides links to: detailed documentation on the operations provided by a particular service, and the equivalent methods provided by the Java Service Connector API. WSDL and XSD documentation for a particular service API or schema.
You can download a zip file containing the complete TIBCO ActiveMatrix BPM web service API. The file contains all the WSDL and XSD files described in this chapter. Alternatively, you can generate a WSDL for a particular service from TIBCO ActiveMatrix Administrator. See TIBCO ActiveMatrix BPM APIs and How to Obtain Them for more information.
Topics
Business Services, page 330 Business Resource Management Services, page 331 Calendar Services, page 333 Directory Services, page 334 Event Collection Services, page 336 Pageflow Services, page 338 Process Services, page 339 Work Presentation Services, page 340
330
| Chapter 13
Business Services
Business services are provided by the Work Manager logical node (by the Pageflow Engine (PFE) component).
Services
The Business services API provides the following public service. Service BusinessService Description Get information about and interact with deployed business service templates and business service instances
API Files
The following table shows the API files that provide Business services. File busserv.wsdl pfe-business-service.xsd pfe-common.xsd channeltype.xsd datamodel.xsd presentationmodel.xsd pfe-exception.xsd comexception.xsd Description Business services API Pageflow services - BusinessService schema Pageflow services - common schema Work Presentation services - channel type schema Common data model schema Work Presentation services - presentation model schema Pageflow services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for pfe-business-service.xsd also includes the documentation for pfe-common.xsd.
Services
The Business Resource Management Services API provides the following public services. Service WorkItemManagementService WorkListService OrganisationalEntityConfigService Description Perform actions on work items. Get work item lists for organization model entities, and get/set sort/filter criteria for work item lists. Manage resource configuration attributes and get/set resource configuration attributes for individual resources.
API Files
The following table lists the API files that provide Business Resource Management services. File brm.wsdl brm.xsd Description Business Resource Management services API Business Resource Management services schema (WorkItemManagementService, WorkListService and OrganisationalEntityConfigService services) Business Resource Management services - data transfer object schema Business Resource Management services - work model schema Common data model schema Directory services - organization schema Business Resource Management services - script description schema Business Resource Management services - exception schema
332
| Chapter 13
File
Description Directory services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for brm.xsd also includes the documentation for brmdto.xsd. The Business Resource Management Services API also includes a number of private services which are intended only for internal use by TIBCO ActiveMatrix BPM. These services, which should not be used by an external application, are marked in the API with the following annotation: **PRIVATE API - Reserved for internal use** The private services WorkGroupManagementService, WorkItemSchedulerService and WorkModelBrowserService are visible in TIBCO ActiveMatrix Administrator. Do not generate and use WSDLs for these services.
deexception.xsd comexception.xsd
Calendar Services
Calendar services are provided by the Process Manager logical node (by the Date and Calendar (DAC) component).
Services
The Calendar services API provides the following public services. Service CalendarService BusinessDeadlineService Description Get information about and configure working time for a given organizational entity. Calculate the business deadline based on a given organizational entity's calendar.
API Files
The following table shows the API files that provide Calendar services. File dac.wsdl dac-calendar-service.xsd dac-deadline-service.xsd dac-common.xsd dac-exception.xsd comexception.xsd Description Calendar services API Calendar services - CalendarService schema Calendar services - BusinessDeadlineService schema Calendar services - common object schema Calendar services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for dac-calendar-service.xsd also includes the documentation for dac-common.xsd.
334
| Chapter 13
Directory Services
Directory services are provided by the Work Manager logical node (by the Directory Engine (DE) component).
Services
The Directory services API provides the following public services. Service EntityResolverService LDAPService BrowseModelService MappingService ContainerService AttributeService SecurityService Description Get information about resources and their association with specific organization model entities. Get information about and from LDAP sources. Get information about or from the organization model. Manage mappings between organization model resources and LDAP entities. Manage LDAP containers. Manage resource attributes, including push destinations for work items. Manage user authentication and authorization. Note: See System Actions on page 768 for more information about how to specify system actions when using these operations. UserSettingsService ExporterService ResourceQueryService Manage user settings. Export and import defined LDAP containers, resources and push destinations Execute a Resource Query Language (RQL) query to find a set of resources that match specific criteria.
API Files
The following table shows the API files that provide Directory services. File de.wsdl de-attribute-service.xsd de-browse-service.xsd de-container-service.xsd de-exporter-service.xsd de-ldap-service.xsd de-mapping-service.xsd de-resolver-service.xsd de-resourcequery-service.xsd de-security-service.xsd de-usersettings-service.xsd de.xsd de-ldap.xsd organisation.xsd channeltype.xsd deexception.xsd comexception.xsd Description Directory services API Directory services - AttributeService schema Directory services - BrowseModelService schema Directory services - ContainerService schema Directory services - ExporterService schema Directory services - LDAPService schema Directory services - MappingService schema Directory services - EntityResolverService schema Directory services - ResourceQueryService schema Directory services - SecurityService schema Directory services - UserSettingsService schema Directory services schema (all services) Directory services - LDAP schema Directory services - organization schema Work Presentation services - channel type schema Directory services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for de-attribute-service.xsd also includes the documentation for de.xsd.
336
| Chapter 13
Services
The Event Collection services API provides the following public services. Service EventCollectorQueryService EventCollectorMeasuresService Description Get information from the Event Collector database tables about events, attributes and components. Get measures stored by Event Collector.
API Files
The following table shows the API files that provide Event Collection service. File ec.wsdl ec.xsd ec-basetypes.xsd ecexception.xsd comexception.xsd Description Event Collection services API Event Collection services schema (EventCollectorQueryService and EventCollectorMeasuresService services) Event Collection services - type schema Event Collection services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for ec.xsd also includes the documentation for ec-basetypes.xsd.
The Event Collection Services API also includes some private service operations which are intended only for internal use by TIBCO ActiveMatrix BPM. These service operations, which should not be used by an external application, are marked in the API with the following annotation: **PRIVATE API - Reserved for internal use**
338
| Chapter 13
Pageflow Services
Pageflow services are provided by the Work Manager logical node (by the Pageflow Engine (PFE) component).
Services
The Pageflow services API provides the following public service. Service PageFlowService Description Get information about and interact with deployed pageflows.
API Files
The following table shows the API files that provide Pageflow services. File pflow.wsdl pfe-pageflow-service.xsd pfe-common.xsd channeltype.xsd datamodel.xsd presentationmodel.xsd pfe-exception.xsd comexception.xsd Description Pageflow services API Pageflow services - PageFlowService schema Pageflow services - common schema Work Presentation services - channel type schema Common data model schema Work Presentation services - presentation model schema Pageflow services - exception schema Common exception schema Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for pfe-pageflow-service.xsd also includes the documentation for pfe-common.xsd.
Process Services
Process services are provided by the Process Manager logical node (by the Process Manager (PM) component).
Services
The Process services API provides the following public service. Service ProcessManagerService Description Manage process templates and process instances.
API Files
The following table shows the API files that provide Process services. File processManagement.wsdl processManagement.xsd Description Process services API ProcessManagement service schema
The ProcesManagerService includes an operation, purgeProcessInstances, which is intended only for internal use by TIBCO ActiveMatrix BPM. This operation should not be used by an external application and is marked in the API with the following annotation: **PRIVATE API - Reserved for internal use** The ProcessManagement service appears as BxProcessManagementService in TIBCO ActiveMatrix Administrator.
340
| Chapter 13
Services
The Work Presentation services API provides the following public service. Service WorkPresentationService Description Get work presentation details for and perform actions on work items.
API Files
The following table shows the API files that provide Work Presentation services. File wp.wsdl wp.xsd wp-basetypes.xsd wpModel.xsd channeltype.xsd presentationmodel.xsd datamodel.xsd bs-basetypes.xsd wpexception.xsd comexception.xsd Description Work Presentation services API Work Presentation services schema (WorkPresentationService and ChannelBusService services) Work Presentation services - basic types schema Work Presentation services - model schema Work Presentation services - channel type schema Work Presentation services - presentation model schema Common data model schema Work Presentation services - TIBCO Business Studio basic types schema Work Presentation services - exception schema Common exception schema
Hyperlinks are provided to the WSDL and XSD documentation for a particular service API or schema. Any xsd files that do not have hyperlinks are included (directly or indirectly) in hyperlinked xsd files. For example, the XSD documentation for wp.xsd also includes the documentation for wp-basetypes.xsd.
342
| Chapter 13
AttributeService 343
Chapter 14
AttributeService
AttributeService is one of the Directory Services provided by Work Manager. Use AttributeService requests to manage resource attributes, including push destinations for work items.
Topics
listBusinessParameters, page 344 getBusinessParameters, page 347 setBusinessParameters, page 350 getPushDestinations, page 353 setPushDestinations, page 356
344
| Chapter 14
AttributeService
listBusinessParameters
List all parameter descriptors that describe resource attributes in a specific version of the organization model: The request must specify the major version of the organization model for which parameter descriptors describing resource attributes should be listed. The response returns all the parameter descriptors (in the specified version of the organization model) that describe resource attributes.
See also: Mapping Resource Attributes to LDAP Attributes on page 118. Required System Action readParameters
listBusinessParameters 345
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listBusinessParametersResponse xmlns="http://attribute.api.de.n2.tibco.com"> <param-desc default-value="" description="" guid="_looEEMpSEd64gM7QE8RwxA" model-version="3" name="CellPhone" type="String" xmlns=""/> <param-desc default-value="" description="" guid="_n2CW0MpSEd64gM7QE8RwxA" model-version="3" name="ClearanceExpiration" type="DateTime" xmlns=""/> <param-desc default-value="" description="" guid="_qr04MMpSEd64gM7QE8RwxA" model-version="3" name="DeskPhone" type="String" xmlns=""/> <param-desc default-value="" description="" guid="_sfdZAMpSEd64gM7QE8RwxA" model-version="3" name="DeveloperLevel" type="Enum" xmlns=""> <enum-val>Advanced</enum-val> <enum-val>Intermediate</enum-val> <enum-val>Beginner</enum-val> </param-desc> . . . </listBusinessParametersResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
346
| Chapter 14
AttributeService
getBusinessParameters 347
getBusinessParameters
List resource attribute values for a specific organization model entity: The request must specify the details of the organization model entity for which resource attribute values should be returned. The response returns the resource attribute values currently held by the specified organization model entity.
See also: Mapping Resource Attributes to LDAP Attributes on page 118. Required System Action readParameters
348
| Chapter 14
AttributeService
Returns a getBusinessParametersResponse element (from the AttributeService schema) For a resource attribute whose value is held locally: Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:att="http://attribute.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <att:getBusinessParameters model-version="-1" entity-type="RESOURCE" guid="7AAB6AE7-CA2E-4211-BBF8-E081659526FE" /> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getBusinessParametersResponse entity-type="RESOURCE" guid="7AAB6AE7-CA2E-4211-BBF8-E081659526FE" model-version="3" xmlns="http://attribute.api.de.n2.tibco.com"> <parameter desc-guid="_looEEMpSEd64gM7QE8RwxA" local="true" name="CellPhone" type="String" xmlns=""> <value>509-555-2323</value> </parameter> <parameter desc-guid="_7seVwMpSEd64gM7QE8RwxA" ldap-alias="easyAs" ldap-attribute="mail" ldap-dn="ou=Clint Hill, ou=Swindon, ou=AllEmployees" local="false" name="EmailAddress" type="String" xmlns=""> <value>chill@easyasinsurance.com</value> </parameter> </getBusinessParametersResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getBusinessParameters 349
350
| Chapter 14
AttributeService
setBusinessParameters
Set resource attribute values for a specific resource: The request must specify the organization model entity for whom resource attribute values are to be set, and the resource attribute values that are to be set. The response indicates whether the specified resource attribute values were successfully set for the specified organization model entity.
See also: Mapping Resource Attributes to LDAP Attributes on page 118. Required System Action writeParameters
setBusinessParameters 351
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <setBusinessParametersResponse xmlns="http://attribute.api.de.n2.tibco.com"> <successful xmlns="">true</successful> </setBusinessParametersResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
1. Attribute values for non-resource entities must be set via the organization model (using TIBCO Business Studio Organization Modeler).
352
| Chapter 14
AttributeService
getPushDestinations 353
getPushDestinations
List currently defined push destinations for one or more organization model entities: The request must specify the organization model entities for whom push destinations should be retrieved. The response returns the currently defined push destinations for each specified organization model entity.
354
| Chapter 14
AttributeService
Response
Returns a getPushDestinationsResponse element (from the AttributeService schema). If the push destination is obtained from a resource attribute (desc-guid was passed in the setPushDestinations operation), the value attribute in the response contains the value in the resource attribute.
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:att="http://attribute.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <att:getPushDestinations> <org-entity model-version="-1" entity-type="POSITION" guid="_6lTHwMpREd64gM7QE8RwxA" /> </att:getPushDestinations> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getPushDestinationsResponse xmlns="http://attribute.api.de.n2.tibco.com"> <org-entity entity-type="POSITION" guid="_6lTHwMpREd64gM7QE8RwxA" model-version="3" xmlns=""> <XmlPushDestination channel-id="EmailGIPush_USA" channel-type="EmailChannel" enabled="true" name="EmailGIPush_USA" xmlns="http://attribute.api.de.n2.tibco.com"> <value xmlns="">ITManager@megacorp.com</value> </XmlPushDestination> </org-entity> </getPushDestinationsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getPushDestinations 355
356
| Chapter 14
AttributeService
setPushDestinations
Set one or more push destinations for a specific organization model entity: The request must specify an organization model entity and one or more push destinations. The response indicates whether the specified push destinations were successfully set for the organization model entity.
setPushDestinations 357
Response
358
| Chapter 14
Example
AttributeService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:att="http://attribute.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <att:setPushDestinations model-version="-1" entity-type="POSITION" guid="_6lTHwMpREd64gM7QE8RwxA"> <att:XmlPushDestination channel-type="EmailChannel" channel-id="EmailGIPush_DefaultChannel" enabled="true"> <value>jMiller@megacorp.com</value> </att:XmlPushDestination> </att:setPushDestinations> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <setPushDestinationsResponse xmlns="http://attribute.api.de.n2.tibco.com"> <successful xmlns="">true</successful> </setPushDestinationsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
BrowseModelService 359
Chapter 15
BrowseModelService
BrowseModelService is one of the Directory Services provided by Work Manager. Use BrowseModelService requests to get information about or from the organization model.
Topics
listModelVersions, page 360 openOrgModel, page 362 browseModelNode, page 365 listOrgModelOverview, page 367 listCapabilities, page 370 listPrivileges, page 372 getCapabilities, page 374 getPrivileges, page 376 listOrganizations, page 378
360
| Chapter 15
BrowseModelService
listModelVersions
List all major versions (including the deployment artefacts the make up each major version) of the organization model: The request takes no parameters. The response returns a list of all major versions of the organization model.
listModelVersions 361
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listModelVersions> <dummy>false</dummy> </brow:listModelVersions> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listModelVersionsResponse xmlns="http://browse.api.de.n2.tibco.com"> <versions model-version="0" xmlns=""> <deployment deployed="2011-06-28T20:06:40.193Z" micro="0" minor="1" name="sys_org_model" qualifier=""/> </versions> <versions model-version="1" xmlns=""> <deployment deployed="2011-06-29T14:29:58.120Z" micro="0" minor="0" name="OrganizationModel" qualifier="201106290731"/> <deployment deployed="2011-06-29T15:30:30.220Z" micro="0" minor="0" name="OrganizationModel" qualifier="201106290831"/> </versions> <versions model-version="2" xmlns=""> <deployment deployed="2011-07-12T17:05:21.467Z" micro="0" minor="1" name="OrganizationModel" qualifier="201107121007"/> </versions> <versions model-version="3" xmlns=""> <deployment deployed="2011-06-28T20:25:32.017Z" micro="1" minor="5" name="AcmeOrganizationModel" qualifier="201105061158"/> </versions> </listModelVersionsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
major="0"
major="1"
major="1"
major="2"
major="3"
362
| Chapter 15
BrowseModelService
openOrgModel
Open a major version of the organization model: The request can specify the major version of the organization model that is to be opened. The response returns details of the root node(s) of the organization model tree. (The caller can then use repeated browseModelNode calls to iterate through the organization modelfor additional information, see Navigating Large Organizations on page 110.) Note that this operation only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Action browseModel
openOrgModel 363
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <openOrgModelResponse model-version="2" xmlns="http://browse.api.de.n2.tibco.com"> <root-node entity-type="ORGANIZATION" guid="_tf5fgSe3EeCoD7MklYZAuw" has-children="true" model-version="2" name="EasyAs" xmlns=""> <selection-mode method="ANY" plugin=""/> <child entity-type="ORGANIZATIONAL_UNIT" guid="_OAbNoCfHEeChutsy_vK9tg" has-children="true" model-version="2" name="ClaimsDepartment"> <selection-mode method="ANY" plugin=""/> </child> <child entity-type="ORGANIZATIONAL_UNIT" guid="_1HaTYCfLEeChutsy_vK9tg" has-children="true" model-version="2" name="TestDepartment"> <selection-mode method="ANY" plugin=""/> </child> </root-node> <root-node entity-type="GROUP" guid="_ZvVVsCfQEeChutsy_vK9tg" model-version="2" name="Managers" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> <root-node entity-type="GROUP" guid="_i1LeoCrrEeCEDr7D0P9b2w" model-version="2" name="CustomerServicesRepresentatives" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> </openOrgModelResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
364
| Chapter 15
BrowseModelService
browseModelNode 365
browseModelNode
Get details of a particular organization model entity and its children (for additional information about when this service operation would be used, see Navigating Large Organizations on page 110): The request must specify the organization model entity (node) for which details should be returned. The response returns details of the specified organization model entity and all of its immediate child entities. Note that this operation only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Action browseModel
366
| Chapter 15
Example
BrowseModelService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:browseModelNode model-version="-1" entity-type="ORGANIZATIONAL_UNIT" guid="_aT_UMCfLEeChutsy_vK9tg" qualifier=""/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <browseModelNodeResponse entity-type="ORGANIZATIONAL_UNIT" guid="_aT_UMCfLEeChutsy_vK9tg" has-children="true" model-version="2" name="HouseholdClaims" xmlns="http://browse.api.de.n2.tibco.com"> <selection-mode method="ANY" plugin="" xmlns=""/> <child entity-type="POSITION" guid="_aT_UMifLEeChutsy_vK9tg" ideal-number="10" model-version="2" name="CustomerServiceRepresentativeHousehold" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </child> <child entity-type="POSITION" guid="_aT_UMSfLEeChutsy_vK9tg" ideal-number="1" model-version="2" name="HouseholdClaimsManager" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </child> </browseModelNodeResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listOrgModelOverview 367
listOrgModelOverview
List details of every organization, organization unit, position, group and location defined in the organization model: The request can specify the major version of the organization model for which information should be returned. The response returns details of the organization, organization unit, position, group and location defined in the organization model. Note that this operation only includes those organizations (and sub-elements) to which the calling user has access (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Action browseModel
368
| Chapter 15
Example
BrowseModelService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listOrgModelOverview model-version="2"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listOrgModelOverviewResponse xmlns="http://browse.api.de.n2.tibco.com"> <root-node entity-type="ORGANIZATION" guid="_tf5fgSe3EeCoD7MklYZAuw" model-version="2" name="EasyAs" xmlns=""> <selection-mode method="ANY" plugin=""/> <child entity-type="ORGANIZATIONAL_UNIT" guid="_OAbNoCfHEeChutsy_vK9tg" model-version="2" name="ClaimsDepartment"> <selection-mode method="ANY" plugin=""/> <child entity-type="ORGANIZATIONAL_UNIT" guid="_aT_UMCfLEeChutsy_vK9tg" model-version="2" name="HouseholdClaims"> <selection-mode method="ANY" plugin=""/> . . . <child entity-type="POSITION" guid="_2CRZICfLEeChutsy_vK9tg" ideal-number="1" model-version="2" name="TestManager" resource-count="0"> <selection-mode method="ANY" plugin=""/> </child> </child> </root-node> <root-node entity-type="GROUP" guid="_ZvVVsCfQEeChutsy_vK9tg" model-version="2" name="Managers" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> <root-node entity-type="GROUP" guid="_i1LeoCrrEeCEDr7D0P9b2w" model-version="2" name="CustomerServicesRepresentatives" resource-count="0" xmlns=""> <selection-mode method="ANY" plugin=""/> </root-node> </listOrgModelOverviewResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listOrgModelOverview 369
370
| Chapter 15
BrowseModelService
listCapabilities
List all the capabilities defined in the organizational model: The request must specify the major version of the organization model for which capabilities should be listed. The response returns details of all capabilities defined for the specified organization model version.
listCapabilities 371
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listCapabilities model-version="2"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listCapabilitiesResponse xmlns="http://browse.api.de.n2.tibco.com"> <capability entity-type="CAPABILITY" guid="_FrCEcCfREeChutsy_vK9tg" model-version="2" name="Inhousemanagementtraining" xmlns=""/> <capability entity-type="CAPABILITY" guid="_JxFSkCrsEeCEDr7D0P9b2w" model-version="2" name="FrenchSpeaker" xmlns=""/> <capability entity-type="CAPABILITY" guid="_NlKBICrsEeCEDr7D0P9b2w" model-version="2" name="SignoffWork" xmlns=""/> </listCapabilitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
372
| Chapter 15
BrowseModelService
listPrivileges
List all the privileges defined in the organizational model: The request must specify the major version of the organization model for which privileges should be listed. The response returns details of all privileges defined for the specified organization model version.
listPrivileges 373
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listPrivileges model-version="2"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listPrivilegesResponse xmlns="http://browse.api.de.n2.tibco.com"> <privilege entity-type="PRIVILEGE" guid="_g7EMECheEeC2gpNnCloTog" model-version="2" name="AuthorizeClaims" xmlns=""> <qualifier-desc default-value="" description="" guid="_3o1kgCheEeC2gpNnCloTog" model-version="2" type="Integer"/> </privilege> </listPrivilegesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
374
| Chapter 15
BrowseModelService
getCapabilities
Get the capabilities associated with a specific organization model entity: The request must specify the organization model entity for which capabilities should be listed. The response returns details of all capabilities associated with the specified organization model entity.
getCapabilities 375
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:getCapabilities model-version="-1" guid="D4E3C720-5500-4651-B105-6C60C613E226"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getCapabilitiesResponse xmlns="http://browse.api.de.n2.tibco.com"> <capability entity-type="CAPABILITY" guid="_BJKvUMpQEd64gM7QE8RwxA" model-version="3" name="Degree" xmlns=""> <qualifierSet value="MBA"/> </capability> <capability entity-type="CAPABILITY" guid="_ax1rQMpTEd64gM7QE8RwxA" model-version="3" name="ManagementTrainingLevel" xmlns=""> <qualifierSet value="Senior"/> </capability> <capability entity-type="CAPABILITY" guid="_xI4ikMpPEd64gM7QE8RwxA" model-version="3" name="CanTravel" xmlns=""/> </getCapabilitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
376
| Chapter 15
BrowseModelService
getPrivileges
Get the privileges associated with a specific organization model entity: The request must specify the organization model entity for which privileges should be listed. The response returns details of all privileges associated with the specified organization model entity.
getPrivileges 377
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:getPrivileges model-version="-1" guid="_v2ro8MpREd64gM7QE8RwxA" /> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getPrivilegesResponse xmlns="http://browse.api.de.n2.tibco.com"> <privilege entity-type="PRIVILEGE" guid="_CTAasF-JEd-rno5lLiXABg" model-version="3" name="SuperviseSalesManagers" xmlns=""/> <privilege entity-type="PRIVILEGE" guid="_80Y14F-IEd-rno5lLiXABg" model-version="3" name="SuperviseITManagers" xmlns=""/> <privilege entity-type="PRIVILEGE" guid="_HIl0IF-KEd-rno5lLiXABg" model-version="3" name="SuperviseVPs" xmlns=""/> <privilege entity-type="PRIVILEGE" guid="_M1FR8MpSEd64gM7QE8RwxA" model-version="3" name="SuperviseCSManagers" xmlns=""/> </getPrivilegesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
378
| Chapter 15
BrowseModelService
listOrganizations
Get a list of all organizations that have been deployed: The request takes no parameters. The response returns a list of all organizations that have been deployed (that is, organization model entities with an entity-type of ORGANIZATION).
listOrganizations 379
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:brow="http://browse.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <brow:listOrganizations> <dummy>false</dummy> </brow:listOrganizations> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listOrganizationsResponse xmlns="http://browse.api.de.n2.tibco.com"> <Organizations entity-type="ORGANIZATION" guid="_iPYXscpPEd64gM7QE8RwxA" model-version="3" name="Acme" xmlns=""/> <Organizations entity-type="ORGANIZATION" guid="_5fLygDBSEd-x4cVy01Xlww" model-version="3" name="ReardenSteel" xmlns=""/> <Organizations entity-type="ORGANIZATION" guid="_-SS8MDBSEd-x4cVy01Xlww" model-version="3" name="TaggartTranscontinental" xmlns=""/> <Organizations entity-type="ORGANIZATION" guid="_jGi_kcxxEd-nOYM9N6WPrw" model-version="1" name="Organization1" xmlns=""/> <Organizations entity-type="ORGANIZATION" guid="_tf5fgSe3EeCoD7MklYZAuw" model-version="2" name="EasyAs" xmlns=""/> </listOrganizationsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
380
| Chapter 15
BrowseModelService
BusinessDeadlineService 381
Chapter 16
BusinessDeadlineService
BusinessDeadlineService is one of the Calendar Services provided by Work Manager. Use BusinessDeadlineService requests to calculate the deadline for completing a specified task, based on a given calendar. Note that all times passed are taken to be time-zone-neutral: that is, the API assumes that all times are in UTC format.
Topics
calcBusinessDeadline, page 382
382
| Chapter 16
BusinessDeadlineService
calcBusinessDeadline
Calculate the business deadline based on the working time for a given calendar. The request must specify the GUID of the calendar from which working day details are to be taken. This information about working time is used to calculate the deadline, along with the start and duration of the requested task. The calendarLookAhead property in the dac.properties file determines how far ahead in the calendar the calculation algorithm looks to take account of entries that would affect the duration of a task. See "Configuring TIBCO ActiveMatrix BPM Deadline and Calendar Properties" in the TIBCO ActiveMatrix BPM Administration guide for details of this property. The response returns the calculated end date based on the specified calendar's working time.
calcBusinessDeadline 383
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <calcBusinessDeadlineResponse end-date-time="2011-08-13T12:00:00.000Z" xmlns="http://deadline.api.dac.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
384
| Chapter 16
BusinessDeadlineService
BusinessService 385
Chapter 17
BusinessService
BusinessService is one of the Business Services provided by Work Manager. Use BusinessService operations to get information about and interact with deployed business services.
Topics
listCategories, page 386 queryCategories, page 389 listBusinessServices, page 391 queryBusinessServices, page 394 startBusinessService, page 396 updateBusinessService, page 399 injectBusinessServiceEvent, page 402 cancelBusinessService, page 407
386
| Chapter 17
BusinessService
listCategories
List categories of all deployed business services. The request requests a list of the categories of all deployed business services. If you specify the filter channelId, the request requests a list of categories for all deployed business services for the specified channel. The response returns the detailed descriptions of the categories of the deployed business services. The parameter includeFormalParameters determines whether the categories of deployed business services that have formal parameters are listed or not. See Parameter notes for details.
listCategories 387
Response Example
Response:
<SOAP-ENV:Body> <listCategoriesResponse xmlns="http://business.api.busserv.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">2</totalItems> <Category name="WelcomeCustomer" xmlns=""> <ChildCategory name="WCProcessPackage"/> </Category> <Category name="WelcomeUsersImplementSolution" xmlns=""> <ChildCategory name="ProcessPackage"/> </Category> </listCategoriesResponse> </SOAP-ENV:Body>
388
| Chapter 17
BusinessService
queryCategories 389
queryCategories
Query categories of all deployed business services. The request requests a list of all the deployed business services. Optionally, the request can specify a filter based on the Category and ChannelId. The response returns detailed descriptions of the categories of deployed business services.
390
| Chapter 17
BusinessService
Response Example
Response:
<SOAP-ENV:Body> <queryCategoriesResponse xmlns="http://business.api.busserv.n2.tibco.com"> <businessCategory name="Category1" xmlns=""> <ChildBusinessCategory name="SubCategory"> <BusinessServiceTemplate moduleName="/SanityProcesses/Sanity Tests/SanityTests.xpdl" processName="SanityTestsStartEvent" version="1.0.0.201107041448"/> </ChildBusinessCategory> </businessCategory> </queryCategoriesResponse> </SOAP-ENV:Body>
listBusinessServices 391
listBusinessServices
Lists all the deployed business services. The request requests a list of all the deployed business services. Optionally, the request can specify a filter based on the ChannelId. The response returns detailed descriptions of all the deployed business services. The parameter includeFormalParameters determines whether deployed business services that have formal parameters are listed or not. See Parameter notes for details. If the parameter includeFormalParameters is not specified, only the deployed business services that do not have formal parameters are listed.
392
| Chapter 17
BusinessService
Response Example
Response:
<SOAP-ENV:Body> <listBusinessServicesResponse xmlns="http://business.api.busserv.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">2</totalItems> <businessCategory name="Category1" xmlns=""> <ChildBusinessCategory name="SubCategory"> <BusinessServiceTemplate moduleName="/SanityProcesses/Sanity Tests/SanityTests.xpdl" processName="SanityTestsStartEvent" version="1.0.0.201107041448"/> </ChildBusinessCategory> </businessCategory> <businessCategory name="InjectBS" xmlns=""> <ChildBusinessCategory name="InjectBS"> <BusinessServiceTemplate moduleName="/InjectBS/Process Packages/InjectBS.xpdl" processName="ProcessPackageStartEvent" version="1.0.0.201107121100"/> </ChildBusinessCategory> </businessCategory> </listBusinessServicesResponse> </SOAP-ENV:Body>
listBusinessServices 393
394
| Chapter 17
BusinessService
queryBusinessServices
Queries all the deployed business services. The request requests a list of all the deployed business services for a specified category. Optionally, the request can specify a filter based on the channelId. The response returns detailed descriptions of all the deployed business services for the specified. If a filter is specified, the response contains the list of deployed business services that fulfil the order filter criteria.
queryBusinessServices 395
Response Example
Response:
<SOAP-ENV:Body> <queryBusinessServicesResponse xmlns="http://business.api.busserv.n2.tibco.com"> <businessServiceTemplate moduleName="/WelcomeCustomer/Process Packages/WCProcessPackage.xpdl" processName="WCRequestCall" version="1.0.0.201107201543" xmlns=""/> <businessServiceTemplate moduleName="/WelcomeUsersImplementSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201107281325" xmlns=""/> </queryBusinessServicesResponse> </SOAP-ENV:Body>
396
| Chapter 17
BusinessService
startBusinessService
Starts an instance of a deployed business service. The request identifies the business service of which you want to start an instance. You can optionally specify the payload mode and provide the payload in the request message. The response returns the complete information about the started business service instance and the execution state is set to IN_PROGRESS.
startBusinessService 397
398
| Chapter 17
BusinessService
Response:
<SOAP-ENV:Body> <startBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516"/> <processReference> <id>pvm:0a101o</id> <name>RequestCall</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1o.3" activityModelId="_qTxqOlnREd-qRKl4nKSPqA" activityName="CollectData" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" moduleVersion="1.0.0.201108111516" processName="RequestCall"/> <payload payloadMode="XML"> <XmlPayload> <inouts array="false" name="UserName" optional="true" type="String"> <simpleSpec/> </inouts> <inouts array="false" name="PhoneNumber" optional="true" type="String"> <simpleSpec/> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </startBusinessServiceResponse> </SOAP-ENV:Body>
updateBusinessService 399
updateBusinessService
Updates the specified business service instance. The request identifies the business service instance to be updated. You can optionally specify the payload mode and provide the payload in the request message. The response returns the complete information about the updated business service.
400
| Chapter 17
BusinessService
updateBusinessService 401
Response:
<SOAP-ENV:Body> <updateBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="COMPLETED" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestCall" version="1.0.0.201108111516"/> <processReference> <id>pvm:0a101s</id> <name>RequestCall</name> </processReference> </context> <pageData> <payload payloadMode="XML"> <XmlPayload xmlns:bus="http://business.api.busserv.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <inouts array="false" name="UserName" optional="true" type="String"> <simpleSpec> <value>TIB_USER</value> </simpleSpec> </inouts> <inouts array="false" name="PhoneNumber" optional="true" type="String"> <simpleSpec> <value>987654321</value> </simpleSpec> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </updateBusinessServiceResponse> </SOAP-ENV:Body>
402
| Chapter 17
BusinessService
injectBusinessServiceEvent
Injects an event into a business service whose execution state is IN_PROGRESS. The request identifies the event to be injected into the given business service and specifies the formal parameter value(s) that is to be injected. The response returns complete information about the injected business service instance.
injectBusinessServiceEvent 403
Response
404
| Chapter 17
Example
BusinessService
Request:
<soapenv:Body> <bus:injectBusinessServiceEvent> <eventDefinition moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" eventName="IntermediateEvent" processInstanceId="pvm:0a10a"/> <formalParams payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="false" type="String"> <simpleSpec length="50"> <value>Tibco</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="false" type="Integer Number"> <simpleSpec length="9"> <value>147</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter3" optional="false" type="Decimal Number"> <simpleSpec decimal="2" length="10"> <value>3.14</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter4" optional="false" type="Boolean"> <simpleSpec> <value>false</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter5" optional="false" type="Date"> <simpleSpec> <value>2012-02-29</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter6" optional="false" type="Time"> <simpleSpec> <value>09:30:10.5</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter7" optional="false" type="Date Time"> <simpleSpec> <value>2009-04-06%2002-05-30T09:30:10Z</value> </simpleSpec> </inputs> </XmlPayload> </formalParams> <responsePayloadMode>XML</responsePayloadMode> </bus:injectBusinessServiceEvent> </soapenv:Body>
injectBusinessServiceEvent 405
Response:
<SOAP-ENV:Body> <injectBusinessServiceEventResponse xmlns="http://business.api.busserv.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess" version="1.0.0.201108111140"/> <processReference> <id>pvm:0a10a</id> <name>EventHandlerProcess</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001ga.f" activityModelId="_tM7ysL0REeCCNPLAO2IuzQ" activityName="UserTask3" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" moduleVersion="1.0.0.201108111140" processName="EventHandlerProcess"/> <payload payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="true" type="String"> <simpleSpec> <value>[Ljava.lang.String;@6092c80d</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="true" type="Integer Number"> <simpleSpec> <value>[Ljava.lang.String;@740ee811</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter3" optional="true" type="Decimal Number"> <simpleSpec> <value>[Ljava.lang.String;@7ea5ef9d</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter4" optional="true" type="Boolean"> <simpleSpec> <value>[Ljava.lang.String;@40166d60</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter5" optional="true" type="Date"> <simpleSpec> <value>[Ljava.lang.String;@66da7f</value> </simpleSpec> </inputs> <!-- Response continued -->
406
| Chapter 17
BusinessService
<!-- Continued --> <inputs array="false" name="Parameter6" optional="true" type="Time"> <simpleSpec> <value>[Ljava.lang.String;@448bff03</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter7" optional="true" type="Date Time"> <simpleSpec> <value>[Ljava.lang.String;@4313411d</value> </simpleSpec> </inputs> </XmlPayload> </payload> </pageData> </pageResponse> </injectBusinessServiceEventResponse> </SOAP-ENV:Body>
cancelBusinessService 407
cancelBusinessService
Cancels a given business service instance. The request identifies the instance Id of the business service to be cancelled. The response returns the execution status - SUCCESS when the pageflow is cancelled successfully and a service fault if the execution fails.
Response:
<SOAP-ENV:Body> <cancelBusinessServiceResponse xmlns="http://business.api.busserv.n2.tibco.com"> <status xmlns="">SUCCESS</status> </cancelBusinessServiceResponse> </SOAP-ENV:Body>
408
| Chapter 17
BusinessService
CalendarService 409
Chapter 18
CalendarService
CalendarService is one of the Calendar Services provided by Work Manager. Use CalendarService requests to get information about and configure working time. Note that: Only one calendar is supported. This is a system-wide calendar with a GUID of "SYSTEM". All start and end times passed are taken to be time-zone-neutral: that is, the API assumes that all times are in UTC format.
Topics
updateWorkingDays, page 410 addWorkingDayExceptions, page 414 updateWorkingDayExceptions, page 417 deleteWorkingDayExceptions, page 420 getCalendarEntries, page 422
410
| Chapter 18
CalendarService
updateWorkingDays
Specify the working days for a particular calendar. The request must specify the GUID of the calendar for which working day details are to be modified and the new working day information. The working day information specified in the request completely replaces the existing working day information (for the specified calendar). The response returns a confirmation that the request was successful.
updateWorkingDays 411
Response
412
| Chapter 18
Example
CalendarService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://calendar.api.dac.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <cal:updateWorkingDays guid="SYSTEM"> <!--0 to 7 repetitions:--> <working-day day-of-week="MO"> <!--0 to 5 repetitions:--> <time-slot start="09:00:00" end="13:00:00"/> <time-slot start="14:00:00" end="17:30:00"/> </working-day> <working-day day-of-week="TU"> <time-slot start="09:00:00" end="13:00:00"/> <time-slot start="14:00:00" end="17:30:00"/> </working-day> <working-day day-of-week="WE"> <time-slot start="09:00:00" end="13:00:00"/> <time-slot start="14:00:00" end="17:30:00"/> </working-day> <working-day day-of-week="TH"> <time-slot start="09:00:00" end="13:00:00"/> <time-slot start="14:00:00" end="17:30:00"/> </working-day> <working-day day-of-week="FR"> <time-slot start="09:00:00" end="13:00:00"/> </working-day> <working-day day-of-week="SA"> <time-slot start="09:00:00" end="13:00:00"/> </working-day> </cal:updateWorkingDays> </soapenv:Body> </soapenv:Envelope> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updateWorkingDaysResponse xmlns="http://calendar.api.dac.n2.tibco.com">OK</updateWorkingDaysResp onse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
updateWorkingDays 413
414
| Chapter 18
CalendarService
addWorkingDayExceptions
Add working day exceptions for a given calendar. The request must specify the GUID of the calendar for which working day exception details are to be created, and the new working day exception information. The response returns a list of GUIDs, one for each newly created working day exception. You can use these IDs to identify the exceptions in future updateWorkingDayExceptions and deleteWorkingDayExceptions operations.
addWorkingDayExceptions 415
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <addWorkingDayExceptionsResponse xmlns="http://calendar.api.dac.n2.tibco.com"> <add-exceptions xmlns="">A25D05C7-E656-400C-A84F-F8DF41FE73DF</add-exceptions> </addWorkingDayExceptionsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
416
| Chapter 18
CalendarService
updateWorkingDayExceptions 417
updateWorkingDayExceptions
Update working day exceptions for a given calendar. The request must specify: the GUID of the calendar for which working day exception details are to be modified the GUIDs of the exceptions to be updated, and the information being updated for each one. The response returns a confirmation that the request was successful.
418
| Chapter 18
CalendarService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updateWorkingDayExceptionsResponse xmlns="http://calendar.api.dac.n2.tibco.com">OK</updateWorkingDayExcep tionsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
updateWorkingDayExceptions 419
Service
CalendarService
420
| Chapter 18
CalendarService
deleteWorkingDayExceptions
Delete working day exceptions for a given calendar. The request must specify the GUID of the calendar for which working day exception details are to be removed and the GUIDs identifying those exceptions. The response returns a confirmation that the request was successful.
deleteWorkingDayExceptions 421
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <deleteWorkingDayExceptionsResponse xmlns="http://calendar.api.dac.n2.tibco.com">OK</deleteWorkingDayExcep tionsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
422
| Chapter 18
CalendarService
getCalendarEntries
Get the working time for a given calendar. The request must specify the GUID of the calendar from which working time details are required, with an optional filter on the response to be provided. The response returns a complete description of working time for the specified calendar.
getCalendarEntries 423
424
| Chapter 18
Example
CalendarService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cal="http://calendar.api.dac.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <cal:getCalendarEntries guid="SYSTEM" start-date-time="2011-08-01T09:00:00" end-date-time="2012-08-15T18:00:00"> <!--Zero or more repetitions:--> <required-detail>FREE_BUSY</required-detail> <required-detail>WORKING_WEEK</required-detail> </cal:getCalendarEntries> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getCalendarEntriesResponse daylight-savings="true" time-zone="Europe/London" xmlns="http://calendar.api.dac.n2.tibco.com"> <working-days day-of-week="MO" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> <time-slot end="17:30:00.000Z" start="14:00:00.000Z"/> </working-days> <working-days day-of-week="TU" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> <time-slot end="17:30:00.000Z" start="14:00:00.000Z"/> </working-days> <working-days day-of-week="WE" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> <time-slot end="17:30:00.000Z" start="14:00:00.000Z"/> </working-days> <working-days day-of-week="TH" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> <time-slot end="17:30:00.000Z" start="14:00:00.000Z"/> </working-days> <working-days day-of-week="FR" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> </working-days> <working-days day-of-week="SA" xmlns=""> <time-slot end="13:00:00.000Z" start="09:00:00.000Z"/> </working-days> <working-day-exceptions all-day="true" description="Public Holiday" end="2011-12-27T23:59:59.999Z" free-busy="BUSY" guid="927D8BEB-143B-48B9-8FFF-FEE1A6621D01" start="2011-12-26T00:00:00.000Z" xmlns=""/> </getCalendarEntriesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getCalendarEntries 425
426
| Chapter 18
CalendarService
ContainerService 427
Chapter 19
ContainerService
ContainerService is one of the Directory Services provided by Work Manager. Use ContainerService requests to manage LDAP containers.
Topics
listLDAPContainers, page 428 getLDAPContainerDetail, page 430 saveLDAPContainerDetail, page 432 deleteLDAPContainer, page 435
428
| Chapter 19
ContainerService
listLDAPContainers
List details of all currently configured LDAP containers to which the caller has access. (Access can be restricted if the caller was created in an LDAP container that has a relationship set up with an organizationfor more information, see Organization Relationships on page 123.) The request takes no parameters. The response returns details of configured LDAP containers.
1. This operation can be called by users possessing either the resourceAdmin or LDAPAdmin system action. The LDAPAdmin system action gives the user additional access to organizations that are restricted due to organization relationships. For more information, see Overriding Organization Relationships on page 124.
TIBCO ActiveMatrix BPM - BPM Developers Guide
listLDAPContainers 429
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://container.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <con:listLDAPContainers> <empty>0</empty> </con:listLDAPContainers> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPContainersResponse xmlns="http://container.api.de.n2.tibco.com"> <ldap-container active="true" description="" entity-count="8" id="1" last-accessed="2011-07-15T20:52:04.377Z" name="easyAs" xmlns=""> <primary-ldap display-name-attributes="ou" guid="0FFC620C-31FC-4687-94A8-08E9F7F07D89" id="1" ldap-alias="easyAs" ldap-search-string="(objectClass=organizationalPerson)"/> </ldap-container> <ldap-container active="true" id="51" name="local" xmlns=""> <primary-ldap base-dn="OU=employees" display-name-attributes="displayname" guid="6F4B63DF-FD44-4605-B709-40B4E5EFF7C3" id="51" ldap-alias="local" ldap-search-string="(objectClass=person)"/> </ldap-container> . . . </listLDAPContainersResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
430
| Chapter 19
ContainerService
getLDAPContainerDetail
List details of a specific LDAP container: The request must specify the unique ID of the LDAP container for which details should be listed. The response returns details of the specified LDAP container.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getLDAPContainerDetailResponse active="true" description="" entity-count="8" id="1" last-accessed="2011-07-15T20:52:04.377Z" name="easyAs" xmlns="http://container.api.de.n2.tibco.com"> <primary-ldap display-name-attributes="ou" guid="0FFC620C-31FC-4687-94A8-08E9F7F07D89" id="1" ldap-alias="easyAs" ldap-search-string="(objectClass=organizationalPerson)" xmlns=""/> </getLDAPContainerDetailResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getLDAPContainerDetail 431
432
| Chapter 19
ContainerService
saveLDAPContainerDetail
Create a new LDAP container or update the details for an existing LDAP container: The request must specify the details of the LDAP container to be created or updated. The response returns the unique ID of the newly-created or updated LDAP container.
saveLDAPContainerDetail 433
Parameter notes
id: Passed when updating an existing container. Can be obtained from listLDAPContainers. name: Passed when creating a new container. Must be unique among the LDAP containers. entity-count: Only returned in the response. last-accessed: Only returned in the response. primary-ldap.id, secondary-ldap.id: This is only needed when mapping resource attributes to LDAP attributes. The value passed in this attribute (which can be any arbitrary value) can then be included in attribute-mapping.ldap-resource-id to identify which LDAP source the LDAP attribute is to come from. For more information, see Mapping Resource Attributes to LDAP Attributes on page 118. primary-ldap.guid, secondary-ldap.guid: This is needed only when updating an existing container. Can be obtained from getLDAPContainerDetail. primary-ldap.ldap-alias, secondary-ldap.ldap-alias: Can be obtained from listLDAPSources. An LDAP Container can contain only one reference to any LDAP Alias. That is, no two LDAP Sources within the same LDAP Container can share the same LDAP Alias. primary-ldap.ldap-search-string, secondary-ldap.ldap-search-string: Identifies the LDAP entries to be considered as candidates for resourcesthis is required in every request. For example: "(objectclass=person)"). For information about valid search strings, see Using LDAP Filters on page 113. LDAP attributes and their values can be obtained from listLDAPAttributeNames and listLDAPAttributes. primary-ldap.display-name-attribute: [This attribute is only applicable to the primary LDAP.] The attributes in this parameter determine the name by which the user must log into the application. LDAP attributes and their values can be obtained from listLDAPAttributeNames and listLDAPAttributes. This can consist of multiple, space-separated attributes (for example "givenname sn"). secondary-ldap.container-mapping: Describes how a secondary LDAP source is mapped to the primary LDAP source. LDAP attributes and their values can be obtained from listLDAPAttributeNames and listLDAPAttributes For more information, see Defining Secondary LDAP Sources in an LDAP Container on page 115. attribute-mapping: Used to map organization model resource attributes to LDAP attributes. The ldap-resource-id value identifies the LDAP sourceit is obtained from the primary-ldap.id or secondary-ldap.id attributes. The business-attribute-id value can be obtained from listBusinessParameters. The ldap-attribute value can be obtained from listLDAPAttributeNames and listLDAPAttributes. For more information, see Mapping Resource Attributes to LDAP Attributes on page 118. administered-organization: Used to set up organization relationships. The guid attribute can be obtained from listOrgModelOverview. The name attribute is not used in this request. For more information, see Organization Relationships on page 123.
TIBCO ActiveMatrix BPM - BPM Developers Guide
434
| Chapter 19
Response Example
ContainerService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <saveLDAPContainerDetailResponse container-id="60" xmlns="http://container.api.de.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
deleteLDAPContainer 435
deleteLDAPContainer
Deletes the LDAP container specified in the request: The request must specify the unique ID of the LDAP container that is to be deleted. The response indicates whether or not the LDAP container was successfully deleted.
Response
436
| Chapter 19
Example
ContainerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:con="http://container.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <con:deleteLDAPContainer container-id="70" delete-resources="false"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <deleteLDAPContainerResponse successful="true" xmlns="http://container.api.de.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
EntityResolverService 437
Chapter 20
EntityResolverService
EntityResolverService is one of the Directory Services provided by Work Manager. Use EntityResolverService requests to get information about resources and their association with specific organization model entities.
Topics
getResourceDetail, page 438 listAssociatedResources, page 441 lookupUser, page 443
438
| Chapter 20
EntityResolverService
getResourceDetail
Get detailed information about one or more resources: The request must specify the resource(s) for which details are required. The response returns detailed descriptions of the requested resource(s). This information includes the groups, positions, capabilities, privileges and attributes associated with each resource.
getResourceDetail 439
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:res="http://resolver.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <res:getResourceDetail> <!--1 or more repetitions:--> <resource model-version="-1" entity-type="RESOURCE" guid="0C87F2ED-0BF8-482F-BAFB-84E51C5AA624" /> </res:getResourceDetail> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getResourceDetailResponse xmlns="http://resolver.api.de.n2.tibco.com"> <resource guid="0C87F2ED-0BF8-482F-BAFB-84E51C5AA624" name="Tony Pulis" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="OU=Tony Pulis, OU=London, OU=AllEmployees, O=easyAsInsurance"/> <group endDate="2011-07-26T06:59:59.000Z" entity-type="GROUP" guid="_o6QGsALvEeCHF4vrCq9WPw" model-version="3" name="AdminResourceManagement" startDate="2011-07-22T07:00:00.000Z"/> <privilege endDate="2011-07-26T06:59:59.000Z" entity-type="PRIVILEGE" guid="_UNb_kMpSEd64gM7QE8RwxA" model-version="3" name="ResourceManager" startDate="2011-07-22T07:00:00.000Z"> <origin entity-type="GROUP" guid="_o6QGsALvEeCHF4vrCq9WPw" model-version="3" name="AdminResourceManagement"/> </privilege> <privilege endDate="2011-07-26T06:59:59.000Z" entity-type="PRIVILEGE" guid="_I8YiEMpSEd64gM7QE8RwxA" model-version="3" name="BaseUser" startDate="2011-07-22T07:00:00.000Z"> <origin entity-type="GROUP" guid="_ISlQ8ALvEeCHF4vrCq9WPw" model-version="3" name="Admin"/> </privilege> </resource> </getResourceDetailResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
440
| Chapter 20
EntityResolverService
listAssociatedResources 441
listAssociatedResources
List the resources associated with one or more organization model entities. The request must specify the organization model entities for which the associated resources are required. The response returns the details of the resources associated with the specified organization model entities.
This operation considers an "associated" entity as one in which the resource is a member, or the resource possesses the entity (in the case of privileges and capabilities). Note that the association is hierarchical: If the entity specified is a group, the result also includes resources associated with sub-groups. If the entity specified is an organization unit, the result also includes resources associated with positions in that organization unit. If the entity specified is a privilege, the result includes resources that have inherited that privilege because of their membership in groups and positions. If the entity specified is a capability, the result includes resources that hold that capability directly. It does not take into consideration the capabilities of groups and positions to which the resource is a member. Required System Action resolveResource
442
| Chapter 20
EntityResolverService
Response
Returns a listAssociatedResourcesResponse element (from the EntityResolverService schema). If multiple organizational entities are specified, and a resource is associated with more than one of those entities, that resource is only listed once in the response.
Example
Request:
<soapenv:Body> <res:listAssociatedResources> <entity-guid>_ntQXEDMeEeCrFvFvgjfN_w</entity-guid> </res:listAssociatedResources> </soapenv:Body>
Response:
<SOAP-ENV:Body> <listAssociatedResourcesResponse xmlns="http://resolver.api.de.n2.tibco.com"> <resource guid="tibco-admin" name="tibco-admin" resource-type="HUMAN" xmlns=""> <LdapReference ldap-alias="system" ldap-dn="UID=admin, OU=system"/> </resource> <resource guid="ED72300B-F2FA-4E60-90D4-F829FB8DEA9D" name="Liam Lawrence" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance"/> </resource> </listAssociatedResourcesResponse> </SOAP-ENV:Body>
lookupUser 443
lookupUser
List the resources that match a specified login name or LDAP DN. The request must specify the name and/or LDAP DN on which to search, and whether to return details of those users. The response returns the number of users found that match the given criteria and, optionally, lists the details of those users.
444
| Chapter 20
EntityResolverService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <lookupUserResponse user-count="1" xmlns="http://resolver.api.de.n2.tibco.com"> <detail alias="easyAs" dn="OU=Tony Pulis, OU=London, OU=AllEmployees, O=easyAsInsurance" entity-type="RESOURCE" guid="0C87F2ED-0BF8-482F-BAFB-84E51C5AA624" model-version="-1" name="Tony Pulis" resource-type="HUMAN" xmlns=""> <groups>_ISlQ8ALvEeCHF4vrCq9WPw</groups> <groups>_o6QGsALvEeCHF4vrCq9WPw</groups> </detail> </lookupUserResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
EventCollectorQueryService 445
Chapter 21
EventCollectorQueryService
EventCollectorQueryService is one of the Event Collection Services provided by Process Manager. Use EventCollectorQueryService requests to get information from the Event Collector database tables about events, attributes and components.
Topics
executeGenericQuery, page 446 executeRegisteredGenericQuery, page 450 getAllAttributes, page 454 getAttributes, page 457 getComponents, page 460 isQueryRegistered, page 463 registerQuery, page 465 unRegisterQuery, page 468 lookupQueryByTag, page 470
446
| Chapter 21
EventCollectorQueryService
executeGenericQuery
Execute the specified query against the Event Collector database tables. (If a query needs to be executed multiple times, better performance will be experienced by registering the query with registerQuery, then using the executeRegisteredGenericQuery operation.) The request must specify the details of the query that is to be executed, along with any options for the query. The response returns details of the events that match the specified query, along with summary information about the executed query.
executeGenericQuery 447
Response
448
| Chapter 21
Example
EventCollectorQueryService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com" xmlns:base="http://base.api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:executeGenericQueryRequest> <base:Query> <correlate>false</correlate> <filter>((messageCategory='WORK_ITEM') AND (parentObjectId='pvm:0a121'))</filter> <requireAllAttributes>true</requireAllAttributes> <target>AUDIT</target> </base:Query> <base:QueryOptions> </base:QueryOptions> </api:executeGenericQueryRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <executeGenericQueryResponse xmlns="http://api.ec.n2.tibco.com"> <GenericResult xmlns="http://base.api.ec.n2.tibco.com"> <endPosition xmlns="">11</endPosition> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">11</totalItems> <resultEntry xmlns=""> <id>65</id> <ref>BRM_WORKITEM_SCHEDULED</ref> <attribute xsi:type="base:StringEntryAttribute" xmlns:base="http://base.api.ec.n2.tibco.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <attributeId>27</attributeId> <attributeName>hostAddress</attributeName> <type>STRING</type> <value>10.97.8.153</value> </attribute> . . . </GenericResult> </executeGenericQueryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
executeGenericQuery 449
450
| Chapter 21
EventCollectorQueryService
executeRegisteredGenericQuery
Execute a query that has been previously registered using the registerQuery operation. The request must specify the previously registered query that is to be executed, along with any options to be used on this particular execution of the query. The response returns details of the events that match the specified query, along with summary information about the executed query.
executeRegisteredGenericQuery 451
Response
452
| Chapter 21
Example
EventCollectorQueryService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com" xmlns:base="http://base.api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:executeRegisteredGenericQueryRequest> <base:QueryIdentifier> <tag>EventTag123</tag> </base:QueryIdentifier> <base:QueryOptions> <numberOfItems>-1</numberOfItems> <populateAttributeNames>true</populateAttributeNames> </base:QueryOptions> </api:executeRegisteredGenericQueryRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <executeRegisteredGenericQueryResponse xmlns="http://api.ec.n2.tibco.com"> <GenericResult xmlns="http://base.api.ec.n2.tibco.com"> <endPosition xmlns="">11</endPosition> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">11</totalItems> <resultEntry xmlns=""> <id>65</id> <ref>BRM_WORKITEM_SCHEDULED</ref> <attribute xsi:type="base:StringEntryAttribute" xmlns:base="http://base.api.ec.n2.tibco.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <attributeId>27</attributeId> <attributeName>hostAddress</attributeName> <type>STRING</type> <value>10.97.8.153</value> </attribute> . . . </resultEntry> </GenericResult> </executeRegisteredGenericQueryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
executeRegisteredGenericQuery 453
454
| Chapter 21
EventCollectorQueryService
getAllAttributes
List all attributes registered in the Event Collector database tables. The request has no parameters. The response returns the details of all attributes registered in the Event Collector database tables.
getAllAttributes 455
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getAllAttributesResponse xmlns="http://api.ec.n2.tibco.com"> <AttributeDefinition xmlns="http://base.api.ec.n2.tibco.com"> <category xmlns="">message</category> <componentId xmlns="">1</componentId> <id xmlns="">1</id> <isPrimary xmlns="">true</isPrimary> <name xmlns="">messageId</name> <type xmlns="">STRING</type> </AttributeDefinition> <AttributeDefinition xmlns="http://base.api.ec.n2.tibco.com"> <category xmlns="">environment</category> <componentId xmlns="">1</componentId> <id xmlns="">2</id> <isPrimary xmlns="">false</isPrimary> <name xmlns="">environmentName</name> <type xmlns="">STRING</type> </AttributeDefinition> . . . </getAllAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
456
| Chapter 21
EventCollectorQueryService
getAttributes 457
getAttributes
List all attributes in the Event Collector database tables that are registered for a specific component. The request must specify the identifier of the component for which attributes should be listed. The response returns the details of all attributes registered in the Event Collector database for the specified component.
458
| Chapter 21
EventCollectorQueryService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getAttributesResponse xmlns="http://api.ec.n2.tibco.com"> <AttributeDefinition xmlns="http://base.api.ec.n2.tibco.com"> <category xmlns="">message</category> <componentId xmlns="">1</componentId> <id xmlns="">1</id> <isPrimary xmlns="">true</isPrimary> <name xmlns="">messageId</name> <type xmlns="">STRING</type> </AttributeDefinition> <AttributeDefinition xmlns="http://base.api.ec.n2.tibco.com"> <category xmlns="">environment</category> <componentId xmlns="">1</componentId> <id xmlns="">2</id> <isPrimary xmlns="">false</isPrimary> <name xmlns="">environmentName</name> <type xmlns="">STRING</type> </AttributeDefinition> . . . </getAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getAttributes 459
460
| Chapter 21
EventCollectorQueryService
getComponents
List the components that are registered on the system. The request has no parameters. The response returns the details of each component that is registered on the system.
getComponents 461
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getComponentsResponse xmlns="http://api.ec.n2.tibco.com"> <Component xmlns="http://base.api.ec.n2.tibco.com"> <componentClass xmlns="">com.tibco.n2.logging.metadata.n2lf.N2LFMetaData</componentCla ss> <componentName xmlns="">N2LF</componentName> <description xmlns="">N2 Logging Framework</description> <id xmlns="">1</id> <implementationType xmlns="">N2LF-INTERNAL</implementationType> <name xmlns="">N2LF</name> <parentId xmlns="">-1</parentId> <revision xsi:nil="true" xmlns="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <version xmlns="">1.1</version> </Component> . . . </getComponentsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
462
| Chapter 21
EventCollectorQueryService
isQueryRegistered 463
isQueryRegistered
Test whether a query is registered with Event Collector. (This can be useful for determining whether a frequently used query tag is already present on the system.) The request must specify the query that is to be tested. The response returns whether the query is registered with Event Collector.
464
| Chapter 21
EventCollectorQueryService
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <isQueryRegisteredResponse xmlns="http://api.ec.n2.tibco.com"> <result xmlns="">true</result> </isQueryRegisteredResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
registerQuery 465
registerQuery
Register a query with Event Collector, so that it can be subsequently executed using the executeRegisteredGenericQuery operation. The request must specify the query to be registered and a tag with which to identify it. The response returns the GUID and tag for the newly registered query.
466
| Chapter 21
EventCollectorQueryService
Response
registerQuery 467
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com" xmlns:base="http://base.api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:registerQueryRequest> <tag>EventTag123</tag> <base:Query> <correlate>false</correlate> <filter>((messageCategory='WORK_ITEM') AND (parentObjectId='pvm:0a121'))</filter> <requireAllAttributes>true</requireAllAttributes> </base:Query> </api:registerQueryRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <registerQueryResponse xmlns="http://api.ec.n2.tibco.com"> <QueryIdentifier xmlns="http://base.api.ec.n2.tibco.com"> <guid xmlns="">2</guid> <tag xmlns="">EventTag123</tag> </QueryIdentifier> </registerQueryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
468
| Chapter 21
EventCollectorQueryService
unRegisterQuery
Unregister a previously registered query. The request must specify the query that is to be unregistered (using either a GUID or tag). The response has no parameters.
unRegisterQuery 469
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <unRegisterQueryResponse xmlns="http://api.ec.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
470
| Chapter 21
EventCollectorQueryService
lookupQueryByTag
List the details for a particular query (identified by its tag). This operation can be used to obtain the GUID for a registered query. The executeRegisteredGenericQuery operation executes faster if the query is identified using its GUID rather than its tag. The request must specify the tag to be used to look up the query. The response returns the details of the specified query, including its identifier.
lookupQueryByTag 471
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <lookupQueryByTagResponse xmlns="http://api.ec.n2.tibco.com"> <QueryInfo xmlns="http://base.api.ec.n2.tibco.com"> <query xmlns=""> <correlate>false</correlate> <filter>((messageCategory='WORK_ITEM') AND (parentObjectId='pvm:0a121'))</filter> <requireAllAttributes>true</requireAllAttributes> </query> <identifier xmlns=""> <guid>2</guid> <tag>EventTag123</tag> </identifier> </QueryInfo> </lookupQueryByTagResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
472
| Chapter 21
Service
EventCollectorQueryService
EventCollectorQueryService
EventCollectorMeasuresService 473
Chapter 22
EventCollectorMeasuresService
EventCollectorMeasuresService is one of the Event Collection Services provided by Process Manager. Use EventCollectorMeasuresService requests to get measures information stored by the Event Collector database tables about process templates or work items.
Topics
requestProcessDurationMeasure, page 474 requestProcessTemplateMeasure, page 477 requestWorkItemPerformanceForTemplate, page 480 requestWorkItemPerformanceForResource, page 484
474
| Chapter 22
EventCollectorMeasuresService
requestProcessDurationMeasure
Request a process duration measure from the Event Collector database tables: The request must specify the process template name(s) for which a process duration measure is to be returned, start and end dates, the duration to be measured, and whether data consolidation is required. The response returns the requested measure(s).
Response
requestProcessDurationMeasure 475
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:requestProcessDurationMeasureRequest> <id> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <duration> <endDate>2011-08-05T00:00:00.000Z</endDate> <startDate>2011-07-01T00:00:00.000Z</startDate> <granularity>YEAR</granularity> </duration> <options> <consolidation>BOTH</consolidation> </options> </api:requestProcessDurationMeasureRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <requestProcessDurationMeasureResponse xmlns="http://api.ec.n2.tibco.com"> <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-07-01T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>7</value> <type>PROCESS_TOTAL</type> </entry> . . . </period> </measure> </requestProcessDurationMeasureResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
476
| Chapter 22
EventCollectorMeasuresService
requestProcessTemplateMeasure 477
requestProcessTemplateMeasure
Request a process template measure from the Event Collector database tables: The request must specify the process template name(s) for which a process template measure is to be returned, start and end dates, the duration to be measured, and whether data consolidation is required. The response returns the requested measure(s).
Response
478
| Chapter 22
Example
EventCollectorMeasuresService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:requestProcessTemplateMeasureRequest> <!--1 or more repetitions:--> <id> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <duration> <endDate>2011-08-05T00:00:00.000Z</endDate> <startDate>2011-07-01T00:00:00.000Z</startDate> <granularity>YEAR</granularity> </duration> <options> <consolidation>BOTH</consolidation> </options> </api:requestProcessTemplateMeasureRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <requestProcessTemplateMeasureResponse xmlns="http://api.ec.n2.tibco.com"> <measure xmlns=""> <index>0</index> <id xmlns:api="http://api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-07-01T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>7</value> <type>STARTED</type> </entry> . . . </period> </measure> </requestProcessTemplateMeasureResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
requestProcessTemplateMeasure 479
480
| Chapter 22
EventCollectorMeasuresService
requestWorkItemPerformanceForTemplate
Request a work item performance measure for a process template from the Event Collector database tables: The request must specify the process template name(s) for which a work item performance measure is to be returned, start and end dates, the duration to be measured, and whether data consolidation is required. The response returns the requested measure(s).
requestWorkItemPerformanceForTemplate 481
Response
482
| Chapter 22
Example
EventCollectorMeasuresService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.ec.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:requestWorkItemPerformanceForTemplateRequest> <id> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <duration> <endDate>2011-08-05T00:00:00.000Z</endDate> <startDate>2011-07-01T00:00:00.000Z</startDate> <granularity>YEAR</granularity> </duration> <options> <consolidation>BOTH</consolidation> </options> </api:requestWorkItemPerformanceForTemplateRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <requestWorkItemPerformanceForTemplateResponse xmlns="http://api.ec.n2.tibco.com"> <measure xmlns=""> <index>0</index> <id xsi:type="base:ProcessTemplateId" xmlns:api="http://api.ec.n2.tibco.com" xmlns:base="http://base.api.ec.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <processTemplateName>CSCallbackProcess</processTemplateName> </id> <period> <index>0</index> <duration> <startDate>2011-07-01T00:00:00.000Z</startDate> </duration> <entry> <index>0</index> <value>4</value> <type>OFFERED</type> </entry> . . . </period> </measure> </requestWorkItemPerformanceForTemplateResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
requestWorkItemPerformanceForTemplate 483
484
| Chapter 22
EventCollectorMeasuresService
requestWorkItemPerformanceForResource
Request a work item performance measure for a resource from the Event Collector database tables: The request must specify the resource name(s) for which a work item performance measure is to be returned, start and end dates, the duration to be measured, and whether data consolidation is required. The response returns the requested measure(s).
ExporterService 485
Chapter 23
ExporterService
ExporterService is one of the Directory Services provided by Work Manager. Use ExporterService requests to export and import defined LDAP containers, resource mappings and push destinations.
Topics
exportResources, page 486 importResources, page 490
486
| Chapter 23
ExporterService
exportResources
Export defined LDAP containers, resource mappings and push destinations, either for backup or for subsequent import to other environments: The request must specify the elements that are to be exported from this server. The response returns an export object containing the details of all the exported elements.
exportResources 487
488
| Chapter 23
Example
ExporterService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exp="http://exporter.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <exp:exportResourcesRequest export-ldap-containers="true" export-resources="true" export-push-destinations="true"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <exportResourcesResponse xmlns="http://exporter.api.de.n2.tibco.com"> <container active="true" description="" entity-count="8" id="1" last-accessed="2011-08-01T16:16:59.490Z" name="easyAs" xmlns=""> <primary-ldap display-name-attributes="ou" guid="0FFC620C-31FC-4687-94A8-08E9F7F07D89" id="1" ldap-alias="easyAs" ldap-search-string="(objectClass=organizationalPerson)"/> </container> <resource id="tibco-admin" ldapalias="system" ldapdn="UID=admin, OU=system" name="tibco-admin" resourceType="HUMAN" xmlns=""> <resourceGroup groupId="CF931D25A207BF4C4458FF923692F350"/> <resourceGroup groupId="CD4888DFE350794FE9185524F409A6F0"/> <resourceGroup groupId="Undelivered"/> <resourceGroup groupId="BBC750FBBDD594EDD04E42CAC1C731E7"/> <resourceGroup groupId="CF8999291E375FA9B249009F98C457A8"/> </resource> <resource id="B15F1CE0-4B28-4F48-BC7C-42C171A9AF48" ldapalias="easyAs" ldapcontainer="easyAs" ldapdn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance" name="Liam Lawrence" resourceType="HUMAN" xmlns=""> <positionHeld positionId="_2ieLgMpREd64gM7QE8RwxA"/> </resource> . . . <resource id="D4E3C720-5500-4651-B105-6C60C613E226" ldapalias="easyAs" ldapcontainer="easyAs" ldapdn="OU=Leon Court, OU=Paris, OU=AllEmployees, O=easyAsInsurance" name="Leon Court" resourceType="HUMAN" xmlns=""> <positionHeld positionId="_2ieLgMpREd64gM7QE8RwxA"/> </resource> </exportResourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
exportResources 489
490
| Chapter 23
ExporterService
importResources
Import a previously exported object containing details of the exported LDAP containers, resource mappings and push destinations: The request must specify the previously exported data object that is to be imported to this server. The response returns a success result if the supplied data has been successfully imported.
importResources 491
492
| Chapter 23
Example
ExporterService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exp="http://exporter.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <exp:importResourcesRequest> <container active="true" description="" entity-count="8" id="1" last-accessed="2011-08-01T16:16:59.490Z" name="easyAs" xmlns=""> <primary-ldap display-name-attributes="ou" guid="0FFC620C-31FC-4687-94A8-08E9F7F07D89" id="1" ldap-alias="easyAs" ldap-search-string="(objectClass=organizationalPerson)"/> </container> <resource id="tibco-admin" ldapalias="system" ldapdn="UID=admin, OU=system" name="tibco-admin" resourceType="HUMAN" xmlns=""> <resourceGroup groupId="CF931D25A207BF4C4458FF923692F350"/> <resourceGroup groupId="CD4888DFE350794FE9185524F409A6F0"/> <resourceGroup groupId="Undelivered"/> <resourceGroup groupId="BBC750FBBDD594EDD04E42CAC1C731E7"/> <resourceGroup groupId="CF8999291E375FA9B249009F98C457A8"/> </resource> <resource id="B15F1CE0-4B28-4F48-BC7C-42C171A9AF48" ldapalias="easyAs" ldapcontainer="easyAs" ldapdn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance" name="Liam Lawrence" resourceType="HUMAN" xmlns=""> <positionHeld positionId="_2ieLgMpREd64gM7QE8RwxA"/> </resource> . . . <resource id="D4E3C720-5500-4651-B105-6C60C613E226" ldapalias="easyAs" ldapcontainer="easyAs" ldapdn="OU=Leon Court, OU=Paris, OU=AllEmployees, O=easyAsInsurance" name="Leon Court" resourceType="HUMAN" xmlns=""> <positionHeld positionId="_2ieLgMpREd64gM7QE8RwxA"/> </resource> </exp:importResourcesRequest> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <importResourcesResponse xmlns="http://exporter.api.de.n2.tibco.com">true</importResourcesRespo nse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
importResources 493
494
| Chapter 23
ExporterService
LDAPService 495
Chapter 24
LDAPService
LDAPService is one of the Directory Services provided by Work Manager. Use LDAPService operations to get information about and from LDAP sources.
Topics
listLDAPSources, page 496 listLDAPEntities, page 498 listLDAPAttributes, page 501 listLDAPAttributeNames, page 504 listContainerResources, page 508
496
| Chapter 24
LDAPService
listLDAPSources
List all LDAP sources currently available to the BPM runtime. The request takes no parameters. The response returns the LDAP aliases of all currently available LDAP sources.
listLDAPSources 497
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPSourcesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <LdapSource ldap-alias="system" xmlns=""/> <LdapSource ldap-alias="easyAs" xmlns=""/> </listLDAPSourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
498
| Chapter 24
LDAPService
listLDAPEntities
List the LDAP resources in a particular LDAP container. This operation can return resources that already exist (that is, they have been "created" with either the getResourceGuid or mapEntities operation), as well as those that are potential resources (resources that are available in an LDAP source, but have not been created yet). Note that the listContainerResources operation can also be used to get resources that already exist. The request must specify the LDAP container whose resources should be listed. The response returns detailed descriptions of all LDAP resources available in the specified LDAP container. Note that this operation returns an empty response if the calling user does not have access to an organization to which a LDAP container is associated (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Actions resourceAdmin and/or LDAPAdmin1
1. This operation can be called by users possessing either the resourceAdmin or LDAPAdmin system action. The LDAPAdmin system action gives the user additional access to organizations that are restricted due to organization relationships. For more information, see Overriding Organization Relationships on page 124.
TIBCO ActiveMatrix BPM - BPM Developers Guide
listLDAPEntities 499
500
| Chapter 24
LDAPService
Response: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPEntitiesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <LdapResource name="Richard Cresswell" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="ou=Richard Cresswell,ou=London,ou=AllEmployees,o=easyAsInsurance"/> </LdapResource> <LdapResource name="John Eustace" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="ou=John Eustace,ou=Swindon,ou=AllEmployees,o=easyAsInsurance"/> </LdapResource> <LdapResource guid="A618D111-4121-417F-86DC-519A2151FAE8" name="Steve Simonsen" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="ou=Steve Simonsen,ou=London,ou=AllEmployees,o=easyAsInsurance"/> </LdapResource> <LdapResource guid="ED72300B-F2FA-4E60-90D4-F829FB8DEA9D" name="Liam Lawrence" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="ou=Liam Lawrence,ou=London,ou=AllEmployees,o=easyAsInsurance"/> </LdapResource> </listLDAPEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listLDAPAttributes 501
listLDAPAttributes
List the data values stored in one or more LDAP attributes for a particular LDAP entity: The request must specify the LDAP resource and, optionally, LDAP attributes for which data values should be returned. The response returns the data values stored for the requested LDAP attributes.
502
| Chapter 24
LDAPService
Response Example
Response:
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPAttributesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <req-attributes ldap-alias="easyAs" ldap-attribute="employeenumber" ldap-dn="ou=Steve Simonsen,ou=London,ou=AllEmployees" name="employeenumber" xmlns=""> <value>1323</value> </req-attributes> </listLDAPAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listLDAPAttributes 503
504
| Chapter 24
LDAPService
listLDAPAttributeNames
List all LDAP attribute names that exist in a particular LDAP source and that have data: The request must specify the LDAP source from which attribute data should be returned. The response returns a list of LDAP attribute names that exist in the specified LDAP source, and (optionally) a list of sample entries.
listLDAPAttributeNames 505
Response Example
506
| Chapter 24
LDAPService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listLDAPAttributeNamesResponse entity-count="3" xmlns="http://ldapservice.api.de.n2.tibco.com"> <Names xmlns=""> <AttributeName>mail</AttributeName> <AttributeName>sn</AttributeName> <AttributeName>ou</AttributeName> <AttributeName>manager</AttributeName> <AttributeName>employeetype</AttributeName> <AttributeName>userpassword</AttributeName> <AttributeName>employeenumber</AttributeName> <AttributeName>cn</AttributeName> </Names> <LdapEntry xmlns=""> <LdapAttribute name="mail"> <value>chill@easyasinsurance.com</value> </LdapAttribute> <LdapAttribute name="sn"> <value>Hill</value> </LdapAttribute> <LdapAttribute name="ou"> <value>Clint Hill</value> </LdapAttribute> <LdapAttribute name="manager"> <value>ou=John Eustace,ou=Swindon,ou=AllEmployees,o=easyAsInsurance</value> </LdapAttribute> <LdapAttribute name="employeetype"> <value>Permanent</value> </LdapAttribute> <LdapAttribute name="userpassword"> <value>dGliY28xMjM=</value> </LdapAttribute> <LdapAttribute name="employeenumber"> <value>1201</value> </LdapAttribute> <LdapAttribute name="cn"> <value>Mr Clint Hill</value> </LdapAttribute> </LdapAttribute> </LdapEntry> </listLDAPAttributeNamesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listLDAPAttributeNames 507
508
| Chapter 24
LDAPService
listContainerResources
List the organization model resources in a particular LDAP container. Note that this operation returns only resources that already exist (that is, they have been "created" with either the getResourceGuid or mapEntities operation). To get resources that already exist, as well as those that are potential resources (those that are available in an LDAP source, but have not been created yet), use the listLDAPEntities operation. The request must specify the LDAP container for which resources should be listed. The response returns a list of the organization model resources in the specified LDAP container. Note that this operation returns an empty response if the calling user does not have access to an organization to which a LDAP container is associated (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Action resourceAdmin and/or LDAPAdmin1
1. This operation can be called by users possessing either the resourceAdmin or LDAPAdmin system action. The LDAPAdmin system action gives the user additional access to organizations that are restricted due to organization relationships. For more information, see Overriding Organization Relationships on page 124.
TIBCO ActiveMatrix BPM - BPM Developers Guide
listContainerResources 509
510
| Chapter 24
Example
LDAPService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ldap="http://ldapservice.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <ldap:listContainerResources model-version="-1" container-id="1"/> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listContainerResourcesResponse xmlns="http://ldapservice.api.de.n2.tibco.com"> <LdapResource guid="99E75521-E091-4AC6-A8AE-7561BF1ABCB5" name="Clint Hill" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Clint Hill, OU=Swindon, OU=AllEmployees, O=easyAsInsurance"/> </LdapResource> <LdapResource guid="D2E3C35F-7213-42FE-8877-86EA03F96880" name="Tony Pulis" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="EasyAs" ldap-alias="easyAs" ldap-dn="OU=Tony Pulis, OU=London, OU=AllEmployees, O=easyAsInsurance"/> </LdapResource> </listContainerResourcesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
MappingService 511
Chapter 25
MappingService
MappingService is one of the Directory Services provided by Work Manager. Use MappingService requests to manage mappings between organization model resources and LDAP entities.
Topics
listMappedEntities, page 512 mapEntities, page 515 getResourceGuid, page 518 deleteResource, page 521 updateCapabilityAssignments, page 523
512
| Chapter 25
MappingService
listMappedEntities
List the resources that are currently mapped to the specified group or position: The request must specify the organization model entity (group or position) for which mapped resources are to be returned, as well as the GUID for the group or position. The response returns the details of each resource that is mapped to the specified group or position.
listMappedEntities 513
Returns a listMappedEntitiesResponse element (from the MappingService schema) If there are no resources currently mapped to the specified group or position, the response is an empty document.
514
| Chapter 25
Example
MappingService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:map="http://mapping.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <map:listMappedEntities> <parent-entity model-version="-1" entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" /> </map:listMappedEntities> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listMappedEntitiesResponse xmlns="http://mapping.api.de.n2.tibco.com"> <resource guid="B15F1CE0-4B28-4F48-BC7C-42C171A9AF48" name="Liam Lawrence" resource-type="HUMAN" xmlns=""> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="OU=Liam Lawrence, OU=London, OU=AllEmployees, O=easyAsInsurance"/> <group entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees"/> <group entity-type="GROUP" guid="_mHwlMMpUEd64gM7QE8RwxA" model-version="3" name="Consultants"/> <privilege entity-type="PRIVILEGE" guid="_I8YiEMpSEd64gM7QE8RwxA" model-version="3" name="BaseUser"> <origin entity-type="GROUP" guid="_Jb8oYMpREd64gM7QE8RwxA" model-version="3" name="Employees"/> </privilege> . . . </listMappedEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
mapEntities 515
mapEntities
Map resources to, or remove resources from, one or more positions or groups: The request must specify the target positions or groups and the resources that are to be mapped to, or removed from, those positions or groups. You can map already existing resources by passing their GUID. You can map and create a resource at the same time by passing an LdapReference from which the resource can be derived. The response returns the resources that were mapped to or removed from the specified positions or groups.
See also: Mapping Users on page 92. Required System Action createResourceAdmin
516
| Chapter 25
MappingService
Use the create element when adding resources to groups or positions create.resource-type: Must be HUMAN when mapping users to groups or positions. create.guid: Pass a GUID when adding existing resources to groups/positions. Can be obtained from lookupUser, listMappedEntities, listContainerResources, or listAssociatedResources. create.name: The name assigned to the newly created resource. Used only when creating a new resource by passing in an LdapReference. create.startDate, endDate: For an example of usage, see Example 2Mapping a Resource that Does Not Currently Exist on page 101. create.invalid, invalidReason: Are not passed in the request; they are returned in the response if there is a conflict with an existing resource. create.LdapReference: Pass this parameter if you are creating and mapping a resource at the same time. Can be obtained from listLDAPEntities.
Use the remove element when removing resources from groups or positions. remove.entity-type: Must be RESOURCE. remove.guid: Can be obtained from lookupUser, listMappedEntities, listContainerResources, or listAssociatedResources. remove.qualifier: Not used in this operation.
Note that you can adjust already specified start and end dates by including both the remove and the create elements for the same resource, along with the startDate and endDate attributes with the new dates. Response Returns a mapEntitiesResponse element (from the MappingService schema)
mapEntities 517
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:map="http://mapping.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <map:mapEntities> <entityMapping> <target model-version="-1" entity-type="GROUP" guid="_xa5ewOtZEd-mNLRdDlu5kA" /> <create resource-type="HUMAN" guid="F270973F-E79D-49B7-A5E6-44D1BC4446AD" > </create> </entityMapping> </map:mapEntities> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <mapEntitiesResponse xmlns="http://mapping.api.de.n2.tibco.com"> <result modified="1" xmlns=""> <resource guid="F270973F-E79D-49B7-A5E6-44D1BC4446AD" name="John Eustace" resource-type="HUMAN" xmlns:map="http://mapping.api.de.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"></resource> </result> </mapEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
518
| Chapter 25
MappingService
getResourceGuid
Create a resource (including assigning a GUID to the resource) without mapping the resource to a group or position. This allows the created resource to log into a BPM application, but not receive work items. (This operation will also return an existing resources name if a resource GUID is passed in, but thats not its primary purpose.). The request must specify the details of the organization model resource (and/or its underlying LDAP entries) that is to be found or created. The response returns the details of the requested organization model resource (whether found or created).
See also: Creating Resources on page 93. Required System Action createResourceAdmin
getResourceGuid 519
Response
520
| Chapter 25
Example
MappingService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:map="http://mapping.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <map:getResourceGuid> <target resource-type="HUMAN" name="Steve Simonsen" > <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Steve Simonsen,ou=London,ou=AllEmployees,o=easyAsInsurance"/> </target> </map:getResourceGuid> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getResourceGuidResponse xmlns="http://mapping.api.de.n2.tibco.com"> <entity guid="3B2CE289-66F0-4539-B9BA-D0C302FD2B31" name="Steve Simonsen" resource-type="HUMAN" xmlns="" xmlns:map="http://mapping.api.de.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <LdapReference container-id="1" container-name="easyAs" ldap-alias="easyAs" ldap-dn="ou=Steve Simonsen,ou=London,ou=AllEmployees,o=easyAsInsurance"/> </entity> </getResourceGuidResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
deleteResource 521
deleteResource
Delete an organization model resource and its associated organization mappings (if any): The request must specify the GUID of the organization model resource to be deleted. The response returns a value indicating whether the specified organization model resource and its organizational associations have been successfully deleted.
522
| Chapter 25
MappingService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <deleteResourceResponse xmlns="http://mapping.api.de.n2.tibco.com"> <successful xmlns="">true</successful> </deleteResourceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
updateCapabilityAssignments 523
updateCapabilityAssignments
Assign capabilities to, or remove capabilities from, one or more organization model resources: The request must specify the capabilities and the organization model resource to be updated, and whether the capability is to be assigned to, or removed from, the resource. The response returns a value indicating whether the specified organization model resources and capabilities have been successfully modified.
524
| Chapter 25
MappingService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <updateCapabilityAssignmentsResponse xmlns="http://mapping.api.de.n2.tibco.com"> <successful xmlns="">true</successful> </updateCapabilityAssignmentsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
OrganisationalEntityConfigService 525
Chapter 26
OrganisationalEntityConfigService
OrganisationalEntityConfigService is one of the Business Resource Management Services provided by Work Manager. Use OrganisationalEntityConfigService requests to manage resource configuration attributes and to get or set them for individual resources.
Topics
getOrgEntityConfigAttributes, page 526 setOrgEntityConfigAttributes, page 528 getOrgEntityConfigAttributesAvailable, page 530 deleteOrgEntityConfigAttributes, page 534
526
| Chapter 26
OrganisationalEntityConfigService
getOrgEntityConfigAttributes
Get the configuration attribute information currently defined for a resource: The request must specify the resource for whom configuration attribute information is required. The response returns the configuration attribute information currently defined for this resource.
getOrgEntityConfigAttributes 527
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getOrgEntityConfigAttributesResponse xmlns="http://api.brm.n2.tibco.com"> <orgEntityConfigAttribute xmlns=""> <attributeName>WorkItemAutoOpen</attributeName> <attributeValue>true</attributeValue> <readOnly>false</readOnly> </orgEntityConfigAttribute> </getOrgEntityConfigAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
528
| Chapter 26
OrganisationalEntityConfigService
setOrgEntityConfigAttributes
Set one or more configuration attributes for a resource: The request must specify the configuration attribute information that should be set and the resource for whom it is to be set. The response returns whether the request succeeded or failed.
Required System Action The autoOpenNextWorkItem system action is required to set the WorkItemAutoOpen attribute.
setOrgEntityConfigAttributes 529
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <setOrgEntityConfigAttributesResponse xmlns="http://api.brm.n2.tibco.com"> <success xmlns="">true</success> </setOrgEntityConfigAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
530
| Chapter 26
OrganisationalEntityConfigService
getOrgEntityConfigAttributesAvailable
Get a list of available configuration attributes that can be applied to an organization model entity: The request must specify how many configuration attributes to return. The response returns a list of the specified number of configuration attributes. Returns the attributeName for each attribute, and whether or not it is read-only.
getOrgEntityConfigAttributesAvailable 531
532
| Chapter 26
Example
OrganisationalEntityConfigService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:getOrgEntityConfigAttributesAvailable> <startAt>0</startAt> <numToReturn>10</numToReturn> </api:getOrgEntityConfigAttributesAvailable> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getOrgEntityConfigAttributesAvailableResponse xmlns="http://api.brm.n2.tibco.com"> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>MaxOpenWorkItemCount</attributeName> <readOnly>false</readOnly> </orgEntityConfigAttributesAvailable> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>WorkItemFilterCriteriaAPI</attributeName> <readOnly>true</readOnly> </orgEntityConfigAttributesAvailable> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>WorkItemOrderCriteriaAPI</attributeName> <readOnly>true</readOnly> </orgEntityConfigAttributesAvailable> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>WorkItemOrderCriteriaPARSED</attributeName> <readOnly>true</readOnly> </orgEntityConfigAttributesAvailable> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>WorkItemOrderCriteriaHQLPARSED </attributeName> <readOnly>true</readOnly> </orgEntityConfigAttributesAvailable> <orgEntityConfigAttributesAvailable xmlns=""> <attributeName>WorkItemAutoOpen</attributeName> <readOnly>false</readOnly> </orgEntityConfigAttributesAvailable> </getOrgEntityConfigAttributesAvailableResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getOrgEntityConfigAttributesAvailable 533
534
| Chapter 26
OrganisationalEntityConfigService
deleteOrgEntityConfigAttributes
Delete one or more configuration attributes for a resource: The request must specify the configuration attributes that should be deleted and the resource from whom they are to be deleted. The response returns whether the request succeeded or failed.
Required System Action The autoOpenNextWorkItem system action is required to delete the WorkItemAutoOpen attribute.
deleteOrgEntityConfigAttributes 535
Response Example
Response:
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <deleteOrgEntityConfigAttributesResponse xmlns="http://api.brm.n2.tibco.com"> <success xmlns="">true</success> </deleteOrgEntityConfigAttributesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
536
| Chapter 26
OrganisationalEntityConfigService
PageFlowService 537
Chapter 27
PageFlowService
PageFlowService is one of the Pageflow Services provided by Work Managers PageFlow Engine. Use the PageFlowService operations to get information about and interact with deployed PageFlows.
Topics
listPageFlows, page 538 startPageFlow, page 541 updatePageFlow, page 544 injectPageFlowEvent, page 548 cancelPageFlow, page 551
538
| Chapter 27
PageFlowService
listPageFlows
List all deployed pageflows. The request requests a list of all deployed pageflows. The response returns the detailed descriptions of the deployed pageflows. The parameter includeFormalParameters determines whether pageflows that have formal parameters are listed or not. See Parameter notes for details. If the parameter includeFormalParameters is not specified, only the pageflows that do not have formal parameters are listed.
listPageFlows 539
Response Example
Response:
<SOAP-ENV:Body> <listPageFlowsResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <totalItems xmlns="">3</totalItems> <pageFlowTemplate hasFormalParameters="true" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" processName="RequestAdditionalDataPageflow" version="1.0.0.201108111516" xmlns=""/> <pageFlowTemplate hasFormalParameters="false" moduleName="/APH_WelcomeUsersImplementSolution/Process Packages/aph_test.xpdl" processName="GetName" version="1.0.0.201108111305" xmlns=""/> <pageFlowTemplate hasFormalParameters="true" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108161050" xmlns=""/> </listPageFlowsResponse> </SOAP-ENV:Body>
540
| Chapter 27
PageFlowService
startPageFlow 541
startPageFlow
Starts an instance of a deployed pageflow. The request identifies the pageflow of which you want to start an instance. The response returns the complete information about the started pageflow instance.
542
| Chapter 27
PageFlowService
startPageFlow 543
Response:
<SOAP-ENV:Body> <startPageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108161050"/> <processReference> <id>pvm:0a101f</id> <name>ProcessPackageProcess</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1f.5" activityModelId="_VK4SIKh8EeCt2PSB39ZXYA" activityName="UserTasks" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" moduleVersion="1.0.0.201108161050" processName="ProcessPackageProcess"/> <payload payloadMode="XML"> <XmlPayload/> </payload> </pageData> </pageResponse> </startPageFlowResponse> </SOAP-ENV:Body>
544
| Chapter 27
PageFlowService
updatePageFlow
Updates a specified pageflow instance. The request identifies the pageflow instance to be updated. You can optionally specify the payload mode and provide the payload in the request message. The response returns the complete information of the updated pageflow instance including the execution state of the pageflow.
updatePageFlow 545
546
| Chapter 27
Example
PageFlowService
Request:
<soapenv:Body> <pag:updatePageFlow> <context> <processReference> <id>pvm:0a10q</id> </processReference> <activityReference activityId="pvm:001gq.5"/> </context> <pageFields feedFormat="NO_FORMAT" feedMode="XML"> <XMLObjectModel> <inputs array="false" name="Names" optional="true" type="Complex"> <simpleSpec/> </inputs> </XMLObjectModel> </pageFields> <responseFeedType> <feedTypes feedFormat="NO_FORMAT" feedMode="XML"/> </responseFeedType> </pag:updatePageFlow> </soapenv:Body>
Response:
<SOAP-ENV:Body> <updatePageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="COMPLETED" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/Inject/Process Packages_Inject/ProcessPackage.xpdl" processName="ProcessPackageProcess" version="1.0.0.201108021509"/> <processReference> <id>pvm:0a10q</id> <name>ProcessPackageProcess</name> </processReference> </context> <pageData> <responseFeed> <XMLObjectModel xmlns:pag="http://pageflow.api.pfe.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <inputs array="false" name="Names" optional="true" type="Complex"> <simpleSpec/> </inputs> </XMLObjectModel> </responseFeed> </pageData> </pageResponse> </updatePageFlowResponse> </SOAP-ENV:Body>
updatePageFlow 547
548
| Chapter 27
PageFlowService
injectPageFlowEvent
Injects an event into an in-progress pageflow. The request identifies the pageflow event to be injected. The response returns the information about the injected pageflow event.
injectPageFlowEvent 549
formalParams: values for the formal parameters that you want to inject. Response Example Returns a injectPageFlowResponse element (from the PageFlowService schema). Request:
<soapenv:Body> <pag:injectPageFlowEvent> <eventDefinition moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess2" eventName="IntermediateEvent" processInstanceId="pvm:0a101u"/> <formalParams payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="false" type="String"> <simpleSpec length="50"> <!--Zero or more repetitions:--> <value>TIBX</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="false" type="Integer Number"> <simpleSpec length="9"> <!--Zero or more repetitions:--> <value>147</value> </simpleSpec> </inputs> </XmlPayload> </formalParams> </pag:injectPageFlowEvent> </soapenv:Body>
550
| Chapter 27
PageFlowService
Response:
<SOAP-ENV:Body> <injectPageFlowEventResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <pageResponse executionState="IN_PROGRESS" xmlns=""> <context> <pageFlowTemplate hasFormalParameters="false" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" processName="EventHandlerProcess2" version="1.0.0.201108161235"/> <processReference> <id>pvm:0a101u</id> <name>EventHandlerProcess2</name> </processReference> </context> <pageData> <pageReference activityId="pvm:001g1u.9" activityModelId="_eMANL720EeC61dgFHyHHpQ" activityName="UserTask3" moduleName="/EventHandler/Process Packages/EventHandler.xpdl" moduleVersion="1.0.0.201108161235" processName="EventHandlerProcess2"/> <payload payloadMode="XML"> <XmlPayload> <inputs array="false" name="Parameter" optional="true" type="String"> <simpleSpec> <value>[Ljava.lang.String;@2818fe57</value> </simpleSpec> </inputs> <inputs array="false" name="Parameter2" optional="true" type="Integer Number"> <simpleSpec> <value>[Ljava.lang.String;@e21652</value> </simpleSpec> </inputs> <inouts array="false" name="Field" optional="true" type="String"> <simpleSpec/> </inouts> </XmlPayload> </payload> </pageData> </pageResponse> </injectPageFlowEventResponse> </SOAP-ENV:Body>
cancelPageFlow 551
cancelPageFlow
Cancels a given pageflow instance. The request identifies the pageflow process instance to be cancelled. The response returns the execution status - SUCCESS when the pageflow is cancelled successfully and a service fault if the execution fails.
Response:
<SOAP-ENV:Body> <cancelPageFlowResponse xmlns="http://pageflow.api.pfe.n2.tibco.com"> <status xmlns="">SUCCESS</status> </cancelPageFlowResponse> </SOAP-ENV:Body>
552
| Chapter 27
PageFlowService
ProcessManagerService 553
Chapter 28
ProcessManagerService
ProcessManagerService is one of the Process Services provided by Process Manager. Use ProcessManagerService operations to manage process templates and process instances.
Topics
cancelProcessInstance, page 555 cancelProcessInstances, page 557 createProcessInstance, page 559 getActivityInstanceStatus, page 562 getParameterValue, page 564 getProcessInstanceStatus, page 566 getProcessInstanceSummary, page 568 getStarterOperationInfo, page 571 listProcessInstanceAttributes, page 574 listSetofProcessInstanceAttributes, page 578 listProcessInstances, page 581 listProcessTemplateAttributes, page 584 listProcessTemplates, page 588 listStarterOperations, page 592 queryDone, page 595 queryFirstPage, page 597 queryLastPage, page 601 queryNextPage, page 604 queryPreviousPage, page 608
TIBCO ActiveMatrix BPM - BPM Developers Guide
554
| Chapter 28
ProcessManagerService
queryProcessInstanceCount, page 612 queryProcessInstances, page 614 queryProcessInstancesAlt, page 617 queryProcessTemplateCount, page 620 queryProcessTemplates, page 622 queryProcessTemplatesAlt, page 626 resumeProcessInstance, page 629 resumeProcessInstances, page 631 setDeadlineExpiration, page 633 setPriority, page 635 suspendProcessInstance, page 637 suspendProcessInstances, page 639 getMigrationPoints, page 641 setMigrationRules, page 644 unsetMigrationRules, page 646 clearMigrationRules, page 648 isSetMigrationRule, page 650 listMigrationRules, page 652
cancelProcessInstance 555
cancelProcessInstance
Cancel a specific process instance. The request must specify the unique ID of the process instance that is to be cancelled. The response indicates whether or not the process instance has been successfully cancelled.
556
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the processID element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service cancelProcessInstance (args) ProcessManagerService
cancelProcessInstances 557
cancelProcessInstances
Cancel all process instances for one or more process templates. The request must specify the process templates for which instances are to be cancelled. The response returns a count of the number of process instances that have been cancelled.
558
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, and version can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:itemCount xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">2</proc:itemCount> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service cancelProcessInstances (args) ProcessManagerService
createProcessInstance 559
createProcessInstance
Create a process instance using a starter operation. The request must specify the starter operation and its associated parameter values that should be used to create the process instance. The response returns the unique ID of the newly created process instance.
560
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the createProcessInstanceInput element (from the ProcessManagement schema) processQName: Can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt. operationName: This is the "starter operation" name, which must be a start event with a trigger type of "None". Can be obtained from listStarterOperations. parameterMap: The names of the "start parameters" (also known as "formal parameters") can be obtained from getStarterOperationInfo. These are used to pass data into the process instance being started.
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:processID xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">pvm:0a1213</proc:processID> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
createProcessInstance 561
Java Method
Method Service createProcessInstance (args) ProcessManagerService
562
| Chapter 28
ProcessManagerService
getActivityInstanceStatus
Get the status of an activity for a particular process instance. The request must specify the activity and process instance for which the status should be returned. The response returns status information for the specified activity. This includes the activityID, which is used when setting a deadline time on an activitysee setDeadlineExpiration.
getActivityInstanceStatus 563
SOAP Operation
Request Parameter notes Response Example Uses the getActivityInstanceStatusInput element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <activityInstanceStatus xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <activityID>pvm:001ib0</activityID> <activityName>EmbeddedSubProcess</activityName> <activityState>waiting.state</activityState> <startTime>2011-07-13T08:51:35.250-07:00</startTime> <completionTime xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <deadlineExpirationTime>2011-07-13T09:51:35.862-07:00</deadlineExpirat ionTime> </activityInstanceStatus> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service getActivityInstanceStatus (args) ProcessManagerService
564
| Chapter 28
ProcessManagerService
getParameterValue
Get the value of a specific parameter (also referred to as "custom attributes") for a particular process instance. The request must specify the parameter and the process instance for which the value should be returned. The response returns the value of the specified parameter.
getParameterValue 565
SOAP Operation
Request Parameter notes Uses the getParameterValueInput element (from the ProcessManagement schema) Response Example processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt. parameterName: Can be obtained from listProcessInstanceAttributes.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getParameterValueOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <parameterValue>509-555-1234</parameterValue> </getParameterValueOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service getParameterValue (args) ProcessManagerService
566
| Chapter 28
ProcessManagerService
getProcessInstanceStatus
Get the status of a particular process instance. The request must specify the ID of the process instance for which status information should be listed. The response returns the status of the specified process instance.
getProcessInstanceStatus 567
SOAP Operation
Request Parameter notes Response Example Uses the processID element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getProcessInstanceStatusOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processQName> <moduleName/> <processName>SalesCallbackProcess</processName> <version/> </processQName> <id>pvm:0a127</id> <state>ACTIVE</state> <startTime>2011-06-28T15:19:38.317-07:00</startTime> <waitingWorkCount>1</waitingWorkCount> <parentProcessID/> </getProcessInstanceStatusOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service getProcessInstanceStatus (args) ProcessManagerService
568
| Chapter 28
ProcessManagerService
getProcessInstanceSummary
Get a full summary report on a specific process instance (this operation is most useful for debugging). The request must specify the ID of the process instance for which summary information should be listed. The response returns (in a formatted string) all information relevant to the specified process instance, including a snapshot of all process variables' values.
getProcessInstanceSummary 569
SOAP Operation
Request Parameter notes Response Example Uses the processID element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <processInstanceSummary xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <summary>Summary for pvm:0a127 Process SalesCallbackProcess, version 1.0.0.201105061158, ACTIVE, active.state Root Task [{TASK}bpelProcessActivity], waiting.state - _BX_flow [{TASK}bpelFlowActivity], waiting.state - Start [{TASK}bpelScopeActivity], done.state - _BX_sequence [{TASK}bpelSequenceActivity], done.state - _BX_receive [{TASK}bpelReceiveActivity], done.state - _BX_assign [{TASK}bpelAssignActivity], done.state - EndEvent [{TASK}bpelEmptyActivity], starting.state - ReturnCall [{TASK}bpelExtensionActivity], waiting.state - Start to ReturnCall [{LINK}bpelLink], from=Start, to=ReturnCall, true.state - ReturnCall to EndEvent [{LINK}bpelLink], from=ReturnCall, to=EndEvent, unset.state</summary> </processInstanceSummary> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method getProcessInstanceSummary (args)
570
| Chapter 28
Service
ProcessManagerService
ProcessManagerService
getStarterOperationInfo 571
getStarterOperationInfo
List the parameter details for a particular starter operation. (Starter operations refer to start events of processes. To be able to directly start an instance of a process template, the start event of the process must have a trigger type of "None" (as opposed to a trigger type of "Message", which requires that the process be started by a business service).) The request must specify the starter operation for which parameter details should be listed. The response returns the details of the of the specified starter operation's parameters.
572
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the starterOperation element (from the ProcessManagement schema) Response Example processQName: Can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt. operationName: Can be obtained from listStarterOperations.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <operationInfo xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <operationName>StartEvent</operationName> <parameters> <templateAttribute> <name>CustomerID</name> <type>java.lang.String</type> </templateAttribute> </parameters> </operationInfo> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getStarterOperationInfo 573
Java Method
Method Service getStarterOperationInfo (args) ProcessManagerService
574
| Chapter 28
ProcessManagerService
listProcessInstanceAttributes
List process instance attributes for one or more process templates (these attributes can be used in process instance queriessee queryProcessInstances and queryProcessInstancesAlt). The request must specify the criteria to be used to identify the process templates for which process instance attributes are to be listed. The response returns details of the process instance attributes associated with the process template specified in the request.
listProcessInstanceAttributes 575
SOAP Operation
Request Parameter notes Response Uses the listProcessInstanceAttributesInput element (from the ProcessManagement schema) processQName: Can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
576
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:listProcessInstanceAttributesInput> <proc:processQName> <proc:moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</proc:moduleName> <proc:processName>WelcomeUsers</proc:processName> <proc:version>1.0.0.201106290831</proc:version> </proc:processQName> <proc:attributeType>FILTERABLE</proc:attributeType> </proc:listProcessInstanceAttributesInput> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <instanceAttributes xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <instanceAttribute> <name>INSTANCE.WAITING_WORK_COUNT</name> <type>integer</type> <processQName> <moduleName/> <processName/> <version/> </processQName> <viewtype>123</viewtype> </instanceAttribute> <instanceAttribute> <name>INSTANCE.VERSION</name> <type>string</type> <processQName> <moduleName/> <processName/> <version/> </processQName> <viewtype>123</viewtype> </instanceAttribute> . . . </instanceAttributes> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listProcessInstanceAttributes 577
Java Method
Method Service listProcessInstanceAttributes (args) ProcessManagerService
578
| Chapter 28
ProcessManagerService
listSetofProcessInstanceAttributes
List process instance attributes for a set of process templates (these attributes can be used in process instance queriessee queryProcessInstances and queryProcessInstancesAlt). The request must specify the process templates for which process instance attributes are to be listed. The response returns details of both the system-defined and user-defined attributes in the specified process instance(s).
listSetofProcessInstanceAttributes 579
SOAP Operation
Request Parameter notes Response Example Uses the listSetofProcessInstanceAttributesInput element (from the ProcessManagement schema) qualifiedProcessNames: Consists of one or more qualifiedProcessName elements, which can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
580
| Chapter 28
ProcessManagerService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <instanceAttributes xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <instanceAttribute> <name>INSTANCE.PRIORITY</name> <type>short</type> <processQName> <moduleName/> <processName/> <version/> </processQName> <viewtype>123</viewtype> </instanceAttribute> <instanceAttribute> <name>ContactName</name> <type>string</type> <processQName> <moduleName>/SalesCallback/Process Packages/SalesCallback.xpdl</moduleName> <processName>SalesCallbackProcess</processName> <version>1.0.0.201105061158</version> </processQName> <viewtype>123</viewtype> </instanceAttribute> . . . <instanceAttribute> <name>MODULE.NAME</name> <type>string</type> <processQName> <moduleName/> <processName/> <version/> </processQName> <viewtype>123</viewtype> </instanceAttribute> </instanceAttributes> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service listSetofProcessInstanceAttributes (args) ProcessManagerService
listProcessInstances 581
listProcessInstances
List process instances for one or more process templates. This is a convenience operation: queryProcessInstances can return the same information, but requires more input. The request must specify the process templates for which process instances are to be listed. The response returns the process instances that exist for the specified process template.
582
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, and version: Can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <processInstances xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstance> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290731</version> </processQName> <id>pvm:0a12e</id> <state>ACTIVE</state> <startTime>2011-06-29T07:33:04.377-07:00</startTime> <completionTime xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <waitingWorkCount>1</waitingWorkCount> <parentProcessID/> </processInstance> </processInstances> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listProcessInstances 583
Java Method
Method Service listProcessInstances (args) ProcessManagerService
584
| Chapter 28
ProcessManagerService
listProcessTemplateAttributes
List process template attributes. These attributes, which are pre-defined variables and are the same for all process templates, can be used in queries for process templatessee queryProcessTemplates and queryProcessTemplatesAlt The request must specify any filter criteria to be used, to list only filterable, sortable or displayable attributes. The response returns only system-defined attributes (as name/type pairs) that match the specified filter.
listProcessTemplateAttributes 585
SOAP Operation
Request Parameter notes Response Uses the listProcessTemplateAttributesInput element (from the ProcessManagement schema) attributeType: FILTERABLE, SORTABLE, or DISPLAYABLE; or leave empty for all attribute types.
586
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:listProcessTemplateAttributesInput> <proc:attributeType>FILTERABLE</proc:attributeType> </proc:listProcessTemplateAttributesInput> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <templateAttributes xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <templateAttribute> <name>DEFINITION.PRIORITY</name> <type>short</type> </templateAttribute> <templateAttribute> <name>DEFINITION.DESCRIPTION</name> <type>string</type> </templateAttribute> <templateAttribute> <name>DEFINITION.VERSION</name> <type>string</type> </templateAttribute> <templateAttribute> <name>DEFINITION.NAME</name> <type>string</type> </templateAttribute> <templateAttribute> <name>MODULE.NAME</name> <type>string</type> </templateAttribute> <templateAttribute> <name>DEFINITION.CREATION_DATE</name> <type>dateTime</type> </templateAttribute> </templateAttributes> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method listProcessTemplateAttributes (args)
listProcessTemplateAttributes 587
Service
ProcessManagerService
588
| Chapter 28
ProcessManagerService
listProcessTemplates
List process templates that match the input criteria. This is a convenience operation: queryProcessTemplates can return the same information, but requires more input. The request must specify the search criteria for which matching process templates should be listed. The response returns the process templates that match the specified criteria.
listProcessTemplates 589
SOAP Operation
Request Parameter notes Response Uses the qualifiedProcessName element (from the ProcessManagement schema) None Returns a basicProcessTemplates element (from the ProcessManagement schema)
590
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName>/Acme-SubProcs/Process Packages/AcmeSubProcs.xpdl</proc:moduleName> <proc:processName></proc:processName> <proc:version></proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <basicProcessTemplates xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <basicProcessTemplate> <processQName> <moduleName>/Acme-SubProcs/Process Packages/AcmeSubProcs.xpdl</moduleName> <processName>Sub1</processName> <version>1.1.0.201105061158</version> </processQName> <description>*** Generated by TIBCO Business Studio.</description> </basicProcessTemplate> <basicProcessTemplate> <processQName> <moduleName>/Acme-SubProcs/Process Packages/AcmeSubProcs.xpdl</moduleName> <processName>Main</processName> <version>1.1.0.201105061158</version> </processQName> <description>*** Generated by TIBCO Business Studio.</description> </basicProcessTemplate> </basicProcessTemplates> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method listProcessTemplates (args)
listProcessTemplates 591
Service
ProcessManagerService
592
| Chapter 28
ProcessManagerService
listStarterOperations
List available starter operations for one or more process templates (see also: createProcessInstance). (Starter operations refer to start events of processes. To be able to directly start an instance of a process template, the start event of the process must have a trigger type of "None" (as opposed to a trigger type of "Message", which requires that the process be started by a business service).) The request must specify the process templates for which starter operations are to be listed. The response returns all starter operations defined for the specified process templates.
listStarterOperations 593
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, and version: Can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <starterOperations xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <starterOperation> <processQName> <moduleName>/HelpDesk/Process Packages/HelpDesk.xpdl</moduleName> <processName>InternalHelpDesk</processName> <version>1.0.0.201105061158</version> </processQName> <operation>StartEvent</operation> </starterOperation> </starterOperations> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method listStarterOperations (args)
594
| Chapter 28
Service
ProcessManagerService
ProcessManagerService
queryDone 595
queryDone
Release all resources associated with a particular paged result set. An application must call this operation whenever it has finished with a particular paged result set. The request must specify the paging ID of the result set which is no longer required. The response indicates whether or not the resources associated with the specified result set have been successfully released.
596
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the pagingID element (from the ProcessManagement schema) pagingID: This is obtained when a query is paged by submitting -1 or a number greater than 0 for the PageSize parameter when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt.
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryDone (args) ProcessManagerService
queryFirstPage 597
queryFirstPage
List the first page of data from the result set of a particular query operation. The request must specify the paging ID of the result set for which the first page of data should be listed. The response returns a page of data, which will be a list of either process templates or process instances, depending on the originating call.
598
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the pagingID element (from the ProcessManagement schema) pagingID: This is obtained when a query is paged by submitting -1 or a number greater than 0 for the PageSize parameter when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt.
Response
queryFirstPage 599
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:pagingID>1304896907</proc:pagingID> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <page xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <processQName> <processName>SalesCallbackProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>TestNoneStarter</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>parallelProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> </processInstance> </processInstances> </page> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
600
| Chapter 28
ProcessManagerService
Java Method
Method Service queryFirstPage (args) ProcessManagerService
queryLastPage 601
queryLastPage
List the last page of data from the result set of a particular query operation. The request must specify the paging ID of the result set for which the last page of data should be listed. The response returns a page of data, which will be a list of either process templates or process instances, depending on the originating call.
602
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the pagingID element (from the ProcessManagement schema) pagingID: This is obtained when a query is paged by submitting -1 or a number greater than 0 for the PageSize parameter when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt.
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <page xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <processQName> <processName>parallelProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>parallelProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>WithdrawProcess</processName> </processQName> </processInstance> </processInstances> </page> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryLastPage 603
Java Method
Method Service queryLastPage (args) ProcessManagerService
604
| Chapter 28
ProcessManagerService
queryNextPage
List the next page of data from the result set of a particular query operation. The request must specify the paging ID of the result set for which the next page of data should be listed. The response returns a page of data, which will be a list of either process templates or process instances, depending on the originating call.
queryNextPage 605
SOAP Operation
Request Parameter notes Uses the pagingID element (from the ProcessManagement schema) pagingID: This is obtained when a query is paged by submitting -1 or a number greater than 0 for the PageSize parameter when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt.
Response
606
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:pagingID>1304896907</proc:pagingID> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <page xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <processQName> <processName>WelcomeUsers</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>HelpDeskProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>SalesCallbackProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>WithdrawProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> </processInstance> </processInstances> </page> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryNextPage 607
Java Method
Method Service queryNextPage (args) ProcessManagerService
608
| Chapter 28
ProcessManagerService
queryPreviousPage
List the previous page of data from the result set of a particular query operation. The request must specify the paging ID of the result set for which the previous page of data should be listed. The response returns a page of data, which will be a list of either process templates or process instances, depending on the originating call.
queryPreviousPage 609
SOAP Operation
Request Parameter notes Uses the pagingID element (from the ProcessManagement schema) pagingID: This is obtained when a query is paged by submitting -1 or a number greater than 0 for the PageSize parameter when calling the following operations: queryProcessInstances, queryProcessInstancesAlt, queryProcessTemplates, and queryProcessTemplatesAlt.
Response
610
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:pagingID>1304896907</proc:pagingID> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <page xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <processQName> <processName>SalesCallbackProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>TestNoneStarter</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>parallelProcess</processName> </processQName> </processInstance> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> </processInstance> </processInstances> </page> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryPreviousPage 611
Java Method
Method Service queryPreviousPage (args) ProcessManagerService
612
| Chapter 28
ProcessManagerService
queryProcessInstanceCount
Count the number of process instances that match certain criteria. The request must specify a SQL query that defines the search criteria. The response returns the number of process instances that match the specified criteria.
queryProcessInstanceCount 613
SOAP Operation
Request Parameter notes Response Example Uses the queryString element (from the ProcessManagement schema) queryString: For information about valid query strings, see Sorting and Filtering Lists of Process Templates and Instances on page 151.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:itemCount xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">7</proc:itemCount> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryProcessInstanceCount (args) ProcessManagerService
614
| Chapter 28
ProcessManagerService
queryProcessInstances
Query information about process instances that match specified criteria. The request must specify a SQL query that defines the search criteria. The response returns information from process instances according to the specified criteria, either as a complete list or as the first page of a paged list (in which case a paging ID is also returned).
queryProcessInstances 615
SOAP Operation
Request Parameter notes Uses the queryProcessInstancesInput element (from the ProcessManagement schema) query: For information about valid SQL syntax, see Sorting and Filtering Lists of Process Templates and Instances on page 151. attributeMap: If a user-defined attribute is used in the SELECT statement of a paginated query, that attribute and its type should be included in the attributeMap, otherwise a database query must be made to get the type of the user-defined attribute, making the request less efficient (see the example below). pageSize: If you specify a paged result (pageSize = -1 or a number greater than 0), use the queryFirstPage, queryLastPage, queryNextPage, and queryPreviousPage operations to navigate the paged list, and queryDone to clear resources when you are finished with the paged list. (Note that the result limit for non-paginated queries (pageSize=0) is 500.)
Response Example
616
| Chapter 28
ProcessManagerService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessInstancesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <customAttributes> <customAttribute> <name>ContactName</name> <value>Ira Olson</value> </customAttribute> </customAttributes> </processInstance> <processInstance> <customAttributes> <customAttribute> <name>ContactName</name> <value>Walter Burfiend</value> </customAttribute> </customAttributes> </processInstance> </processInstances> <pagingID>-1859988354</pagingID> </queryProcessInstancesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryProcessInstances (args) ProcessManagerService
queryProcessInstancesAlt 617
queryProcessInstancesAlt
Query information about process instances that match specified criteria. This is a variation of queryProcessInstances, in which the query string is divided into its constituent parts. The request must specify an SQL query that defines the search criteria The response returns information from process instances according to the specified criteria, either as a complete list or as the first page of a paged list (in which case a paging ID is also returned).
618
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the queryProcessInstancesAltInput element (from the ProcessManagement schema) select, where, orderBy: For information about valid SQL syntax, see Sorting and Filtering Lists of Process Templates and Instances on page 151. attributeMap: If a user-defined attribute is used in the select parameter of a paginated query, that attribute and its type should be incudes in the attributeMap, otherwise a database query must be made to get the type of the user-defined attribute, making the request less efficient (see the example below). pageSize: If you specify a paged result (pageSize = -1 or a number greater than 0), use the queryFirstPage, queryLastPage, queryNextPage, and queryPreviousPage operations to navigate the paged list, and queryDone to clear resources when you are finished with the paged list. (Note that the result limit for non-paginated queries (pageSize=0) is 500.)
Response Example
queryProcessInstancesAlt 619
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessInstancesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processInstances> <processInstance> <processQName> <processName>InternalHelpDesk</processName> </processQName> <id>pvm:0a12u</id> <customAttributes> <customAttribute> <name>Issue</name> <value>Forgot password</value> </customAttribute> </customAttributes> </processInstance> </processInstances> <pagingID>-94865740</pagingID> </queryProcessInstancesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryProcessInstancesAlt (args) ProcessManagerService
620
| Chapter 28
ProcessManagerService
queryProcessTemplateCount
Count the number of process templates that match certain criteria. The request must specify an SQL query that defines the search criteria. The response returns the number of process templates that match the specified criteria.
queryProcessTemplateCount 621
SOAP Operation
Request Parameter notes Response Example Uses the queryString element (from the ProcessManagement schema) queryString: For information about valid query strings, see Sorting and Filtering Lists of Process Templates and Instances on page 151.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:itemCount xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">2</proc:itemCount> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryProcessTemplateCount (args) ProcessManagerService
622
| Chapter 28
ProcessManagerService
queryProcessTemplates
Query information about process templates that match specified criteria. The request must specify an SQL query that defines the search criteria. The response returns information from process templates according to the specified criteria, either as a complete list or as the first page of a paged list (in which case a paging ID is also returned).
Also see queryProcessTemplatesAlt for an alternative method of querying process templates. Required System Action queryProcessTemplate
queryProcessTemplates 623
SOAP Operation
Request Parameter notes Uses the queryProcessTemplatesInput element (from the ProcessManagement schema) query: For information about valid SQL syntax, see Sorting and Filtering Lists of Process Templates and Instances on page 151. pageSize: If you specify a paged result (pageSize = -1 or a number greater than 0), use the queryFirstPage, queryLastPage, queryNextPage, and queryPreviousPage operations to navigate the paged list, and queryDone to clear resources when you are finished with the paged list. (Note that the result limit for non-paginated queries (pageSize=0) is 500.)
Response
624
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:queryProcessTemplatesInput> <proc:query>SELECT * FROM process WHERE DEFINITION.NAME='WelcomeUsers' ORDER BY DEFINITION.VERSION</proc:query> <proc:pageSize>0</proc:pageSize> </proc:queryProcessTemplatesInput> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessTemplatesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processTemplates> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290731</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T07:29:58.943-07:00</creationTime> </processTemplate> <processTemplate> <basicTemplate> <processQName> <moduleName>/WelcomeUsersDesignSolution/Process Packages/ProcessPackage.xpdl</moduleName> <processName>WelcomeUsers</processName> <version>1.0.0.201106290831</version> </processQName> <description/> </basicTemplate> <priority>NORMAL</priority> <creationTime>2011-06-29T08:30:30.543-07:00</creationTime> </processTemplate> </processTemplates> <pagingID>0</pagingID> </queryProcessTemplatesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
queryProcessTemplates 625
Java Method
Method Service queryProcessTemplates (args) ProcessManagerService
626
| Chapter 28
ProcessManagerService
queryProcessTemplatesAlt
List process templates that match certain criteria. (This is a variation of queryProcessTemplates in which the query string is divided into its constituent parts.) The request must specify an SQL query that defines the search criteria. The response returns the process templates that match the specified criteria, either as a complete list or as the first page of a paged list (in which case a paging ID is also returned).
queryProcessTemplatesAlt 627
SOAP Operation
Request Parameter notes Uses the queryProcessTemplatesAltInput element (from the ProcessManagement schema) select, where, orderBy: For information about valid SQL syntax, see Sorting and Filtering Lists of Process Templates and Instances on page 151. pageSize: If you specify a paged result (pageSize = -1 or a number greater than 0), use the queryFirstPage, queryLastPage, queryNextPage, and queryPreviousPage operations to navigate the paged list, and queryDone to clear resources when you are finished with the paged list. (Note that the result limit for non-paginated queries (pageSize=0) is 500.)
Response
628
| Chapter 28
Example
ProcessManagerService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:queryProcessTemplatesAltInput> <proc:select>DEFINITION.CREATION_DATE</proc:select> <proc:where>DEFINITION.NAME='WelcomeUsers'</proc:where> <proc:orderBy></proc:orderBy> <proc:pageSize>0</proc:pageSize> </proc:queryProcessTemplatesAltInput> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <queryProcessTemplatesOutput xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <processTemplates> <processTemplate> <creationTime>2011-06-29T07:29:58.943-07:00</creationTime> </processTemplate> <processTemplate> <creationTime>2011-06-29T08:30:30.543-07:00</creationTime> </processTemplate> </processTemplates> <pagingID>0</pagingID> </queryProcessTemplatesOutput> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service queryProcessTemplatesAlt (args) ProcessManagerService
resumeProcessInstance 629
resumeProcessInstance
Resume a previously suspended process instance. See also: suspendProcessInstance and suspendProcessInstances. The request must specify the unique ID of the process instance that is to be resumed. The response indicates whether or not the process instance has been successfully resumed.
630
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the processID element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service resumeProcessInstance (args) ProcessManagerService
resumeProcessInstances 631
resumeProcessInstances
Resume all process instances for one or more process templates. See also: suspendProcessInstance and suspendProcessInstances. The request must specify the process templates for which instances are to be resumed. The response returns a count of the number of process instances that have been resumed.
632
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, version: These parameters can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:itemCount xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">2</proc:itemCount> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service resumeProcessInstances (args) ProcessManagerService
setDeadlineExpiration 633
setDeadlineExpiration
Change the deadline value for an activity. The request must specify the activity ID for which the deadline value is to be changed. The response indicates whether or not the specified deadline has been successfully set.
An active deadline must be in use (that is, it cannot be expired) on an activity (using an intermediate timer event) to be able to set the expiration time with this operation. Required System Action setDeadlineExpiration
634
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Uses the setDeadlineExpirationInput element (from the ProcessManagement schema) activityID: Can be obtained from getActivityInstanceStatus. expirationTime: The current deadline date/time value for an activity can be obtained from getActivityInstanceStatus.
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service setDeadlineExpiration (args) ProcessManagerService
setPriority 635
setPriority
Change the scheduling priority for execution of a process instance. The request must specify the process instance for which the priority is to be set, as well as the new priority level. The response indicates whether or not the specified deadline has been successfully set.
636
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the setPriorityInput element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service setPriority (args) ProcessManagerService
suspendProcessInstance 637
suspendProcessInstance
Suspend a process instance from being scheduled for execution. See also: resumeProcessInstance and resumeProcessInstances. The request must specify the unique ID of the process instance that is to be suspended. The response indicates whether or not the specified deadline has been successfully set.
638
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the processID element (from the ProcessManagement schema) processID: Can be obtained from listProcessInstances, queryProcessInstances, and queryProcessInstancesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service suspendProcessInstance (args) ProcessManagerService
suspendProcessInstances 639
suspendProcessInstances
Suspend all process instances for one or more process templates from being scheduled for execution. See also: resumeProcessInstance and resumeProcessInstances. The request must specify the process templates for which instances are to be suspended. The response returns a count of the number of process instances that have been suspended.
640
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, version: These parameters can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:itemCount xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">2</proc:itemCount> </SOAP-ENV:Body> </SOAP-ENV:Envelope
Java Method
Method Service suspendProcessInstances (args) ProcessManagerService
getMigrationPoints 641
getMigrationPoints
List the permissible process instance migration points for one or more process templates. (Migration points are the points in the process from which a process instance can be migrated to a different version.) For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the process templates for which process instance migration points are to be listed. The response returns the valid process instance migration points for the specified process templates.
642
| Chapter 28
ProcessManagerService
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) moduleName, processName, version: These parameters can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt.
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <migrationPoints xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <module name="/HelpDesk/Process Packages/HelpDesk.xpdl" version="1.0.0.201105061158"> <process name="InternalHelpDesk"> <task name="EnterIssue"/> <task name="Complete"/> <task name="EnterResolution"/> <task name="EndEvent"/> </process> </module> </migrationPoints> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method getMigrationPoints (args)
getMigrationPoints 643
Service
ProcessManagerService
644
| Chapter 28
ProcessManagerService
setMigrationRules
Set one or more process instance migration rules. (Each migration rule consists of a unique set of module name, module version from which to migrate, process template name, task name from which to migrate, and module version to which to migrate.) For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the process instance migration rules that are to be set. The response returns whether the specified process instance migration rules have been successfully set.
setMigrationRules 645
SOAP Operation
Request Parameter notes Uses the migrationRules element (from the ProcessManagement schema) The module, process template, and version information can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt. The task being used as the migration point can be obtained from getMigrationPoints. Response Example Returns a success element (from the ProcessManagement schema) Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:migrationRules> <!--Zero or more repetitions:--> <proc:module name="/HelpDesk/Process Packages/HelpDesk.xpdl" version="1.0.0.201105061158"> <!--Zero or more repetitions:--> <proc:process name="InternalHelpDesk"> <!--Zero or more repetitions:--> <proc:migrate fromTask="EnterIssue" toVersion="1.0.0.201107140929" description="Added history check"/> </proc:process> </proc:module> </proc:migrationRules> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service setMigrationRules (args) ProcessManagerService
646
| Chapter 28
ProcessManagerService
unsetMigrationRules
Unset one or more currently set process instance migration rules. For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the process instance migration rules that are to be unset. The response returns whether the specified process instance migration rules have been successfully unset.
unsetMigrationRules 647
SOAP Operation
Request Parameter notes Response Example Uses the migrationRules element (from the ProcessManagement schema) The process instances that have migration rules set can be obtained using the listMigrationRules operation. Returns a success element (from the ProcessManagement schema) Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:migrationRules> <!--Zero or more repetitions:--> <proc:module name="/HelpDesk/Process Packages/HelpDesk.xpdl" version="1.0.0.201105061158"> <!--Zero or more repetitions:--> <proc:process name="InternalHelpDesk"> <!--Zero or more repetitions:--> <proc:migrate fromTask="EnterIssue" toVersion="1.0.0.201107140929" description="Added history check"/> </proc:process> </proc:module> </proc:migrationRules> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service unsetMigrationRules (args) ProcessManagerService
648
| Chapter 28
ProcessManagerService
clearMigrationRules
Clear all currently set process instance migration rules for one or more process templates. For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the process templates for which process instance migration rules are to be cleared. The response returns whether all process instance migration rules have been successfully unset for the specified process templates.
clearMigrationRules 649
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedProcessName element (from the ProcessManagement schema) The process instances that have migration rules set can be obtained using the listMigrationRules operation. Returns a success element (from the ProcessManagement schema) Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:qualifiedProcessName> <proc:moduleName>/HelpDesk/Process Packages/HelpDesk.xpdl</proc:moduleName> <proc:processName>InternalHelpDesk</proc:processName> <proc:version>1.0.0.201105061158</proc:version> </proc:qualifiedProcessName> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:success xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">OK</proc:success> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service clearMigrationRules (args) ProcessManagerService
650
| Chapter 28
ProcessManagerService
isSetMigrationRule
Test whether any process instance migration rules are set for a particular qualified task name. For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the qualified task name that is to be tested. (The qualified task name includes the task name and its parent process template, module and template/module version). The response returns whether any process instance migration rules are currently set for the specified qualified task name.
isSetMigrationRule 651
SOAP Operation
Request Parameter notes Response Example Uses the qualifiedTaskName element (from the ProcessManagement schema) The module, process template, and version information can be obtained from listProcessTemplates, queryProcessTemplates, and queryProcessTemplatesAlt. Returns a isSet element (from the ProcessManagement schema) Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType "> <soapenv:Header/> <soapenv:Body> <proc:qualifiedTaskName> <proc:moduleName>/HelpDesk/Process Packages/HelpDesk.xpdl</proc:moduleName> <proc:processName>InternalHelpDesk</proc:processName> <proc:version>1.0.0.201105061158</proc:version> <proc:taskName>EnterIssue</proc:taskName> </proc:qualifiedTaskName> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <proc:isSet xmlns:proc="http://www.tibco.com/bx/2009/management/processManagerType ">true</proc:isSet> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Java Method
Method Service isSetMigrationRule (args) ProcessManagerService
652
| Chapter 28
ProcessManagerService
listMigrationRules
List the process instance migration rules that are set for one or more process templates. For information about process migration, see Migrating a Process Instance to a Different Version on page 161. The request must specify the process templates for which process instance migration rules are to be listed. The response returns the process instance migration rules that are set for the specified process templates.
listMigrationRules 653
Response:
The response when migration rules are not set: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <migrationRuleList xmlns="http://www.tibco.com/bx/2009/management/processManagerType"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope> The response when migration rules are set: <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <migrationRuleList xmlns="http://www.tibco.com/bx/2009/management/processManagerType"> <module name="/HelpDesk/Process Packages/HelpDesk.xpdl" version="1.0.0.201105061158"> <process name="InternalHelpDesk"> <migrate creationTime="2011-07-14T09:38:50.773-07:00" description="Added history check" fromTask="EnterIssue" toVersion="1.0.0.201107140929"/> </process> </module> </migrationRuleList> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
654
| Chapter 28
ProcessManagerService
ResourceQueryService 655
Chapter 29
ResourceQueryService
ResourceQueryService is one of the Directory Services provided by Work Manager. Use ResourceQueryService requests to execute a Resource Query Language (RQL) query to find a set of resources that match specific criteria.
Topics
executeQuery, page 656
656
| Chapter 29
ResourceQueryService
executeQuery
Execute a Resource Query Language (RQL) query to find a set of resources that match specific criteria: The request must specify the query to be executed. The response returns the unique IDs of resources matching the supplied criteria.
executeQuery 657
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <executeQueryResponse xmlns="http://resourcequery.api.de.n2.tibco.com"> <resource guid="846D100C-77C8-42DE-BD01-C23D214D2BB4" name="Liam Lawrence" push-enabled="false" xmlns=""/> <resource guid="3D9296E1-B1F8-4A09-A219-0285D43B3498" name="Tony Pulis" push-enabled="false" xmlns=""/> <resource guid="931F96FA-EC57-43B5-AA61-613784B1BD10" name="Leon Court" push-enabled="false" xmlns=""/> <resource guid="9DDA518C-3323-4656-B730-9C186E4ADC01" name="John Eustace" push-enabled="false" xmlns=""/> <resource guid="6C7C4DED-A214-4D00-839A-0DAA33FF64A4" name="Steve Simonsen" push-enabled="false" xmlns=""/> </executeQueryResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
658
| Chapter 29
ResourceQueryService
SecurityService 659
Chapter 30
SecurityService
SecurityService is one of the Directory Services provided by Work Manager. Use SecurityService requests to manage user authorization.
Topics
authenticateUser, page 660 getUserPrivileges, page 661 isActionAuthorised, page 664 listActionAuthorisedEntities, page 667 listAuthorisedOrgs, page 669
660
| Chapter 30
SecurityService
authenticateUser
This operation has been deprecated and should no longer be used. It is only available for backward compatibility, and may be removed in a future release.
getUserPrivileges 661
getUserPrivileges
List the privileges currently assigned to a specific user: The request must specify the unique ID of the user whose privileges should be listed. The response returns the privileges currently assigned to the specified user.
662
| Chapter 30
SecurityService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getUserPrivilegesResponse user-guid="7AAB6AE7-CA2E-4211-BBF8-E081659526FE" xmlns="http://security.api.de.n2.tibco.com"> <Privilege entity-type="PRIVILEGE" guid="_AzyDoF-JEd-rno5lLiXABg" name="SuperviseSalesReps" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_J8v90F-KEd-rno5lLiXABg" name="SuperviseReception" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_-QxUUF-IEd-rno5lLiXABg" name="SuperviseITReps" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_80Y14F-IEd-rno5lLiXABg" name="SuperviseITManagers" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_HIl0IF-KEd-rno5lLiXABg" name="SuperviseVPs" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_I8YiEMpSEd64gM7QE8RwxA" name="BaseUser" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_CTAasF-JEd-rno5lLiXABg" name="SuperviseSalesManagers" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_M1FR8MpSEd64gM7QE8RwxA" name="SuperviseCSManagers" xmlns=""/> <Privilege entity-type="PRIVILEGE" guid="_PQMpgMpSEd64gM7QE8RwxA" name="SuperviseCSReps" xmlns=""/> </getUserPrivilegesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getUserPrivileges 663
664
| Chapter 30
SecurityService
isActionAuthorised
Test whether the caller (as identified by the SOAP security header) is authorized to perform one or more system actions, either globally or within the scope of a particular organization model entity: The request must specify the system actions to be tested for authorization and, optionally, an organization model entity that defines the scope of the test. The response returns a list of the requested system actions, defining for each its scope and whether the user is authorized to perform the system action.
isActionAuthorised 665
Returns a isActionAuthorisedResponse element (from the SecurityService schema). Note that if multiple system actions are passed in the request, a results of: true means that the caller is authorized to perform all of the specified actions. false means that the caller is authorized to perform some, or none, of the specified actions.
666
| Chapter 30
Example
SecurityService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://security.api.de.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <sec:isActionAuthorised fault-on-unauthorised="false"> <scope model-version="-1" entity-type="POSITION" guid="_9y7hYMpREd64gM7QE8RwxA" /> --> <action component="BRM" name="viewWorkList"/> </sec:isActionAuthorised> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <isActionAuthorisedResponse overall="true" xmlns="http://security.api.de.n2.tibco.com"> <scope entity-type="POSITION" guid="_9y7hYMpREd64gM7QE8RwxA" model-version="-1" xmlns="" xmlns:sec="http://security.api.de.n2.tibco.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/> <action authorised="true" component="BRM" name="viewWorkList" xmlns=""/> </isActionAuthorisedResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listActionAuthorisedEntities 667
listActionAuthorisedEntities
List the organization model entities on which the caller (as determined by the SOAP security header) is authorized to perform a specific system action. The request must specify the system action for which the caller's authorizations should be listed. The response returns a list of the guids of organization model entities on which the user is authorized to perform the request.
668
| Chapter 30
SecurityService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listActionAuthorisedEntitiesResponse xmlns="http://security.api.de.n2.tibco.com"> <guid xmlns="">_aT_UMifLEeChutsy_vK9tg</guid> <guid xmlns="">_fE8zxSfJEeChutsy_vK9tg</guid> <guid xmlns="">_i1LeoCrrEeCEDr7D0P9b2w</guid> <guid xmlns="">_QIgJwHT9EeC85dHJry9Pug</guid> <guid xmlns="">_CWsngMpSEd64gM7QE8RwxA</guid> <guid xmlns="">_HF-LkHT4EeC85dHJry9Pug</guid> <guid xmlns="">_lcnV0CfIEeChutsy_vK9tg</guid> <guid xmlns="">_P0fAkDBTEd-x4cVy01Xlww</guid> . . . </listActionAuthorisedEntitiesResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listAuthorisedOrgs 669
listAuthorisedOrgs
List the organizations on which the caller (as determined by the SOAP security header) is authorized to perform a specific system action: The request must specify the system action for which the caller's authorizations should be listed. The response returns the unique IDs of organizations on which the user is authorized to perform the requested system action.
Note that in addition to testing the named system action, this operation limits the organizations to those to which the calling user has access (because of organization relationships). For more information, see Organization Relationships on page 123. Required System Action None
670
| Chapter 30
SecurityService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listAuthorisedOrgsResponse all-organizations="true" xmlns="http://security.api.de.n2.tibco.com"> <guid xmlns="">_5fLygDBSEd-x4cVy01Xlww</guid> <guid xmlns="">_iPYXscpPEd64gM7QE8RwxA</guid> <guid xmlns="">_tf5fgSe3EeCoD7MklYZAuw</guid> <guid xmlns="">_jGi_kcxxEd-nOYM9N6WPrw</guid> <guid xmlns="">_-SS8MDBSEd-x4cVy01Xlww</guid> </listAuthorisedOrgsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
UserSettingsService 671
Chapter 31
UserSettingsService
UserSettingsService is one of the Directory Services provided by Work Manager. Use UserSettingsService requests to manage user settings.
Topics
saveUserSettings, page 672 getUserSettings, page 675 deleteUserSettings, page 677 listUserSettingIds, page 679
672
| Chapter 31
UserSettingsService
saveUserSettings
Save one or more user settings (name/value pairs) for a specific storageKey and settingID: The request must specify the user settings (name/value pairs) to be stored and the associated storageKey and settingID. The response returns an empty document if the user settings were successfully stored.
User settings allow the BPM application to store any name/value pairs on the server for later retrieval (using the getUserSettings operation). Required System Action userAdmin
saveUserSettings 673
Response Example
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <saveUserSettingsResponse xmlns="http://usersettingsservice.api.de.n2.tibco.com"> <empty xmlns="">0</empty> </saveUserSettingsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
674
| Chapter 31
UserSettingsService
getUserSettings 675
getUserSettings
List the user settings (name/value pairs) currently defined for a specific storageKey and settingID: The request must specify the storageKey and settingID for which user settings should be listed. The response returns the user settings (name/value pairs) currently defined for the specified specific storageKey and settingID.
676
| Chapter 31
UserSettingsService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getUserSettingsResponse xmlns="http://usersettingsservice.api.de.n2.tibco.com"> <settingProperties Name="listSize" Value="20" xmlns=""/> <settingProperties Name="caption" Value="Description" xmlns=""/> <settingProperties Name="winSize" Value="600,400" xmlns=""/> <settingProperties Name="layout" Value="tabbed" xmlns=""/> </getUserSettingsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
deleteUserSettings 677
deleteUserSettings
Delete all user settings (name/value pairs) currently defined for a specific storageKey: The request must specify the storageKey for which user settings should be deleted. The response returns an empty document if the user settings were successfully deleted.
678
| Chapter 31
UserSettingsService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <deleteUserSettingsResponse xmlns="http://usersettingsservice.api.de.n2.tibco.com"> <empty xmlns="">0</empty> </deleteUserSettingsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
listUserSettingIds 679
listUserSettingIds
List all user settingIDs currently defined for a specific storageKey: The request must specify the storageKey for which user settingIDs should be listed. The response returns the user settingIDs currently defined for the specified storageKey.
680
| Chapter 31
UserSettingsService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <listUserSettingIdsResponse xmlns="http://usersettingsservice.api.de.n2.tibco.com"> <settingId xmlns="">viewSettings</settingId> <settingId xmlns="">workFlow</settingId> </listUserSettingIdsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
WorkItemManagementService 681
Chapter 32
WorkItemManagementService
WorkItemManagementService is one of the Business Resource Management Services provided by Work Manager. Use WorkItemManagementService requests to perform actions on work items.
Topics
getWorkItemHeader, page 682 openWorkItem, page 685 closeWorkItem, page 688 allocateWorkItem, page 692 allocateAndOpenWorkItem, page 695 allocateAndOpenNextWorkItem, page 699 unallocateWorkItem, page 703 completeWorkItem, page 706 skipWorkItem, page 710 reallocateWorkItem, page 712 reallocateWorkItemData, page 715 getOfferSet, page 719 saveOpenWorkItem, page 721 pendWorkItem, page 725
682
| Chapter 32
WorkItemManagementService
getWorkItemHeader
Get the header information for a specific work item: Identifies the work item for which header information is required. The response returns the work item header information.
getWorkItemHeader 683
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getWorkItemHeaderResponse xmlns="http://api.brm.n2.tibco.com"> <workItemHeader distributionStrategy="OFFER" priority="50" xmlns=""> <name>ServicingMgr</name> <description>ServicingMgr</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i1m</activityID> <activityName>ServicingMgr</activityName> <appInstance>pvm:0a124</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>SrvCall</appInstanceDescription> </itemContext> </workItemHeader> </getWorkItemHeaderResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
684
| Chapter 32
WorkItemManagementService
openWorkItem 685
openWorkItem
Open a work item (to get the associated input and output data). Note that there is an openWorkItem operation in two services: WorkItemManagementService (the one described here) - Use this one if the user task was designed to not open a form nor start a pageflow. This would typically be used only in special use-case client applications. WorkPresentationService - Use this one if the user task was designed to either open a form or start a pageflow, which is typical for most client applications (see openWorkItem). The request must specify the work item that should be opened. The response returns the work item body of the opened work item. This operation can only be used if the work item is in a state from which it can be opened. See Work Item State Transitions, page 195. This operation can only be used if the work item is assigned to the user with whose credentials the operation is being invoked.
Required System Action Requires openOtherResourcesItems in order to open a work item currently allocated to another userfor example, when a manager is opening an item in a supervised work list (see Creating and Managing Supervised Work List Views on page 180 for information on supervised work lists). Otherwise, none.
686
| Chapter 32
WorkItemManagementService
openWorkItem 687
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <openWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItemBody xmlns=""> <dataModel> <inouts array="false" name="Lname" type="String"> <simpleSpec> <value>Fur</value> </simpleSpec> </inouts> <inouts array="false" name="Address1st" type="String"> <simpleSpec> <value>666 Hades Gate</value> </simpleSpec> </inouts> <inouts array="false" name="Gender" type="String"> <simpleSpec> <value>F</value> </simpleSpec> </inouts> <inouts array="false" name="PostCode" type="String"> <simpleSpec> <value>HA6 666</value> </simpleSpec> </inouts> <inouts array="false" name="Fname" type="String"> <simpleSpec> <value>Lucy</value> </simpleSpec> </inouts> </dataModel> </workItemBody> </openWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
688
| Chapter 32
WorkItemManagementService
closeWorkItem
Close a work item (and update the associated input and output data). Note that there is a closeWorkItem operation in two services: WorkItemManagementService (the one described here) - Use this one if the user task did not open a form when the work item was opened. This would be used only in special use-case client applications. Note that one special use-case for using the closeWorkItem operation in WorkItemManagementService is to set the work item state to PendHidden so that it does not appear in the work list for a specified period of time. For more information, see Accessing Hidden Work Items on page 218. WorkPresentationService - Use this one to close a form that was opened when the work item was opened with the openWorkItem operation. This is typically called in response to a user clicking the Close button on a work item form. The request must specify the work item that should be closed. The response returns the ID of the closed work item. This operation puts the work item into a PendHidden state if a hidden period is specified, or into a Pended state if not. This operation can only be used if the work item is in a state from which it can be closed. See Work Item State Transitions, page 195. This operation can only be used if the work item is assigned to the user with whose credentials the operation is being invoked.
Required System Action Requires closeOtherResourcesItems in order to close a work item currently allocated to another userfor example, when a manager is closing an item in a supervised work list (see Creating and Managing Supervised Work List Views on page 180 for information on supervised work lists). Otherwise, none.
closeWorkItem 689
Response
690
| Chapter 32
Example
WorkItemManagementService
Request:
<soapenv:Header/> <soapenv:Body> <api:closeWorkItem> <workItemID id="23"/> <workItemPayload> <dataModel> <!--Zero or more repetitions:--> <inputs name="?" type="?" optional="?" array="?"> <!--You have a CHOICE of the next 2 items at this level--> <!--Optional:--> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>?</value> </simpleSpec> <!--Optional:--> <complexSpec className="?"> <!--Zero or more repetitions:--> <value>?</value> </complexSpec> </inputs> <!--Zero or more repetitions:--> <outputs name="?" type="?" optional="?" array="?"> <!--You have a CHOICE of the next 2 items at this level--> <!--Optional:--> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>?</value> </simpleSpec> <!--Optional:--> <complexSpec className="?"> <!--Zero or more repetitions:--> <value>?</value> </complexSpec> </outputs> <!--Zero or more repetitions:--> <inouts name="?" type="?" optional="?" array="?"> <!--You have a CHOICE of the next 2 items at this level--> <!--Optional:--> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>?</value> </simpleSpec> <!--Optional:--> <complexSpec className="?"> <!--Zero or more repetitions:--> <value>?</value> </complexSpec> </inouts> </dataModel> </workItemPayload> <hiddenPeriod>
closeWorkItem 691
<!--You have a CHOICE of the next 2 items at this level--> <hiddenDuration years="0" months="0" weeks="0" days="2" hours="0" minutes="0"/> </hiddenPeriod> </api:closeWorkItem> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <closeWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItemID id="23" version="4" xmlns=""/> </closeWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
692
| Chapter 32
WorkItemManagementService
allocateWorkItem
Allocate a work item to a single resource: The request must specify the work item that should be allocated and the resource to whom it is to be allocated. The response returns details of the allocated work item. This operation can only be used if the work item is in a state from which it can be allocated. See Work Item State Transitions, page 195.
allocateWorkItem 693
694
| Chapter 32
Example
WorkItemManagementService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:allocateWorkItem> <workItemID id="22"/> <resource>ED72300B-F2FA-4E60-90D4-F829FB8DEA9D</resource> </api:allocateWorkItem> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <allocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="22" version="1"/> <header distributionStrategy="OFFER" priority="50"> <name>ServicingMgr</name> <description>ServicingMgr</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i3a</activityID> <activityName>ServicingMgr</activityName> <appInstance>pvm:0a128</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>Oho</appInstanceDescription> </itemContext> </header> <state>ALLOCATED</state> <visible>true</visible> </workItem> </allocateWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
allocateAndOpenWorkItem 695
allocateAndOpenWorkItem
Allocate a work item to a single resource and immediately open the work item (to get the associated input and output data): The request must specify the work item that should be allocated and the name of the resource to whom it is to be allocated. The response returns full details of the allocated work item. This operation can only be used if the work item is in a state from which it can be allocated and opened. See Work Item State Transitions, page 195.
696
| Chapter 32
WorkItemManagementService
allocateAndOpenWorkItem 697
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:allocateAndOpenWorkItem> <workItemID id="22" version="2"/> <resource>ED72300B-F2FA-4E60-90D4-F829FB8DEA9D</resource> </api:allocateAndOpenWorkItem> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <allocateAndOpenWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="22" version="3"/> <header distributionStrategy="OFFER" priority="50"> <name>ServicingMgr</name> <description>ServicingMgr</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i3a</activityID> <activityName>ServicingMgr</activityName> <appInstance>pvm:0a128</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>Oho</appInstanceDescription> </itemContext> </header> <body> <dataModel> <inputs array="false" name="param2" type="String"> <simpleSpec> <value>identity3</value> </simpleSpec> </dataModel> </body> <workType version="1.0.0.201106141602" workTypeDescription="ServicingMgr" workTypeID="WT__QnN14HCmEeCF3qXLa8gNUw"/> <state>OPENED</state> <visible>true</visible> </workItem> </allocateAndOpenWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
698
| Chapter 32
WorkItemManagementService
allocateAndOpenNextWorkItem 699
allocateAndOpenNextWorkItem
Allocate the next available work item for a specified resource to that resource and immediately open the work item (to get the associated input and output data): The operation fails if there is no next item in the resources work list. The request must specify the required resource. The response returns full details of the allocated work item. This operation can only be used if the work item is in a state from which it can be allocated and opened. See Work Item State Transitions, page 195.
700
| Chapter 32
WorkItemManagementService
allocateAndOpenNextWorkItem 701
Response:
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <allocateAndOpenNextWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="35" version="1"/> <header distributionStrategy="OFFER" priority="50"> <name>ServicingMgr</name> <description>ServicingMgr</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i71</activityID> <activityName>ServicingMgr</activityName> <appInstance>pvm:0a12j</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>ryt6</appInstanceDescription> </itemContext> </header> <body> <dataModel> <inputs array="false" name="param2" type="String"> <simpleSpec> <value>ryt6</value> </simpleSpec> </inputs> <inouts array="false" name="txtField1" type="String"> <simpleSpec> <value>r6y</value> </simpleSpec> </inouts> </dataModel> </body> <workType version="1.0.0.201106141602" workTypeDescription="ServicingMgr" workTypeID="WT__QnN14HCmEeCF3qXLa8gNUw"/> <state>OPENED</state> <visible>true</visible> </workItem> </allocateAndOpenNextWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
702
| Chapter 32
WorkItemManagementService
unallocateWorkItem 703
unallocateWorkItem
Reoffer a currently allocated work item to the original offer set: The request must specify the work item that should be deallocated. The response returns full details of the deallocated work item. This operation can only be used if the work item is in a state from which it can be unallocated. See Work Item State Transitions, page 195.
704
| Chapter 32
WorkItemManagementService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <unallocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="22" version="2"/> <header distributionStrategy="OFFER" priority="50"> <name>ServicingMgr</name> <description>ServicingMgr</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i3a</activityID> <activityName>ServicingMgr</activityName> <appInstance>pvm:0a128</appInstance> <appName>AMXSupervisor</appName> <appID>_fQ0ZAHClEeCF3qXLa8gNUw</appID> <appInstanceDescription>Oho</appInstanceDescription> </itemContext> </header> <state>OFFERED</state> <visible>true</visible> </workItem> </unallocateWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
unallocateWorkItem 705
706
| Chapter 32
WorkItemManagementService
completeWorkItem
Complete a work item (and update the associated input and output data): The request must specify the work item that should be completed. The response indicates whether or not the operation succeeded.
completeWorkItem 707
Response
708
| Chapter 32
Example
WorkItemManagementService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:completeWorkItem> <workItemID id="4" version="0"/> <workItemPayload> <dataModel> <!--Zero or more repetitions:--> <inputs name="PhoneNum" type="string" optional="?" array="false"> <!--You have a CHOICE of the next 2 items at this level--> <!--Optional:--> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>555-14951</value> </simpleSpec> </inputs> <inputs name="Name" type="string" optional="?" array="false"> <!--You have a CHOICE of the next 2 items at this level--> <!--Optional:--> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>Francois Premier</value> </simpleSpec> <!--Optional:--> <complexSpec className="?"> <!--Zero or more repetitions:--> <value>?</value> </complexSpec> </inputs> <!--Zero or more repetitions:--> <outputs ........ ........ </outputs> <!--Zero or more repetitions:--> <inouts ........ ........ </inouts> </dataModel> </workItemPayload> <!--Optional:--> <getNextPiledItem>false</getNextPiledItem> </api:completeWorkItem> </soapenv:Body> </soapenv:Envelope>
completeWorkItem 709
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <completeWorkItemResponse xmlns="http://api.brm.n2.tibco.com"/> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
710
| Chapter 32
WorkItemManagementService
skipWorkItem
Skip a work item. This means that no action is carried out on the work item. The request must specify the work item that should be skipped. The response identifies whether the request succeeded or failed. This operation can only be carried out on work items that have default values for all required output and in/out data fields, or have values set already for such fields.
skipWorkItem 711
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <skipWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <success xmlns="">true</success> </skipWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
712
| Chapter 32
WorkItemManagementService
reallocateWorkItem
Reallocate a work item with no new data to a different resource: The request must specify the work item that should be reallocated and the resource to whom it is to be reallocated. The response returns details of the reallocated work item. Note that the users to whom a work item can be reallocated is restricted by the system action held by the caller see below. Also, to reallocate a work item to the original offer set, the work item can have a state of Offered, Allocated, or Pended; to reallocate a work item to the "the world", the work item can have a state of Allocated or Pended. If there is new data to be written to the work item, use reallocateWorkItemData instead.
Required System Actions reallocateToOfferSet - This system action allows you to reallocate work items to only the users in the original offer set. reallocateWorkItemToWorld - This system action allows you to reallocate work items to any user in the organization model.
reallocateWorkItem 713
Response
714
| Chapter 32
Example
WorkItemManagementService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:reallocateWorkItem> <workItemID id="51" version=""/> <resource>3D9296E1-B1F8-4A09-A219-0285D43B3498</resource> <revertData>false</revertData> </api:reallocateWorkItem> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <reallocateWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="51" version="2"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i11</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a124</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>ALLOCATED</state> <visible>true</visible> </workItem> </reallocateWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
reallocateWorkItemData 715
reallocateWorkItemData
Reallocate a work item to a different resource and update the work item with new data: The request must specify the work item and the data that should be reallocated, and the resource to whom it is to be reallocated. The response returns details of the reallocated work item. Note that the users to whom a work item can be reallocated is restricted by the system action held by the caller see below. Also, to reallocate a work item to the original offer set, the work item can have a state of Offered, Allocated, or Pended; to reallocate a work item to the "the world", the work item can have a state of Allocated or Pended. If the work item has no new data associated with it use reallocateWorkItem instead.
Required System Actions reallocateToOfferSet - This system action allows you to reallocate work items to only the users in the original offer set. reallocateWorkItemToWorld - This system action allows you to reallocate work items to any user in the organization model.
716
| Chapter 32
WorkItemManagementService
reallocateWorkItemData 717
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:reallocateWorkItemData> <workItemID id="3" version="12"/> <resource>846D100C-77C8-42DE-BD01-C23D214D2BB4</resource> <workItemPayload> <dataModel> <inputs name="Message" type="String" optional="?" array="false"> <simpleSpec length="?" decimal="?"> <value>Please call An Lushan at 01799887256.</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </inputs> <outputs name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </outputs> <inouts name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <!--Zero or more repetitions:--> <value>?</value> </complexSpec> </inouts> </dataModel> </workItemPayload> </api:reallocateWorkItemData> </soapenv:Body> </soapenv:Envelope>
718
| Chapter 32
WorkItemManagementService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <reallocateWorkItemDataResponse xmlns="http://api.brm.n2.tibco.com"> <workItem xmlns=""> <id id="3" version="16"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001io</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a123</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>ALLOCATED</state> <visible>true</visible> </workItem> </reallocateWorkItemDataResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getOfferSet 719
getOfferSet
Get the offer set for a work item (The offer set is the set of organization model entities to whom a work item is to be offered.): The request must specify the work item for which the offer set is required. The response returns the IDs of the organization model entities that comprise the offer set for this work item.
720
| Chapter 32
WorkItemManagementService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getOfferSetResponse xmlns="http://api.brm.n2.tibco.com"> <entityGuid xmlns="">_5i1V0CfLEeChutsy_vK9tg</entityGuid> </getOfferSetResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
saveOpenWorkItem 721
saveOpenWorkItem
Save a work item (and update the associated input and output data): The request must specify the work item that should be saved, and the data that should be updated as part of the save. The response returns the ID of the saved work item.
722
| Chapter 32
WorkItemManagementService
saveOpenWorkItem 723
Example
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:saveOpenWorkItem> <workItemID id="54"/> <workItemPayload> <dataModel> <inputs name="Message" type="String" optional="?" array="false"> <simpleSpec length="?" decimal="?"> <value>Please call William Tanner at 555-1066.</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </inputs> <outputs name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <!--Zero or more repetitions:--> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </outputs> <inouts name="?" type="?" optional="?" array="?"> <simpleSpec length="?" decimal="?"> <value>?</value> </simpleSpec> <complexSpec className="?"> <value>?</value> </complexSpec> </inouts> </dataModel> </workItemPayload> </api:saveOpenWorkItem> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <saveOpenWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItemID id="54" version="3" xmlns=""/> </saveOpenWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
724
| Chapter 32
WorkItemManagementService
pendWorkItem 725
pendWorkItem
To pend a work item: The request must specify the work item that should be pended. The response returns the ID of the pended work item. A pendWorkItem operation that specifies a hiddenPeriod of 0 cancels a hiddenPeriod set by a previous pendWorkItem operation on the same work item. See Accessing Hidden Work Items, page 218.
726
| Chapter 32
WorkItemManagementService
Response Example
Response:
SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <pendWorkItemResponse xmlns="http://api.brm.n2.tibco.com"> <workItemID id="3" version="11" xmlns=""/> </pendWorkItemResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
pendWorkItem 727
728
| Chapter 32
WorkItemManagementService
WorkListService 729
Chapter 33
WorkListService
WorkListService is one of the Business Resource Management Services provided by Work Manager. Use WorkListService requests to get work item lists for organization model entities, and to get or to set sort/filter criteria for work item lists.
Topics
getWorkListItems, page 730 getAllocatedWorkListItems, page 734 previewWorkItemFromList, page 738 getWorkItemOrderFilter, page 741 getResourceOrderFilterCriteria, page 743 setResourceOrderFilterCriteria, page 745
730
| Chapter 33
WorkListService
getWorkListItems
:Get a work list for an organization model entity: The request must specify the organization model entity requiring a work item list, the number of work items to retrieve and (for a resource) any work list sort/filter criteria. The response returns the work list for the specified organization model entity. (The work list contains full details of the requested number of work items.)
getWorkListItems 731
Response Example
732
| Chapter 33
WorkListService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getWorkListItemsResponse xmlns="http://api.brm.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <endPosition xmlns="">2</endPosition> <totalItems xmlns="">3</totalItems> <workItems xmlns=""> <id id="2" version="0"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001if</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a122</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>OFFERED</state> <visible>true</visible> </workItems> <workItems xmlns=""> <id id="3" version="0"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001io</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a123</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>OFFERED</state> <visible>true</visible> </workItems> </getWorkListItemsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getWorkListItems 733
734
| Chapter 33
WorkListService
getAllocatedWorkListItems
:Get an allocated work list for an organization model entity: The request must specify the organization model entity requiring an allocated work item list, the number of work items to retrieve and (for a resource) any work list sort/filter criteria. The response returns the work list for the specified organization model entity. (The work list contains full details of the requested number of allocated work items.)
getAllocatedWorkListItems 735
Response
736
| Chapter 33
Example
WorkListService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:getAllocatedWorkListItems startPosition="0" numberOfItems="2" getTotalCount="true"> <entityID model-version="-1" entity-type="POSITION" guid="_5i1V0CfLEeChutsy_vK9tg"> </entityID> <orderFilterCriteria> <order>id DESC</order> <filter></filter> </orderFilterCriteria> </api:getAllocatedWorkListItems> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getWorkListItemsResponse xmlns="http://api.brm.n2.tibco.com"> <startPosition xmlns="">0</startPosition> <endPosition xmlns="">0</endPosition> <totalItems xmlns="">1</totalItems> <workItems xmlns=""> <id id="51" version="3"/> <header distributionStrategy="OFFER" priority="50"> <name>DisplayMessage</name> <description>Display Message</description> <flags> <scheduleStatus>DURING</scheduleStatus> </flags> <itemContext> <activityID>pvm:001i11</activityID> <activityName>DisplayMessage</activityName> <appInstance>pvm:0a124</appInstance> <appName>WelcomeUsers</appName> <appID>_-fPYwCIVEeCnP8eZZTCDGg</appID> </itemContext> </header> <state>OPENED</state> <visible>true</visible> </workItems> </getWorkListItemsResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getAllocatedWorkListItems 737
738
| Chapter 33
WorkListService
previewWorkItemFromList
Preview one or more work items (to get the associated input and output data without opening the work items): The request message identifies the organizational entity making the request, and the work item or items to be previewed. Optionally it can also limit the data returned to specified fieldnames. The response message contains the work item ID and version, and the details of any requested fields.
previewWorkItemFromList 739
740
| Chapter 33
Example
WorkListService
Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:api="http://api.brm.n2.tibco.com"> <soapenv:Header/> <soapenv:Body> <api:previewWorkItemFromList> <entityID model-version="-1" entity-type="RESOURCE" guid="2D6430DC-9A65-4F21-A3BE-798AA192E468"> <qualifierSet value="?"/> </entityID> <workItemID id="19"/> <requiredField>UserName</requiredField> </api:previewWorkItemFromList> </soapenv:Body> </soapenv:Envelope>
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <previewWorkItemFromListResponse xmlns="http://api.brm.n2.tibco.com"> <workItemPreview id="19" version="3" xmlns=""> <FieldPreview array="false" name="UserName" type="String"> <simpleSpec> <value>Loki Aesir</value> </simpleSpec> </FieldPreview> </workItemPreview> </previewWorkItemFromListResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
getWorkItemOrderFilter 741
getWorkItemOrderFilter
Get the fields defined by BRM that can be used to define sort/filter criteria for a work item list: The request specifies the number of fields to return. The response returns details of the BRM-defined fields that can be used to define sort and/or filter criteria for a work item list.
742
| Chapter 33
WorkListService
getResourceOrderFilterCriteria 743
getResourceOrderFilterCriteria
Get (previously defined) sort/filter criteria for work item lists for a resource: The request must specify the resource for whom work list sort/filter criteria is required. The response returns the work list sort/filter criteria for the specified resource.
744
| Chapter 33
WorkListService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <getResourceOrderFilterCriteriaResponse xmlns="http://api.brm.n2.tibco.com"> <orderFilterCriteria xmlns=""> <order>startDate DESC</order> <filter>[2011-05-23,2012-07-23]</filter> </orderFilterCriteria> </getResourceOrderFilterCriteriaResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
setResourceOrderFilterCriteria 745
setResourceOrderFilterCriteria
Set sort/filter criteria for work item lists for a resource: The request must specify the sort/filter criteria to set and identify the resource for whom they should be set. The response returns whether the request succeeded or failed.
746
| Chapter 33
WorkListService
Response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header/> <SOAP-ENV:Body> <setResourceOrderFilterCriteriaResponse xmlns="http://api.brm.n2.tibco.com"> <success xmlns="">true</success> </setResourceOrderFilterCriteriaResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
WorkPresentationService 747
Chapter 34
WorkPresentationService
WorkPresentationService is one of the Work Presentation Services provided by Work Manager. Use WorkPresentationService requests to perform various operations on work items.
Topics
openWorkItem, page 748 cancelWorkItem, page 751 closeWorkItem, page 753 completeWorkItem, page 756 openNextWorkItem, page 759 getBusinessServiceDetailsByModule, page 763
748
| Chapter 34
WorkPresentationService
openWorkItem
Retrieves the associated input and output data and opens the work item form. Note that there is an openWorkItem operation in two services: WorkPresentationService (the one described here) - Use this one if the user task was designed to either open a form or start a pageflow, which is typical for most client applications. WorkItemManagementService - Use this one if the user task was designed to not open a form nor start a pageflow. This would typically be used only in special use-case client applicationssee openWorkItem. The request must specify the resource ID and the work item ID that is to be opened. The response returns the complete details of the work item that is opened, as well as the pageflow details if the user task was designed to start a pageflow.
For additional information, see Introduction to Work Items on page 190. Required System Action None.
openWorkItem 749
Response
750
| Chapter 34
Example
WorkPresentationService
Request:
<soapenv:Body> <api:baseWorkRequest action="?"> <resourceId>2D6430DC-9A65-4F21-A3BE-798AA192E468</resourceId> <channelId>?</channelId> <channelType>GIChannel</channelType> <responsePayloadMode>XML</responsePayloadMode> <workItem id="37" version="0">?</workItem> <workTypeDetail uid="WT__81TKQFlFEd-5Ae672m_IWw" version="0" openNextPiled="true"/> </api:baseWorkRequest> </soapenv:Body>
Response:
<SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="XML" xmlns=""> <XmlPayload> <inputs array="false" name="Message" type="String"> <simpleSpec> <value>Please call TIB_USER at 987654321.</value> </simpleSpec> </inputs> </XmlPayload> </payloadModel> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__81TKQFlFEd-5Ae672m_IWw" version="1.0.0.201108111516" xmlns=""/> <presentation activityName="DisplayMessage" formIdenitifier="1.0.0.201108111516/GIGWTPull_DefaultChannel/.default/ ProcessPackage/WelcomeUsers/DisplayMessage/DisplayMessage.gwt.json" type="GI_FORM" version="1.0.0.201108111516" xmlns=""/> <workItem id="37" version="1" xmlns=""/> </workResponse> </SOAP-ENV:Body>
cancelWorkItem 751
cancelWorkItem
Cancels the specified work item. Any changes made to the data will be lost when you cancel a work item. The request must specify the work item and the resource ID for the work item that is to be cancelled. Optionally, you can also specify the work type details for the work item. The response returns the execution status of the operation.
752
| Chapter 34
WorkPresentationService
Response Example
Response:
<SOAP-ENV:Body> <workResponse isSuccessful="true" xmlns="http://api.wp.n2.tibco.com"/> </SOAP-ENV:Body>
closeWorkItem 753
closeWorkItem
Closes a work item form and updates the associated data with any changes the user has made while it was open. Note that there is a closeWorkItem operation in two services: WorkPresentationService (the one described here) - Use the operation in this service to close a form that was opened when the work item was opened with the openWorkItem operation. This is typically called in response to a user clicking the Close button on a work item form. WorkItemManagementService - Use this one only if the user task did not open a form when the work item was opened. This would typically be used only in special use-case client applicationssee closeWorkItem. Note that one special use-case for using the closeWorkItem operation in WorkItemManagementService is to set the work item state to PendHidden so that it does not appear in the work list for a specified period of time. For more information, see Accessing Hidden Work Items on page 218. The request must specify the details of the work item to be closed, the payload, and whether the next piled work item must be opened after the current one is closed. The response returns the execution status, the payload received in the request message, the work type details, presentation details and pageflow details. This operation puts the work item into a Pended state. (If you wish to update the work item to a PendHidden state, you must use the closeWorkItem operation provided by the WorkItemManagementService.)
754
| Chapter 34
WorkPresentationService
Response Example
Response:
<SOAP-ENV:Body> <workResponse isSuccessful="true" xmlns="http://api.wp.n2.tibco.com"/> </SOAP-ENV:Body>
closeWorkItem 755
756
| Chapter 34
WorkPresentationService
completeWorkItem
Use this operation when work on a work item or pageflow has completed. Input and output data associated with the work item is saved to the database. The work item must be Opened, and its state is changed to Completed. Note that there is a completeWorkItem operation in two services: WorkPresentationService (the one described here) - Use this one if a form was opened when the work item was opened with the openWorkItem operation. This is typically called in response to a user clicking the Submit button on a work item form. WorkItemManagementService - Use this one if the user task was designed to not open a form nor start a pageflow. This would typically be used only in special use-case client applicationssee completeWorkItem. The request must specify the work item to be completed and also provide the payload. The response returns the execution status, the payload received in the request message, the work type details, presentation details and pageflow details (if any). If the work item is part of a chained group, the response returns the next work item in the group. If the work item is piled, the response returns the next piled work item.
If the work item is part of a chained group and is also piled, then the chained group takes precedence. Once all the chained work items are executed, the next piled work item is executed. This operation puts the work item into a Completed state. Once completed, no further operations can be performed on the work item.
completeWorkItem 757
Response Example
Response:
<SOAP-ENV:Body> <workResponse isSuccessful="true" xmlns="http://api.wp.n2.tibco.com"/> </SOAP-ENV:Body>
758
| Chapter 34
WorkPresentationService
openNextWorkItem 759
openNextWorkItem
Opens the next work item in the work queue. The request must specify the resource ID, channel ID, channel type, and mode in which the payload must be returned. The response returns the execution status, the payload of the work item that is opened, the work type details, presentation details and pageflow details.
760
| Chapter 34
WorkPresentationService
Response Example
openNextWorkItem 761
Response:
<SOAP-ENV:Body> <workResponse xmlns="http://api.wp.n2.tibco.com"> <payloadModel payloadMode="JSON" xmlns=""> <serializedPayload>{items:[{"$param":"UserName","$value":["TIB_USER"], "type":"String","mode":"IN"}]}</serializedPayload> </payloadModel> <workTypeDetail pilingLimit="0" typePiled="false" uid="WT__UZikcDjhEeCeRNBOZebDZA" version="1.0.0.201108111516" xmlns=""> <dataModel> <inputs array="false" name="UserName" optional="false" type="String"> <simpleSpec decimal="0" length="50"/> </inputs> </dataModel> </workTypeDetail> <presentation formIdenitifier="http://localhost:8080/bpm/" type="GI_FORM" xmlns=""/> <workItem id="38" version="7" xmlns=""/> <pageFlowDetail id="_ziwiYDjlEeCeRNBOZebDZA" moduleName="/PageflowSolution/Process Packages/ProcessPackage.xpdl" moduleVersion="1.0.0.201108111516" name="RequestAdditionalDataPageflow" url="PageflowSolution/.bpm/.processOut/pageflow/ProcessPackage.xpdl/Re questAdditionalDataPageflow.bpel" xmlns=""> <page-activity id="__Hoo4DjnEeCeRNBOZebDZA" name="Gettheusersemailaddress" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="Gettheusersemailaddress.gwt.json" version="1.0.0.201108111516"> <relative-path>1.0.0.201108111516/GIGWTPull_DefaultChannel/ProcessPack age/RequestAdditionalDataPageflow/Gettheusersemailaddress</relative-pa th> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> <page-activity id="_1mUqsDjnEeCeRNBOZebDZA" name="Gettheuserscellphonenumber" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="Gettheuserscellphonenumber.gwt.json" version="1.0.0.201108111516"> <relative-path>1.0.0.201108111516/GIGWTPull_DefaultChannel/.default/Pr ocessPackage/RequestAdditionalDataPageflow/Gettheuserscellphonenumber< /relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> <!-- Continued -->
762
| Chapter 34
WorkPresentationService
<!-- Continued --> <page-activity id="_yMhV8DjqEeCeRNBOZebDZA" name="Asktheuserforasecurityquestion" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="Asktheuserforasecurityquestion.gwt.json" version="1.0.0.201108111516"> <relative-path>1.0.0.201108111516/GIGWTPull_DefaultChannel/.default/Pr ocessPackage/RequestAdditionalDataPageflow/Asktheuserforasecurityquest ion</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> </pageFlowDetail> </workResponse> </SOAP-ENV:Body>
getBusinessServiceDetailsByModule 763
getBusinessServiceDetailsByModule
Retrieves all the information about the business service as requested by a module. The request must specify the module name and version, and the process name for the business service whose details are to be retrieved. The response returns details about the business service for the specified module.
764
| Chapter 34
WorkPresentationService
Response:
<SOAP-ENV:Body> <businessServiceDetailsResponse id="_PY_jILHTEd-8rbpgFImPHQ" moduleName="/SanityProcesses/Sanity Tests/SanityTests.xpdl" moduleVersion="1.0.0.201108021442" name="SanityTestsStartEvent" url="SanityProcesses/.bpm/.processOut/pageflow/SanityTests.xpdl/Sanity TestsStartEvent.bpel" xmlns="http://api.wp.n2.tibco.com"> <page-activity id="_Ptjd4rHTEd-8rbpgFImPHQ" name="UserTask" xmlns="http://service.archive.wp.n2.tibco.com"> <page-reference guid="" name="UserTask.gwt.json" version="1.0.0.201108021442"> <relative-path>1.0.0.201108021442/openspaceGWTPull_DefaultChannel/.def ault/SanityTests/SanityTestsStartEvent/UserTask</relative-path> <base-path>http://localhost:8080/bpm</base-path> </page-reference> </page-activity> </businessServiceDetailsResponse> </SOAP-ENV:Body>
getBusinessServiceDetailsByModule 765
766
| Chapter 34
WorkPresentationService
Appendix A
This appendix contains reference information that you may need when using the TIBCO ActiveMatrix BPM API and system actions.
Topics
System Actions, page 768
768
| Appendix A
System Actions
Table 4 lists the names, parent components and default value of all defined system actions. In the table: Name is the name of the system action. Required to execute lists the web service operations (and Service Connector methods, which use the same names) that require the system action. Component identifies the BPM component that owns this system action: BRM - Business Resource Management DE - Directory Engine EC - Event Collector PE - Process Manager WSB - Workspace Default value is the system-wide default value applied to this system action: Allowed - The system action can be performed by any user without authorization. Denied - The system action cannot be performed by any user unless they have the correct authorization. Both the component and the system action name must be specified when using certain Directory Services API SecurityService operations (for example, listActionAuthorisedEntities and listAuthorisedOrgs). Table 4 System action names and components System action applicationConfiguration autoOpenNextWorkItem Required to execute Not currently used setOrgEntityConfigAttributes deleteOrgEntityConfigAttributes1 Component WSB BRM Default value Denied Allowed
Table 4 System action names and components System action browseModel Required to execute listModelVersions openOrgModel browseModelNode listOrgModelOverview listCapabilities listPrivileges getCapabilities getPrivileges listOrganizations cancelProcessInstance cancelProcessInstances Not currently used by any public API closeWorkItem2 mapEntities getResourceGuid deleteLDAPContainer deleteResource exportResources getMigrationPoints setMigrationRules unsetMigrationRules clearMigrationRules isSetMigrationRule listMigrationRules importResources Component DE Default value Allowed
PE BRM BRM DE DE DE DE PE
importLDAPAdmin
DE
Denied
770
| Appendix A
Table 4 System action names and components System action LDAPAdmin3 Required to execute listLDAPSources, listLDAPEntities, listLDAPAttributes, listLDAPAttributeNames, listContainerResources listLDAPContainers getLDAPContainerDetail saveLDAPContainerDetail Not currently used openWorkItem4 Not currently used n/a pendWorkItem n/a6 getActivityInstanceStatus getParameterValue getActivityInstanceStatus getProcessInstanceStatus getProcessInstanceSummary listProcessInstanceAttributes listSetofProcessInstanceAttributes listProcessInstances queryDone queryFirstPage queryLastPage queryNextPage queryPreviousPage queryProcessInstanceCount queryProcessInstances queryProcessInstancesAlt Component DE Default value Denied
EC BRM EC DE BRM PE PE
Table 4 System action names and components System action queryProcessTemplate Required to execute listProcessTemplateAttributes listProcessTemplates queryProcessTemplateCount queryProcessTemplates queryProcessTemplatesAlt listStarterOperations getStarterOperationInfo listBusinessParameters getBusinessParameters getPushDestinations reallocateWorkItem7 reallocateWorkItemData reallocateWorkItem4 reallocateWorkItemData getResourceDetail listAssociatedResources lookupUser listLDAPEntities listContainerResources listLDAPContainers getResourceDetail listAssociatedResources lookupUser listMappedEntities updateCapabilityAssignments resumeProcessInstance resumeProcessInstances Not currently used by any public API setDeadlineExpiration setPriority Component PE Default value Allowed
DE DE BRM BRM DE
resourceAdmin
DE
Denied
PE BRM PE PE
772
| Appendix A
Table 4 System action names and components System action setResourceOrderFilterCriteria8 showProcessInstanceAuditTrail skipWorkItem startBusinessService startprocess suspendProcessInstance suspendWorkItem userAdmin9 Required to execute getResourceOrderFilterCriteria setResourceOrderFilterCriteria Not currently used skipWorkItem startBusinessService createProcessInstance suspendProcessInstance suspendProcessInstances Not currently used by any public API saveUserSettings getUserSettings deleteUserSettings listUserSettingIds getWorkListItems getAllocatedWorkListItems allocateWorkItem allocateAndOpenWorkItem allocateAndOpenNextWorkItem unallocateWorkItem setBusinessParameters setPushDestinations Component BRM EC BRM WSB PE PE BRM DE Default value Denied Allowed Denied Allowed Allowed Denied Allowed Allowed
viewWorkList workItemAllocation
BRM BRM
Denied Denied
writeParameters writePushDestinations
DE DE
Allowed Denied
1. This system action is required only if you are using these operations to set or to delete the WorkItemAutoOpen attribute. 2. This system action is required only when closing a work item allocated to another user. 3. For certain ContainerService and LDAPService operations, this system action gives the caller access to all organizations, regardless the organization relationships that are set up. For more information, see Overriding Organization Relationships on page 124. 4. This system action is required only when opening a work item allocated to another user.
5. This system action is not required to execute any web service operations. It is used to override organization relationships when calling BrowseModelService operations. Users possessing this system action can see all organizations when calling BrowseModelService operations that return organization elements, regardless the organization relationships that are set up. For more information, see Overriding Organization Relationships on page 124. 6. Completed process instances are automatically purged from the system. 7. The reallocateWorkItem and reallocateWorkItemData operations allow you to reallocate work items to users in the original offer set if you have the reallocateToOfferSet system action, or to any user in the organization model if you have the reallocateWorkItemToWorld system action. 8. Only the setResourceOrderFilterCriteria system action at the organization model level is used; the scoped setResourceOrderFilterCriteria system action (i.e., the one at the group, organization unit, and position level) is not currently used. 9. Note that the userAdmin system action appears as "User Settings" in TIBCO Business Studio, rather than "User Admin". When passed in web service operations or Service Connector method calls, pass "userAdmin".
774
| Appendix A
System actions at the organization model level are defined in TIBCO Business Studio by selecting the organization model, then associating a privilege to the appropriate system action. In the following example of system actions configured at the organization model level, users that have the "Acct Super" privilege can cancel work items.
At the organization model level, some system actions are granted to all users by default (those that contain "Available to all users" in the Value column), and some are denied by default (those that have an empty Value column). If a privilege has been assigned to a system action (such as the Cancel Work Item system action), it overrides the default; that is, once a privilege is assigned to a system action, only users that have that privilege can perform the associated function (such as cancelling work items). System Actions at the Group, Organization Unit, and Position Level To be able to view work items in, and perform some functions on, a work list containing work items that were sent to another resource, or directly to a group or position, you must have the appropriate scoped system actions, that is, system actions configured on an individual group, organization unit, or position.
System actions at the group, organization unit, and position level are defined in TIBCO Business Studio by selecting the group, organization unit, or position, then associating a privilege with the appropriate scoped system action:
Note that although there are seven scoped system actions available in TIBCO Business Studio, only the following ones are used at this time: BRM.viewWorkList - Controls access to supervised work lists: To view a supervised work list for an organizational entity, you must possess the privilege assigned to the system action, BRM.viewWorkList, on the group, organization unit, or position. To view a supervised work list for an individual resource, you must possess the privilege assigned to the system action, BRM.viewWorkList, on a specific position to which the resource has been mapped This is further explained in Viewing Supervised Work Lists on page 776. BRM.closeOtherResourcesItems - Controls whether you can cancel a work item in a supervised work list. BRM.reallocateToOfferSet - Controls whether you can allocate a work item, in a supervised work list, to a specific person in the original offer set. By default this system action is available at the organization model level. You can also define this system action as scoped at position level. You can use the scoped system action with the allocateAndOpenNextWorkItem operation, for example. BRM.reallocateWorkItemToWorld - By default this system action is available at the organization model level; use it at that level to also control access to the allocate to "world" function (see allocateWorkItem) from a supervised work list.
776
| Appendix A
You can also define this system action as scoped at position level. You can use the scoped system action with the allocateAndOpenNextWorkItem operation, for example. The scoped system actions available in TIBCO Business Studio that are not currently used in the application are: BRM.setResourceOrderFilterCriteria BRM.openOtherResourcesItems (You cannot open another resources work items from a supervised work list.) BRM.workItemAllocation (This system action is available at the organization model level; use that one to also control access to the allocate work items function (see allocateWorkItem) on a supervised work list.)
Viewing Supervised Work Lists The primary use of the scoped system actions are for controlling the ability to view supervised work lists. A few of the other system actions available at the organizational entity-level control access to functions from a supervised work list. This section describes what is necessary to set up system actions to be able to view a supervised work list. When a supervised work list is requested with the getWorkListItems operation, you can request that it contain either: Work items sent to an organizational entity - This type of supervised work list only contains work items that were sent directly to the specified organizational entity. To be able to get this type of supervised work list: A privilege must be assigned to the BRM.viewWorkList system action for the group, organization unit, or position for which you want to supervise, and you must possess the privilege (and possible qualifier) assigned to the scoped BRM.viewWorkList system action for the organizational entity you want to supervise (you gain the privilege by being mapped to a group or position that gives you that privilege).
In the following example, the Claims Handling organization units scoped "View Work List" system action has a privilege assigned:
In this example, a logged-in user who possesses the "Manage Work" privilege, can view a supervised work list for the Claims Handling organization unit. Note - The checking for needed system actions is hierarchicalfor more information, see System Action Hierarchy on page 778. Work items for an individual resource - This type of supervised work list contains all of the work items that are currently in that resources work list. To be able to view this type of supervised work list: A privilege must be assigned to the BRM.viewWorkList system action for a specific position to which the desired resource is mapped, you must possess the privilege (and possible qualifier) assigned to the scoped BRM.viewWorkList system action for the position (you gain the privilege by being mapped to a group or position that gives you that privilege).
778
| Appendix A
In the following example, a privilege has been assigned to the "View Work List" (BRM.viewWorkList) scoped system action on the Claims Handler position:
This allows a user who has the "Manage Work" privilege, with a qualifier of "Claims", to get a supervised work list for a user who has been mapped to the Claims Handler position. Note - The checking for needed system actions is hierarchicalfor more information, see System Action Hierarchy on page 778. System Action Hierarchy The checking of system actions is hierarchical. If different privileges are assigned to the same system action (e.g., BRM.viewWorkList) at different levels in the organization model, each level is checked when determining whether a user has the necessary privilege to be able to perform a particular system action. If the lowest level has no required privileges assigned, the parent entity is checked, and so on up the organization model hierarchy to the system-wide, organization model-level value.
For example, in the following diagram the "View work list" system action has been associated with three different privileges, "X", "Y" and "Z", at three different levelsthe organization model, organization unit A, and position 2.
This means that a user who holds privilege "X", "Y" or "Z" can view a supervised work list: for either Position 2 or Organization Unit A, or for individual resources that have been mapped to Position 2.
If a user wants to view the work list of a user who holds Position 1, they must hold privilege "X" or "Y". This is because no privilege has been associated with Position 1, so any privileges associated with the parent entity are used instead. If privilege "Y" had not been associated with Organization Unit A, the user would instead need privilege "X", defined in the parent Organization Model. As well as assigning different privileges at different levels, as shown above, qualifiers on the same privilege can be used to refine how access to a particular system action is controlled. (When comparing a required privilege to a held privilege, if either side is not qualified the comparison is positive. If both sides are qualified, the qualifications must match for the comparison to be positive.) For more information about system actions, see the BPM Concepts guide.
780
| Appendix A
Appendix B
This appendix contains reference information that you may need when using TIBCO forms with custom client applications.
Topics
Integrating TIBCO Forms with Custom Client Applications, page 782
782
| Appendix B
See Rendering a TIBCO Business Studio Form for more information. Once the JavaScript API loading is complete, it notifies the client application by invoking a function called onTIBCOFormRunnerLoad. The client application can define this function on the page and get notified about the availability of com.tibco.forms.client.FormRunner. For example:
function onTIBCOFormRunnerLoad() { // Forms Runtime Adapter is now available for use on the page. // com.tibco.forms.client.FormRunner.loadForm() can be accessed from now on // to load the form. }
784
| Appendix B
Browser-based application Browser BPM Resources Client application Work presentation Services
Work list is displayed 1 User opens a work item 2 Client invokes Forms Runtime Adapter to render the form openWork Item [formUrl, formData] WorkPresentation Service
Form is displayed
Forms Runtime Adapter submits the form data and notifies the client of the Submit action
completeWork Item
WorkPresentation Service
Forms Runtime Adapter submits the form data and notifies the client of the Close action
-or-
closeWorkItem -or-
WorkPresentation Service
Forms Runtime Adapter submits the form data and notifies the client of the Cancel action 5
cancelWork Item
WorkPresentation Service
[success]
The details of the events are as follows: 1. To open a work item, the client application invokes the BPM WorkPresentationService via a Java service connector. The openWorkItem() operation is used to open the work item. 2. In response to the openWorkItem() request, the formUrl and formData are returned to the client application. The client application decides the locale for rendering the form and provides the identifier of the DOM node under which the form will be rendered. The channelId is the identifier of the presentation channel to which the client application is bound, e.g. GIGWTPull_DefaultChannel or openspaceGWTPull_DefaultChannel. See Binding the Client Application to a Channel for more information. The client application invokes the FormRunner.loadForm() method, which accepts the above values along with two arguments - onSuccess and onError. See com.tibco.forms.client.FormRunner for details of the FormRunner.loadForm() method.
786
| Appendix B
The following code snippet shows how the form is loaded using the FormRunner.loadForm() method.
var formURL; // Form URL obtained from the work item. var formData; // The initial form data obtained from the work item. var bomJSPath; // BOM JavaScript root path obtained from the workitem. var locale = "en_US"; // locale to use var parentId; // Identifier of a node to which the form is added. var submitHandler = function(actionName, form) { var formData = form.getSerializedParameters(); // submit the work item form.destroy(); }; var closeHandler = function(actionName, form) { // close the work item form.destroy(); }; var cancelHandler = function(actionName, form) { // cancel the work item form.destroy(); }; var onSuccess = function(form) { form.setActionHandler(com.tibco.forms.client.Form .ACTION_SUBMIT, submitHandler); form.setActionHandler(com.tibco.forms.client.Form .ACTION_CLOSE, closeHandler); form.setActionHandler(com.tibco.forms.client.Form .ACTION_CANCEL, cancelHandler); }; var onError = function(e) { alert("An error occurred while loading the form: "+ e); }; com.tibco.forms.client.FormRunner.loadForm(formURL, formData, bomJSPath, locale, parentId, onSuccess, onError, JSONP);
It is not recommended to use the method on the page event, as the com.tibco.forms.client.FormRunner class might not be fully loaded and the API methods being used might not be available. To avoid these errors, the client application can define the onTIBCOFormRunnerLoad function on the page and can be notified about the availability of com.tibco.forms.client.FormRunner. See Injecting the Forms Runtime Adapter in the Browser for further details.
com.tibco.forms.client.FormRunner.loadForm() onLoad
3. The form is displayed in the browser. The FormRunner.loadForm() method is asynchronous, so any post-processing that is done on the loaded form object happens within the onSuccess callback handler. In the above code snippet, three action handlers are set that take care of the submit, close, and cancel operations that are provided on most forms. 4. When the form is submitted, the submitHandler handles the submit action. In response to form submission, form.getSerializedParameters() method retrieves the formData. See com.tibco.forms.client.Form for details of the form.getSerializedParameters() method. This method returns a JSON (JavaScript Object Notation) serialization of the data within the form. 5. After successful submission of the form, the client application invokes completeWorkItem() to pass the form data back to the BPM WorkPresentationService. This operation is used to update the work item.
These methods have the same set of input parameters but they differ in the way the initial data are passed. Both the methods are void.
TIBCO ActiveMatrix BPM - BPM Developers Guide
788
| Appendix B
In loadForm(), the initial data are passed directly as a JSON (JavaScript Object Notation) string. In loadFormWithRemoteData(), a URL of the initial JSON data is passed using the initDataURL parameter. The FormRunner retrieves the data from the specified URL.
Description Loads the form at the specified URL. The parameter details are as follows:
url
35/openspaceGWTPull_DefaultChannel/FindAddress/GetAddre ss/Getuserdetails/Getuserdetails.gwt.json"
initialData
- Specifies the JSON representation of the initial data that are provided to the form.
bomJSPath - Specifies the root folder path used for loading the BOM JavaScript files used by the form, e.g. "http://10.97.110.17:8080/bpmresources/1.0.0.2011072914 35" locale - Specifies the locale to be used in the form runtime with format <lc>[_<CC>] where [] denotes optionality, e.g. "en_US". The locale needs to be represented such that <lc> is a valid two-character lowercase ISO-639 language code and if present the optional <CC> is a valid two-character uppercase ISO-3166 country code. Both '_' and '-' are supported as delimiters. parentNodeId
- Specifies the DOM identifier of the node to which the form is added. The value cannot be null.
onSuccess - A function that is called once the form is successfully initialized. The Form object is passed into this function. This function can be used to add custom callback handlers that implement lifecycle events such as submit, close, and cancel. onError
- A function that is called if any errors are encountered in initializing the form. The function will receive any exception that was encountered during the initialization.
JSONP - Informs the Forms Runtime Adapter to use JSON with Padding (JSONP) when loading JSON resources. The default value is false. When the custom client and Forms Runtime Adapter are hosted on different servers, set the JSONP parameter as true. In this scenario, there are SOP (Single Origin Policy) issues while loading JSON resources. By using the JSONP technique, the JSON response is wrapped to a call to a function by the server and send to the client. A JSON resource can then be loaded using a script tag to avoid any SOP violations.
790
| Appendix B
Method
Description Loads the form at the specified URL. The parameter details are as follows:
url
loadFormWithRemoteDat a(String url, String initDataURL, String bomJSPath, String locale, String parentNodeId, Function onSuccess, Function onError, Boolean JSONP)
35/openspaceGWTPull_DefaultChannel/FindAddress/GetAddre ss/Getuserdetails/Getuserdetails.gwt.json".
initDataURL
bomJSPath - Specifies the root folder path used for loading the BOM JavaScript files used by the form, e.g. "http://10.97.110.17:8080/bpmresources/1.0.0.2011072914 35" locale - Specifies the locale to be used in the form runtime with format <lc>[_<CC>] where [] denotes optionality, e.g. "en_US". The locale need to be represented such that <lc> is a valid two-character lowercase ISO-639 language code and if present the optional <CC> is a valid two-character uppercase ISO-3166 country code. Both '_' and '-' are supported as delimiters. parentNodeId
- Specifies the DOM identifier of the node to which the form should be added. The value cannot be null.
onSuccess - A function that is called once the form is successfully initialized. The Form object is passed into this function. This can be used to add custom callback handlers that implement lifecycle events such as submit, close, and cancel. onError
- A function that is called if any errors are encountered in initializing the form. The function will receive any exception that was encountered during the initialization.
JSONP - Informs the Forms Runtime Adapter to use JSON with Padding (JSONP) when loading JSON resources. The default value is false. When the custom client and Forms Runtime Adapter are hosted on different servers, set the JSONP parameter as true. In this scenario, there are SOP (Single Origin Policy) issues while loading JSON resources. By using the JSONP technique, the JSON response is wrapped to a call to a function by the server and send to the client. A JSON resource can then be loaded using a script tag to avoid any SOP violations.
For the list of language codes and country codes required for specifying the locale parameter, visit the following web sites: List of language codes http://www.loc.gov/standards/iso639-2/langhome.html List of country codeshttp://www.iso.org/iso/country_codes/iso_3166_code_lists.htm com.tibco.forms.client.Form The com.tibco.forms.client.Form class provides access to the runtime form object. This object enables you to access panes and controls within the form, register handlers for form actions, and access data to be submitted back to the server. The com.tibco.forms.client.Form class has six fields which are used for setting action handlers. It also implements six methods. The details of the fields and methods are as follows: Table 6 com.tibco.forms.client.Form Class - Field Details Field
ACTION_APPLY ACTION_CANCEL ACTION_CLOSE ACTION_RESET ACTION_SUBMIT ACTION_VALIDATE
Description Identifies the "apply" action. Identifies the "cancel" action. Identifies the "close" action. Identifies the "reset" action. Identifies the "submit" action. Identifies the "validate" action.
Description Removes the form from its container and also releases its resources. This can be called by the client application to close the form.
792
| Appendix B
Method
Description Returns an array of LoadStat objects. Each statistic represents the measurement of a particular phase of the form load. This can be used by applications to report this information in the user interface or otherwise log the information. To enable collecting load statistics at runtime, the URL used by the client application to load the form should contain the parameter tibco_instr with a value true. Otherwise getLoadStats() method would return an empty array. To use getLoadStats() method, the client application needs to subscribe to PageBus event 'com.tibco.forms.form.loaded'. See com.tibco.forms.client.LoadStat for more details.
getLoadStats()
getLocale()
String String
Returns the string representation of the locale being used to render the form. Returns a JSON representation of the data being managed by the form. This is typically called from a submit handler in order to send the final results back to the server.
getSerializedParameters ()
Method
setActionHandler( String actionName, Function handler)
Description Adds a handler to the form that is invoked when the specified action is invoked in the form. Note that any handler already registered for this action will be replaced by this handler. The parameter details are as follows:
actionName - Used to specify the name of the action (e.g. ACTION_CLOSE). If the action is ACTION_SUBMIT, then all the validations in the form will be invoked prior to invoking the callback handlers. If any of the validations fail, then the callback handler will not be invoked. handler - This is the function that is invoked for the specified actionName. The form may have only one handler for each action. If this method is called more than once for the same actionName, the handler set previously will be replaced. Passing in null for this parameter will remove the handler for this particular action. The method signature of the handler function has two arguments: a string for the actionName and the form object.
setLocale(String locale)
Void
Sets the string representation of the locale currently being used to render the form, e.g. "en" or "en_US".
com.tibco.forms.client.LoadStat The com.tibco.forms.client.LoadStat class helps you to measure the load-time performance of the form. Each statistic has three fields: a description, a start time, and an end time. The times are measured in milliseconds from when the form load began. To use com.tibco.forms.client.LoadStat, the form loading has to be complete, including data loading and invocation of form open rules. The TIBCO PageBus event 'com.tibco.forms.form.loaded' is published when the form loading is complete. The client application needs to subscribe to this event in order to be notified that the form loading is complete and then use the getLoadStats() method.
794
| Appendix B
For example:
var callback = function(subject, form) { var stat = form.getLoadStats(); for (var i=0; i<stat.length; i++) { alert(stat[i].label+" |End Time : " + stat[i].endTime+" | Begin Time : " + stat[i].startTime); } } PageBus.subscribe('com.tibco.forms.form.loaded', null,callback);
The details of the fields are as follows: Table 8 com.tibco.forms.client.LoadStat Class - Field Details Field
label
Description Describes what is being measured by this particular loadstat. The time, in milliseconds, when this particular measurement phase began. This time is relative to the instant when the form load began. The time, in milliseconds, when this particular measurement phase ended. This time is relative to the instant when the form load began.
startTime
endTime
Number