Programmers 40

Download Programmers 40

Post on 22-Feb-2015

320 views

Category:

Documents

7 download

Embed Size (px)

TRANSCRIPT

<p>December 1998 Part Number: AR-400-PG-01.PDF</p> <p> 19911998 by Remedy Corporation. All rights reserved. This documentation may not be copied in whole or in part without the prior written consent of Remedy Corporation. Remedy, the Remedy Corporation logo, Action Request System, AR System, ARWeb, Flashboards, and Remedy Powered are registered trademarks or other trademarks of Remedy Corporation. HP and HP-UX are trademarks of Hewlett-Packard Company. AIX is a trademark of International Business Machines Corporation. INFORMIX is a registered trademark of Informix Software, Inc. Microsoft, MS, and MS-DOS are registered trademarks, and Windows, Windows NT, Windows 95, Windows 98 and all other Microsoft products mentioned in this document are registered or other trademarks of Microsoft Corporation. Motif, OSF, and OSF/Motif are trademarks of the Open Software Foundation, Inc. Oracle and SQL*Plus are registered trademarks, and Oracle8 is a trademark of Oracle Corporation. Silicon Graphics and IRIS are registered trademarks, and IRIX is a trademark of Silicon Graphics, Inc. Sun Microsystems, NFS, and PC-NFS are registered trademarks of Sun Microsystems, Inc. Solaris is a trademark of Sun Microsystems, Inc. SPARCstation is a trademark of SPARC International, Inc., licensed exclusively to Sun Microsystems, Inc. Sybase is a registered trademark of Sybase, Inc. UNIX is a registered trademark in the United States and other countries, licensed exclusively through X/Open Company Ltd. All other products mentioned in this document are protected by the trademarks or service marks of their respective companies or organizations. U.S. GOVERNMENT RIGHTS. Use, duplication, or disclosure by the Government is subject to Remedy Corporations commercial software license(s). If you are the U.S. government, you agree that these written materials are commercial computer software-related documentation licensed pursuant to the terms of Remedy Corporations commercial computer software license(s) in accordance with 48 C.F.R. 12.212 of the Federal Acquisition Regulations and its successors and 48 C.F.R. 227.7202-1 of the DoD FAR Supplement and its successors. Unpublished rights are reserved under the copyright laws of the United States. Part Number: AR-400-PG-01.PDF</p> <p>Table of ContentsPreface....................................................................................................................................... xi Audience ....................................................................................................................xi Overview of This Document .....................................................................................xi Related Remedy Documents................................................................................... xii Conventions Used in This Document.....................................................................xiv Chapter 1 Introduction ............................................................................................................................ 1-1 Overview of the AR System API............................................................................ 1-1 When to Use API Programming ............................................................................ 1-4 Chapter 2 Getting Started ....................................................................................................................... 2-1 Environment Setup for Windows .......................................................................... 2-1 Installing the API Files ......................................................................................... 2-2 Header Files................................................................................................ 2-3 Library Files ............................................................................................... 2-5 Source Code ................................................................................................ 2-5 Makefiles ................................................................................................................ 2-6 Chapter 3 Data Structures ...................................................................................................................... 3-1 Data Types.............................................................................................................. 3-2 Lists ........................................................................................................................ 3-3 High-Level Object Relationships........................................................................... 3-4 Login and Session Information ............................................................................. 3-6 Status Information................................................................................................. 3-8 Permission Information ........................................................................................3-11 Representing Values ............................................................................................ 3-12</p> <p>iii</p> <p>Representing Qualifications ................................................................................ 3-15 Qualifications that Use Conditional Operators ...................................... 3-17 Qualifications that Use Relational Operators ........................................ 3-17 Schemas ................................................................................................................ 3-20 Fields .................................................................................................................... 3-21 Defining Field Limits ............................................................................... 3-21 Defining Field Display Properties ........................................................... 3-24 Mapping Fields in Join Schemas............................................................. 3-27 Entries .................................................................................................................. 3-28 Retrieving Entry Lists ............................................................................. 3-28 Manipulating Individual Entries ............................................................ 3-32 Retrieving Multiple Entries..................................................................... 3-34 Filters, Escalations, and Active Links ................................................................ 3-34 Set Fields Action....................................................................................... 3-38 Push Fields Action.................................................................................... 3-45 OLE Automation Action........................................................................... 3-46 Menus ................................................................................................................... 3-50 Containers ............................................................................................................ 3-52 Retrieving Container Lists ...................................................................... 3-52 Manipulating Individual Containers ...................................................... 3-54 Importing and Exporting ..................................................................................... 3-57 Freeing Allocated Memory................................................................................... 3-58 Chapter 4 Creating and Executing API Programs ............................................................................ 4-1 Program Structure ................................................................................................. 4-1 Performing Common Tasks ................................................................................... 4-4 Example 1Retrieving Field Properties .................................................. 4-5 Example 2Retrieving Selected Entries .................................................. 4-6 Example 3Retrieving a Server List........................................................ 4-7 Specifying Fields or Keywords .............................................................................. 4-8 Error Checking ....................................................................................................... 4-9</p> <p>iv</p> <p>Action Request System Programmers Guide</p> <p>Executing API Programs in Workflow ................................................................ 4-12 Program Design Tips ........................................................................................... 4-14 Chapter 5 Debugging and Maintenance .............................................................................................. 5-1 Logging AR System Activity.................................................................................. 5-1 Using the Driver Program ..................................................................................... 5-2 Using print.c Routines ............................................................................... 5-3 Using driver from the Command Line ...................................................... 5-4 Creating and Using driver Scripts ............................................................ 5-8 Chapter 6 Functions ................................................................................................................................. 6-1 Object Manipulation Functions............................................................................. 6-1 Active Link.................................................................................................. 6-2 Container .................................................................................................... 6-2 Entry ........................................................................................................... 6-2 Escalation ................................................................................................... 6-3 Field ............................................................................................................ 6-3 Filter............................................................................................................ 6-3 Character Menu.......................................................................................... 6-4 Schema ........................................................................................................ 6-4 Support File ................................................................................................ 6-4 View............................................................................................................. 6-4 Other Functions ..................................................................................................... 6-5 ARCreateActiveLink .............................................................................................. 6-6 ARCreateCharMenu ............................................................................................ 6-10 ARCreateContainer.............................................................................................. 6-12 ARCreateEntry..................................................................................................... 6-15 ARCreateEscalation............................................................................................. 6-17 ARCreateField...................................................................................................... 6-19 ARCreateFilter..................................................................................................... 6-33 ARCreateSchema ................................................................................................. 6-35 ARCreateSupportFile .......................................................................................... 6-38</p> <p>v</p> <p>ARCreateVUI ....................................................................................................... 6-40 ARDecodeDiary .................................................................................................... 6-45 ARDecodeStatusHistory ...................................................................................... 6-46 ARDeleteActiveLink ............................................................................................ 6-47 ARDeleteCharMenu............................................................................................. 6-48 ARDeleteContainer .............................................................................................. 6-49 ARDeleteEntry ..................................................................................................... 6-50 ARDeleteEscalation ............................................................................................. 6-51 ARDeleteField ...................................................................................................... 6-52 ARDeleteFilter ..................................................................................................... 6-54 ARDeleteMultipleFields ...................................................................................... 6-55 ARDeleteSchema.................................................................................................. 6-57 ARDeleteSupportFile ........................................................................................... 6-59 ARDeleteVUI........................................................................................................ 6-60 ARExecuteProcess................................................................................................ 6-61 ARExpandCharMenu........................................................................................... 6-63 ARExport .............................................................................................................. 6-64 ARGetActiveLink ................................................................................................. 6-66 ARGetCharMenu ................................................................................................. 6-69 ARGetContainer................................................................................................... 6-71 ARGetEntry.......................................................................................................... 6-74 ARGetEntryBLOB ............................................................................................... 6-76 ARGetEntryStatistics .......................................................................................... 6-78 ARGetEscalation .................................................................................................. 6-80 ARGetField ........................................................................................................... 6-82 ARGetFilter .....................................................................................................</p>