HP SM DocumentEngine
HP SM DocumentEngine
For the Windows and Unix Operating Systems Software version 9.20
Document Release Date: June 2010 Software Release Date: June 2010
Legal Notices
Warranty
The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. The information contained herein is subject to change without notice.
Copyright Notices
Copyright 1994 2010 Hewlett-Packard Development Company, L.P
Trademark Notices
Adobe is a trademark of Adobe Systems Incorporated. Microsoft and Windows are U.S. registered trademarks of Microsoft Corporation. UNIX is a registered trademark of The Open Group.
Support
Visit the HP Software Support Online web site at: http://www.hp.com/go/hpsoftwaresupport This web site provides contact information and details about the products, services, and support that HP Software offers. HP Software online support provides customer self-solve capabilities. It provides a fast and efficient way to access interactive technical support tools needed to manage your business. As a valued support customer, you can benefit by using the support web site to:
Search for knowledge documents of interest Submit and track support cases and enhancement requests Download software patches Manage support contracts Look up HP support contacts Review information about available services Enter into discussions with other software customers Research and register for software training
Most of the support areas require that you register as an HP Passport user and sign in. Many also require a support contract. To register for an HP Passport ID, go to: http://h20229.www2.hp.com/passport-registration.html To find more information about access levels, go to: http://h20230.www2.hp.com/new_access_levels.jsp
Documentation Updates
The title page of this document contains the following identifying information:
Software Version number, which indicates the software version. Document Release Date, which changes each time the document is updated. Software Release Date, which indicates the release date of this version of the software.
To check for recent updates or to verify that you are using the most recent edition of a document, go to: http://h20230.www2.hp.com/selfsolve/manuals This site requires that you register for an HP Passport and sign in. To register for an HP Passport ID, go to: http://h20229.www2.hp.com/passport-registration.html Or click the New users - please register link on the HP Passport login page. You will also receive updated or new editions if you subscribe to the appropriate product support service. Contact your HP sales representative for details.
Contents
Contents 1 Document Engine overview
What is the Document Engine? Benefits of the Modular Approach Consistency Reduced Development Times Flexibility Accessing the Document Engine
5 9
9 9 9 10 10 10
2 Objects
Create and update Objects Object Definition form and fields Object Info tab field descriptions Locking tab field descriptions Revisions tab field descriptions Variable and Global Lists tab field descriptions Activities tab field descriptions Alerts tab field descriptions Approvals tab field descriptions Manage Queues tab field descriptions Views and Templates tab field descriptions Notifications tab field descriptions Search Configuration tab field descriptions Defined Queries tab Ranges tab
11
11 12 13 15 15 15 16 17 18 19 21 21 21 22 22
3 States
Searching Record Lists Viewing a single record Browsing a record Integration tips for display application Create and update States State Definition field descriptions
25
25 25 25 26 26 26 26
4 Processes
29
Create and modify a Process Process Definition form and field descriptions Initial Expressions tab Initial Javascript tab RAD tab Final Expressions tab Final Javascript tab Next Process tab
29 29 30 30 31 31 31 31
33
33 33 34 34 34 34 35 36 37 39 40
6 Troubleshooting overview
Research application path through the Document Engine Find dbdict or Object used Find State for the records Find the name of the Process Research application errors Print values of variables or results of expressions
41
41 41 41 42 42 43
45
46 47 48 49 50 51 51 53
Create an Initialization Process definition Create display application screen definition Create display application option definitions Add a close work order button Create a wizard for the work order Add a Process definition record Create an input form for the wizard Modify the close and update incident forms Create an alias in probsummary table for link Modify im.set.close Process definition Test the work order example
54 55 57 62 64 67 68 70 73 74 76
Consistency
The fact that the engine allows all applications to run using the same base RAD applications brings consistency to the Service Manager application suite. Core functionality, such as locking, alerts, approvals, and use of record list functionality, will work the same for any module, as they are all using the same code base.
Flexibility
The Document Engine uses Process records as a mechanism to modify the behavior of modules inside of Service Manager applications. You can create a new Process that has a different behavior than the base system, without the need to change or remove the original Process from the system. Additionally, the systems base Processes can be overridden with your own Processes to give greater flexibility to the system developer when tailoring Service Manager to meet an organization's specific requirements.
10
Chapter 1
2 Objects
Objects are a base set of definitions that determine behavior of records and set the definitions and governing rules. Objects correspond one-to-one with database dictionary (dbdict) records in Service Manager. If a table does not have a dedicated Object record, the Document Engine applies the settings in the DEFAULT Object. All Objects should have list and default States defined. If not otherwise supplied, the default States are db.browse, db.list, db.search, and db.view. NOTE: Do not modify or delete the DEFAULT Object Record as doing so will cause unpredictable results. The Object record sets up the definitions and governing rules for the behavior of the table within the Document Engine. For example these may include:
The application used to create the users profile within this Object that determines what actions this user may take against any record of the table. The State records used in specific circumstances (see the States section for more details). The category, phase, and paging file names for the Object. The name of the number record to be used for this Object. How locking is to be used by this Object. Setup of revisions for records in the table. Which variables should be available to processes that run against this Object. Which global lists should always be available when using this Object. Use of activity records. How alerts are processed against this Object. How approvals are processed for this Object. Settings for the work queues. Ability to set up personal or global views and default templates. Notifications on add / update / delete of a record in this Object. Ability to configure additional search choices against this Object.
To view a list of the out-of-box Objects, click Search from the Object Definition form. To view a list of the fields and field descriptions for the Object definitions see Object definition form and fields.
2 Objects
11
1. Navigate to the Document Engine. See Accessing the Document Engine for the steps. 2. Double click Objects. The Objects form opens. 3. Use the tabs on the Objects form, to fill in the fields required to create an Object that will perform the functions you desire. See the field descriptions for additional information. To update a Object definition: 1. Access the Document Engine. See Accessing the Document Engine for the steps. 2. Enter the name of the Object you want to update in the Object field or click Search to search for the Object.
This form also includes the following tabs. The fields on these tabs are described in the field descriptions tables for the respective tab.
Object Info tab - specifies the general properties and behavior of the Object. Locking tab - determines the locking behavior for the Object. Revisions tab - tracks revisions for the Object. Variables / Global Lists - describes local variables and global variables used by the Object. Activities - defines logging (activities). Alerts - defines where to set alerts and the conditions for generating alerts. Approvals - sets approval options for the Object. Manage Queues - controls how queues display as well as threading, and who can create views (inboxes). Views/Templates - defines whether or not a user can create global and personal views and templates on the Object.
12
Chapter 2
Notifications - identifies notifications sent automatically for add, delete, or update activity for any record in the Object. Search Configuration - controls the available options on the More Choices tab of the search screen.
13
Description Specifies the name of the Master Format Control record, if one exists for the record Object. Master Format Control allows you to define in one record the Format Control statements that apply to all phases in an area, for example Change Management Request Phases. Typically, the name of the master format control is the name of the dbdict or all categories in Incident Management, Problem Management, or Service Desk. Specifies the name of the joindef record used to join multiple tables, for example joincomputer, or an expression that evaluates to a valid joindef name, such as joindef in $L.category Specifies the field name that contains the record's status information.
Joindef joindef Status field statusField Assigned to fields assignedToFields Workgroup fields workgroupFields
Specifies the field name that contains the assignee name field for this Object. This field will be referred to when Folder Entitlement verifies that the record is assigned to the logged in operator. Specifies the field name that contains the assignment group field for this Object. This field will be referred to when Folder Entitlement verifies that the record is assigned to any of the logged in operator's work groups. Specifies the State definition record to use upon opening a new record.
Open state open.state Close state close.state List state list.state Default state default.state Search state search.state Browse state browse.state Manual states manual.states
Specifies the State definition record to use for close processing of an existing record. Specifies the State definition record used to display a list of records.
Specifies the name of the State used as default for the Object. To edit a record in this Object, the default State is used. Specifies the State definition record to use for searching.
Defines the State definition record to use when records use locking. Essentially, this field defines a read-only State when a record is currently locked by another user. Specifies the array of States that may be used with this Object other than the life-cycle states of open, close, list, view, search or browse.
14
Chapter 2
15
Note: Global variables are built and stored in memory. The field descriptions for the Variable/Global List tab are:
Field Name Local variables local.variables Description Enter a list of local variables that can be used in Processes. Local variables are defined in the application. Local variables are assigned to the Object you are creating and are available to all Processes and States associated with the Object. Local variables are not available to other Objects. Global lists, once created, are available to all Processes. Global lists can be built on login, if they are listed in the Startup list. Global lists are available every time you access the Object.
16
Chapter 2
17
Approval notification single.notify.approval Denial notification single.notify.denial Retraction notification single.notify.retraction Final approval notification final.notify.approval
18
Chapter 2
Field Name Final denial notification final.notify.denial Approval FC appr.fc Approval process approval.process Denial process denial.process Preapprove on open preapprove.cond
Specifies the name of the Format Control record to run upon approval. Select the Process to run when the record is approved.
Determines whether the record should be automatically approved. If the condition is true and the user belongs to one of the pending approval groups, the approval is processed automatically. If the user does not belong to one of the pending approval groups, the approval does not occur automatically and must then go through the regular approval process. Defaults to true. Select this check box to log the history of approvals in the ApprovalLog table. If checked, approval comments are requested from the approver.
Log approvals? log.approvals Require appr. comments approval.comments Aggregate approvals? aggregate.approvals Recalculate approvals if approval.recalc Reset approvals if approval.reset
Specifies the conditions that determine whether or not to recalculate the conditions on the existing approvals. Determines when to delete existing approvals and recalculate all conditions.
19
Description Specifies a condition that allows only certain users to view the queues that display records of this Object. For example, browse in $G.pm.environment. Select the format to use to display the view. The out-of-box Service Manager has a default display format: sc.manage.generic that is used if no other form is chosen. HP recommends that you do not change the sc.manage.generic format. Select the default view for this queue. By specifying a user view for a particular user, a specific list of views can be set up for the HP Service Manager Manage Queues. If a user does not have a specific view defined , the default user view is used. Specifies a default query to run if no default view is selected.
Manage default query scm.query Default query description scm.query.name Thread view -> search? scm.thread.list.edit Search format (if necessary) scm.search.format Thread search -> list? scm.thread.search.list Thread list -> edit? scm.thread.list.edit Thread view -> edit? scm.thread.inbox.edit Allow add condition scm.add.condition Add/open application scm.add.appl Parameter Names scm.add.names Parameter Values scm.add.values
Specifies a name for the above field. You can associate a message with this field. For example, scmsg(491, "us"). Specifies true or an expression that evaluates to true to open a new thread when conducting a search. Select a default search format.
Specifies true or an expression that evaluates to true for a new thread when a user finds a list of records to view. Specifies true or an expression that evaluates to true for a new thread when a user selects a record to view out of a list of records. Specifies true or an expression that evaluates to true to open a new thread when the user views an existing record out of the queue. Specifies an expression that evaluates an operators ability to add a record. Specifies the name of the application to call when a record is added or opened. Specifies the parameter names to pass to the application specified in the Add/open application field. Specifies the parameter values to pass to the application specified in the Add/open application field
20
Chapter 2
21
Field Name Table Name tablename Search Format searchFormat Initialization Process init.process Allow Advanced Find allowAdvAccess
The name of the sub-format used for the More Choices tab.
The name of a Process that will be run before displaying the search form. Defines the conditions that determine whether or not to allow Advanced Find.
Provides the label for the check box on the More Choices tab.
Ranges tab
The Ranges tab allows you to easily set up a search for begin and end date ranges. To do so click the Modify Configuration link, to define a variable each for begin and end to use as input in the form. Enter this variable in the Variable 1 column and use the Field and Operator 1 columns to define the query that will be executed. Modify Configuration is also how modifications are made on the Defined Queries tab as well. The field descriptions for the Ranges tab are:
22
Chapter 2
Field Name Field fieldName Operator 1 operator1 Variable 1 variable1 Special Type specialType
Ranges tab
23
3 States
States are called by Objects and are defined by Processes. The State record contains information about how a record looks and acts at a specific period in time. A State record definition can include the following:
The State name. The display screen to use in order to display the record or records. The initialization process used when a list is first displayed. The format to use to display the data. The input condition to indicate whether or not a user can modify the record. The Process to run when a user triggers a specific display option (Display Action).
The State record used depends on how many records the user views. There are out-of-box State records for searching for records, viewing a list, viewing a single record, and browsing a record.
Searching
When there are no records in the current file variable, it is assumed that the user is in search mode. The State that is used is the Search State defined in the tables Object record. The default search state is db.search.
Record Lists
When viewing a list of records, the List State defined in the tables Object record is used. The default list state is db.list. Note: In some earlier versions of Service Manager, record lists are referred to as QBE lists.
3 States
25
Browsing a record
When browsing a record in read-only mode, the Browse State defined in the tables Object record is used. Note that only files that use locking need a browse State. Although viewing a record without having update rights looks similar to the browse screen, it is using the default State, not the browse State. There is no default browse state.
26
Chapter 3
Field Name Display Screen display.screen Initialization Process init.process Format format.name
Specifies the format in which the State record opens. This form is stored in a record, and it can be a variable or hard-coded. The name of the format can be hard-coded or be contained in a variable or retrieved from a record via a system language expression. The input condition is evaluated for view States and determines whether or not the record is read-only. Specify false for read-only or true for editable. You may also enter an expression that evaluates to true or false.otherwise, enter true or enter an expression that evaluates to true or false.
Non-base methods Display Action process.label Process Name valid.process Condition process.condition Save First run.save.before Specifies an expression that evaluates to true for the Process specified in the Process Name to be called. Choose to run the save Process before you run this Process. Type true to save first; otherwise, enter false. The default is false. Specifies the action parameter that comes from a display action after input from a user. The display action comes from the action field in the display option of a button or menu item clicked by a user. Specifies the name of the Process run as a result of the action.
27
4 Processes
Processes are the smallest discrete units of work available to the Document Engine and are the level where the data is manipulated. Users can create their own Process or use one of the over 700 Processes that ship with Service Manager. The Process definition consists of initial expressions, RAD, and final expressions, entered on the Initial Expressions, Initial Javascript, RAD, Final Expressions, Final Javascript, and Next Process tabs, as well as an optional call to a next Process. Expressions are written using standard RAD expressions and/or JavaScript.
4 Processes
29
Description When selected, then the system runs a standard process after completing the current action or Process. A standard Process such as save, for example. If you have created a save Process and want to run the save Process that comes with the Document Engine after completing the save process you defined, check this box. A standard process is defined in the base functions sections of this document. When selected, the process runs in a separate window.
If the Run in Window? check box is selected, specify a title for the window. An scmsg expression can be used for localized window titles, such as scmsg(1980, "us").
In addition to the fields described above, there are also tabs on this form that allow you to further define the Process. These tabs are:
Initial Expressions Initial Javascript RAD Final Expressions Final Javascript Next Process
30
Chapter 4
RAD tab
The RAD tab defines the pre-RAD expressions, RAD calls, and post-RAD expressions that run as part of the Process. The field descriptions for the RAD tab are: Note: These fields are repeated for each RAD application defined on this tab.
Field Name Expressions evaluated before RAD call pre.rad.expressions Description Specify the expression to run prior to the RAD application defined in the RAD Application field. All parameter values passed to the RAD application must be in the form of variables or expressions. The variables must be assigned their values in the pre-RAD expressions; for example, $L.value.name="Test". Specifies the name of the RAD application to run.
RAD Application application Condition rad.condition Parameter Names names Parameter Values values Post RAD Expressions post.rad.expressions
Specify under which circumstances the RAD application should be executed (condition evaluates to true) or skipped (condition evaluates to false). Specifies the parameter names passed to the RADapplication
Specifies the parameter values passed to the RAD application. These values must be in the form of variables or expressions. String values can be passed when enclosed in double quotes ( "Wizard Name"). Specifies any RAD expression that will run after the RAD application completes.
RAD tab
31
Specifies a condition associated with the Process in the Next Process field that evaluates to true or false. For example, true for the sm.close Process.
32
Chapter 4
DEFAULT Object
Any file accessed by the Database Manager automatically uses the rules and processes defined for the corresponding Object. If no Object has been defined for the file, it uses the DEFAULT Object. The DEFAULT Object duplicates the functionality of the earlier versions of the Database Manager. A System Administrator may also access a file that has a corresponding Object via the DEFAULT Object by accessing the file through Database Manager with the Administration Mode check box marked. This check box is available for System Administrators only. A user with the capability word of "AlwaysAdmin" will always use the DEFAULT Object when accessing information within Service Manager. Assigning the capability word to a user is not recommended. The Document Engine uses environment profiles. In previous versions of the system, a System Administrator was granted all rights (add, update, delete.), regardless of the format control settings. With the Document Engine, the rights granted match those defined in the format control record. Administrators that prefer the old method of granting rights can simply modify the Profile Application setting in the DEFAULT Object record from db.environment to db.environment.sysadmin.
RAD applications
With a database driven application, a user may be working with any of the following three basic record sets:
Zero records when searching for information. Many records when looking at a list of information. One record when making changes to a single record.
you either view a blank form, where you can enter search information (or create a new record), or you are working on updating / viewing a single record, or you did a search and now have a set of multiple records displayed as a list.
The Document Engine uses three main RAD applications to mirror this idea. The RAD routine used is determined by the number of records displayed at any time.
33
se.search.engine
The search engine is used when there are no records being viewed. The main purpose of this routine is to formulate a query and select records from the correct table. This routine may also be used for the initial entry of information into a blank record for the purpose of adding a new record to the database. The Default State is db.search.
se.list.engine
The list engine displays multiple records. Using the list engine a user may select a specific record from the list, or perform actions on the entire list of records. Default State is db.list.
se.view.engine
The view engine displays a single record. This application is used to perform actions against a specific record, such as updates or deletes. Default State is db.view. Note: When using Service Managers record list functionality, the view engine is used for both the list and single record information.
34
Chapter 5
Note: All RAD applications related to the Document Engine start with "se", such as se.view.engine. The document engine treats every record as a document made available to the user. When a file is displayed using the Document Engine it will always be using one of the three applications specified earlier in this document. The display screen, display options, and format are determined by the current State of the record. When a display option is triggered, after the standard display functionality is performed, the engine checks the action of that option against the available processes defined in the current State record. If there is a process defined that has a condition that evaluates to true, the engine then performs that process against the current record (or record set). If the action is not defined in the State record, the engine will then check to see if that action is defined as a Base Process in the current application. If it is, then the system will perform that base process against the record. If not, no action is taken.
Integration tips for display application
If a display screen does not have any display events associated to it, the system automatically uses the se.default display event that performs se.lock.object in case of OnFormModified. If a display option record has the Modifies Record check box activated, the record is locked when the button is pressed.
35
36
Chapter 5
Display Action initrevision newsite newview newTable addFilter editFilter addCompound removeSelection
Triggered by customer performing an Advanced Filter search in the standard search screen. Triggered by customer performing an Advanced Filter search in the standard search screen. Triggered by customer performing an Advanced Filter search in the standard search screen. Triggered by customer performing an Advanced Filter search in the standard search screen.
37
Description Exits to the calling menu. Performs delete Format Control and attempts to delete record from the database after validating the request. When selected, the system presents to the user a list of alternate forms in which to display the current record. Prints the current record. Prints the current list of records. Performs Service Manager validity lookup. Validity lookup verifies via an entry in the validity table that a specific value is valid for the defined field. Using validity lookup, the system verifies that a user entered value complies with the validation rules. Standard Service Manager export/unload functionality (multiple record). Provides unload functionality for a list of records. Adds a new set of records that exactly duplicates an existing set of records except that new set of records will have a unique key value updated with new data. At the end of the processing there will be twice as many records in the table. Provides the same updates to a set of specified fields in a list of records. Deletes a specified set of records from a table. Runs an IR Query text search. Expand array provides additional functionality for editing arrays, such as insert line and delete line. Counts records in the record list and displays the total count. Calls the standard audit history routine. The audit history is determined by the fields to audit as defined in the auditdef table. Saves the current query as a view. Views the approval history for the current record. Views the alert history for the current record. Views the current and scheduled alerts for the current record.
massupdate* massdelete* irquery expandarray count* audithistory inbox.save / inbox* approval.log alert.log alerts
38
Chapter 5
Description The page list shows a complete history of a record. When paging is enabled, every time an update is performed, a copy of the record is written to the page file. The page list shows the complete history of a record based on the paging file. Displays clock records associated with this record. Handles XML fields, such as the user options in Service Catalog. Creates a Template record out of the current record. Applies an existing Template to the current record.
Note: * These commands only apply if the record list functionality is being used.
massupdate massdelete
39
Local variables
Local variables begin with $L. and persist only within the currently executing RAD application. The server cleans up local variables automatically when it exits a RAD application. The following is a list of Standard Variables used with the Document Engine: $L.action - the display action value from the display option $L.bg - Background flag $L.category - The category record (if available) $L.env - The current environment record $L.exit - internal exit parameter $L.file - The current file variable $L.file.save - A copy of the record in its original state $L.format name of the format used to display the record $irspread determines the IR discovery options: 0=shallow search, 2=deep search, 4=complete match $L.mode the mode the viewed record is in, typically add to create a new record, update to modify an existing record or close to finish processing of an existing record $L.mult - Flag that is true if there are multiple records in the $L.file variable $L.object - The object record $L.phase - The phase record (if available) $L.sql or $L.query- the current query $L.sort - the current sort order $L.state The state record the system is using (=the state the record is in). Variables that are available in View mode (when viewing a single record) $L.fc copy of the detail FormatControl record $L.fc.master copy of the master FormatControl record
40
Chapter 5
6 Troubleshooting overview
To successfully troubleshoot the Document Engine you will need to gather the following information:
What dbdict and Object is being used What State is the record in What is the Process being called Steps followed to reproduce (STR) the problem
To determine which dbdicts or Object is being used, search the log file. Log sample:
1320 07/18/2006 11:00:36 RADTRACE 20 [ 1] se.get.object get.object select CPU( 0 1411 ) 1320 07/18/2006 11:00:36 (0x0129AC08) DBACCESS - Cache Find against file Object found 1 record, query: file.name="pcsoftware" 1320 07/18/2006 11:00:36 RADTRACE 20 [ 1] se.get.object set.access process CPU( 0 1411 )
The next question to look at is which State the record is in. To find that information, search for the following in the trace sm.log: Log sample:
6 Troubleshooting overview
41
1320 07/18/2006 11:00:48 RADTRACE 10 [ 1] se.get.state select.state select CPU( 0 1491 ) 1320 07/18/2006 11:00:48 (0x01292FB0) DBACCESS - Cache Find against file States found 1 record, query: state="pcs.list" 1320 07/18/2006 11:00:48 RADTRACE 10 [ 1] se.get.state exit.normal process CPU( 0 1491 )
The name of the Process can be found as well, by searching in the sm.log containing the trace shown in the following example. Log sample:
1320 07/18/2006 11:00:50 RADTRACE 20 [ 1] se.call.process select.process select CPU( 0 1542 ) 1320 07/18/2006 11:00:50 (0x00B56810) DBACCESS - Cache Find against file Process found 1 record, query: process="upgrade.pcs" 1320 07/18/2006 11:00:50 RADTRACE 20 [ 1] se.call.process run.pre.exp process CPU( 0 1542 )
42
Chapter 6
Process panel run.pre.exp in RAD se.call.process encountered error in line 1 (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Bad arg(2) oper = (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Bad arg(2) oper = (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Bad arg(2) oper nullsub (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Bad arg(2) oper in (se.call.process,run.pre.exp) Cannot evaluate expression (se.call.process,run.pre.exp) Unrecoverable error in application: se.search.objects on panel call.list.engine Unrecoverable error in application: se.list.engine on panel call.process.1 Unrecoverable error in application: se.call.process on panel run.pre.exp
In this example (not out-of-box), the error occurred in se.call.process, run.pre.exp, or in other words, while evaluating the initial expressions of the Process. To find out which Process was causing the issue, go through the steps outlined above and note the process from the line:
DBACCESS - Cache Find against file Process found 1 record, query: process="upgrade.pcs"
Go to the Process record by the name of upgrade.pcs and check for any statements on the initial expressions tab. In this specific case, the expression will include the word nullsub. For example, the expression in question for this test may be
$L.icount=nullsub($L.icount, anynumberIwant)
The variable, anynumberIwant, is not a valid field, literal or variable, so it will have to be changed to prevent this issue.
43
Database Dictionary to create a new table Forms Designer to modify out-of-box forms and create new forms. Wizard creation tool
The work order example walks you through the following steps:.
Create a new database dictionary (dbdict) using the dbdict utility. Specify the key fields for the table. Create a EXWorkOrder form for the EXWorkOrder table using Forms Designer. Create a Sequential Number File. Modify the form to include drop-down lists. Create a link for the EXWorkOrder form. Create a form for the wizard to use to collect information for the work order. Modify the close and update incident forms Create aliases to link work orders to incidents Create State definitions. Create Display Application Screen Definitions for open, close, and view. Create Display Application Option Definition of Add, Cancel, Fill and Find for open, close and view. Modify the Process definition record im.set.close Test the work order example
45
Create a table
Use the dbdict utility to create a new table. In this example you will create a table named EXWorkOrder. Before you can create this table, you need to know what fields are needed and the attributes of the fields.In this example, the table stores the data for work orders associated with incidents. To create a table: 1. From the System Navigator, click Tailoring > Database Dictionary. The Database Dictionary form opens. 2. Type EXWorkOrder in File Name. 3. Click New. 4. On the Fields tab, enter the following information after clicking NewField/Key.
Field ID RelatedID Description Will be filled from the number file. Type: character Will be filled by the unique ID of the related record, example: incident number) Type: character Used to store the status of the work order. Type: character initiator assignee.name description category RelatedCIs The operator who opened the work order. Type: character The operator assigned to the work order. Type: character Used to hold the description of the work to do for the work order. Type:array of character Filled from the category of the related record. Type: character Used for the list of Configuration Items (CIs) associated with the work order. Type: array of character Type: character Type: character
status
impact urgency
46
Chapter 7
Type: character Type: character Date by which the work order must be completed and filled on open. Type: date/time The assignee's estimate for completion. Type: date/time . Type: array of character . Type: array of character
5. After you have added the fields to the table you need to add keys to the table. You should not exit Database Dictionary utility until you have done this for the EXWorkOrder table. See Add key fields to table for the detailed information.
5. Click OK.
47
Create a form
Go to Forms Designer to create a form for the EXWorkOrder table. Utilizing the wizard to create the form select Detail of a single record and proceed. A basic form with all of the fields will be created which can be modified as needed. Below is an example for the EXWorkOrder form:. To create a form: 1. From the System Navigator, click Tailoring > Forms Designer. The Forms Designer form opens. 2. Type EXWorkOrder in Form Name. 3. Click New. 4. Click Yes to use the Form Wizard. 5. Type EXWorkOrder for the name of the table for which to create a form. 6. Select Detail of a Single Record for the type of form you want to create. 7. Click OK. 8. Click Proceed to accept the defaults for the fields to include on the form. 9. Use the Forms Designer tool to modify the form layout. Below is an example of the EXWorkOrder form. 10. The values for Status are: New (default status)
Canceled Rollback
48
Chapter 7
Incident ID - ID
49
Category - category Related Id - RelatedID Status - status Assignee - assignee.name Description - description,1 Priority - priority Impact - impact Urgency - urgency
6. Select the initiator row (highlight) then right click initiator and choose Select Line. 7. In the link.structure.g form enter the following information for initiator. Then repeat Step 6 for assignee.name and RelatedCIs and use the following information for those fields, respectively.
Source Field (Fill To/Post From) initiator Target Field Name (Fill To/Post From) name
50
Chapter 7
assignee.name RelatedCIs
name logical.name
51
5. Click Save. 6. Select the Manage Queues tab. 7. On the Manage Queues tab, enter the following information.
Field Manage condition Manage display format Manage default query Allow add condition Default query description Value true sc.manage.WorkOrder assignee.name=operator() false My WorkOrders
52
Chapter 7
3. Click ADD.
To create a State definition for close: 1. From the System Navigator, click Tailoring > Document Engine > States. The State Definition form opens. 2. Enter the following information.
Field State Display Screen Initialization Process Format Input Condition Value EXWorkOrder.close EXWorkOrder.close EXWorkOrder.close.initial $L.format true
3. Click ADD.
53
To create a State definition for view: 1. From the System Navigator, click Tailoring > Document Engine > States. The State Definition form opens. 2. Enter the following information.
Field State Display Screen Initialization Process Format Input Condition Value EXWorkOrder.view EXWorkOrder.view EXWorkOrder.view.initial $L.format true
3. Click ADD. To create a State definition for search: 1. From the System Navigator, click Tailoring > Document Engine > States. The State Definition form opens. 2. Enter the following information.
Field State Display Screen Initialization Process Format Input Condition Value EXWorkOrder.search db.search EXWorkOrder.view.search $L.format true
3. Click OK.
54
Chapter 7
To create a Process definition for initialization: 1. From the System Navigator, click Tailoring > Document Engine > Processes. The Process Definition form opens. 2. Type EXWorkOrder.open.initial in Process Name. 3. Click Add. 4. Type $L.format="EXWorkOrder" the Initial Expressions tab. 5. Click Save. 6. Enter the following information in the RAD tab.
Field Expressions evaluated before RAD call RAD Application Parameter Names name index text Value $L.number.record="EXWorkOrder";$L.number.type="string" getnumb Parameter Values $L.number.record ID in $L.file $L.number.type
7. Click Save.
55
4. Click Add and then click OK. 5. For this example you need to create display application screen definitions for close screen also. Use the following information:
Field Screen ID Title Format I/O (If RIO) On option 0: Language Value EXWorkOrder.close Close Work Order $L.format true redraw screen ENG
6. Click ADD and then click OK. 7. For this example you need to create display application screen definitions for view screen also. Use the following information:
Field Screen ID Title Format I/O (If RIO) On option 0: Language Value EXWorkOrder.view View New Work Order $L.format true redraw screen ENG
56
Chapter 7
In doing this, you will repeat the same steps four times for each of the WorkOrder screen definitions (open, close, view). However, each time you enter different values in the fields on the Display Application Option Definition form. The tables below the steps provide the values you need to configure the display application options. For additional information about the display application options, see the online help topics for the display application on the HP Service Manager online help server. After you create the display application screen definitions for open, close, and view, you need to create display application options for the open, close, and view screens. To create a display application option definition: 1. From the System Navigator, click Tailoring > Tailoring Tools > Display Options. The Display Application Screen Definition form opens. 2. Type EXWorkOrder.open in Screen ID. 3. Enter the following information.
Field Unique ID Action GUI option Text Option Bank Condition Default Label Value Automatically generated (EXWorkOrder.open_add) add 4 4 1 true Add
4. Click Add. 5. Click OK. 6. Repeat steps 1 - 6 for each of the following display option definitions using the values provide in the table.
57
Note: In some cases the value required for the Action field is not available in the drop-down list, but you can type the applicable value in the field. Open - Cancel
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.open Generated by the system. (EXWorkOrder.open_cancel) back 3 3 1 true Cancel
Open - Fill
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.open Generated by the system. (EXWorkOrder.open_fill) fill 9 9 1 true Fill
Open - Find
Field Value
58
Chapter 7
Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label
Close - Cancel
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.close Generated by the system. (EXWorkOrder.close_cancel) back 3 3 1 true Cancel
Close - Close
Field Screen ID Unique ID Action GUI option Value EXWorkOrder.close Generated by the system. (EXWorkOrder.close_close) close 5
59
5 1 true Close
Close - Fill
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.close Generated by the system. (EXWorkOrder.close_fill) fill 9 9 1 true Fill
Close - Find
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.close Generated by the system. (EXWorkOrder.close_find) find 8 8 1 true Find
60
Chapter 7
View - Cancel
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.view Generated by the system. (EXWorkOrder.view_cancel) back 3 3 1 true Cancel
View - Fill
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label Value EXWorkOrder.view Generated by the system. (EXWorkOrder.view_fill) fill 9 9 1 true Fill
View - Find
Field Screen ID Unique ID Value EXWorkOrder.view Generated by the system. (EXWorkOrder.view_find)
61
View - Save
Field Screen ID Unique ID Action GUI option Text Option Bank Condition Default Label
62
Chapter 7
1. From the System Navigator, click Tailoring > Tailoring Tools > Display Options. The Display Application Screen Definition form opens. 2. Type EXWorkOrder.view in Screen ID. 3. Enter the following information.
Field Unique ID Action GUI option Text Option Bank Condition Default Label Value Automatically generated (EXWorkOrder.view_close) close 5 5 1 true Close
4. Click Add. 5. Click OK. To update the EXWorkOrder.view state definition: 1. From the System Navigator, click Tailoring > Document Engine > States. The State Definition form opens. 2. In the State field, type EXWorkOrder.view and then click Search. The EXWorkOrder.view state definition form opens. 3. Add the following to update the state definition form.
Field Display Action Process Name Condition Value close EXWorkOrder.close true
4. Click Save and then click OK. To add a process definition record for EXWorkOrder.close: 1. From the System Navigator, click Tailoring > Document Engine > Processes. The Process Definition form opens. 2. Type EXWorkOrder.close in Process Name.
63
3. Click Add. 4. On the Initial Expressions tab, type the following expression: status in $L.file="Closed"
$L.mode="closed"
64
Chapter 7
5. Click Save. 6. In the File Selection tab of the Wizard Information form, select the Select $L.file by tab. 7. On the Select $L.file by tab, enter the following information:
Field Create a record of type Value true EXWorkOrder
10. Click Save. 11. On the Actions tab, enter the following information:
Field Perform Actions On Value Select Current File ($L.file).
65
initiator in $L.file=operator() status in $L.file="New" RelatedID in $L.file=number in $relatedRec category in $L.file=category in $relatedRec impact in $L.file=initial.impact in $relatedRec urgency in $Lfile=severity in $relatedRec priority in $L.file=priority.code in $relatedRec
Display Record(s) when com- Click Display Record(s) when complete? plete? Mode Select Add.
12. Click Save. 13. On the Cancel Expressions tab, enter the following information:
Field Expressions Executed on Cancel Value cleanup($relatedRec)
66
Chapter 7
$relatedCIs={}
5. Click Save. 6. On the Initial Javascript tab, type the following expression:
system.vars.$relatedCIs=system.library.BSGFunctions.getMembers(system.vars.$L_ file.affected_item, false, 3)
67
RAD Application Parameter Names Parameter Values Parameter Names Parameter Values Condition
9. Click Save. 10. On the Final Expressions tab, type cleanup($relatedRec). 11. Click Save and then OK.
68
Chapter 7
4. Create the following input fields on the form: Description (Please enter a description of the work to be done)
Due date (Please enter the due date for this work order) Assignee (Please enter the assignee for this work order) CIs (Please enter the CIs this work order is for)
6. Click Save. The following figure shows a sample createWO.assigneeAndCIs form for the EXWorkorder wizard input form.
69
Format: WorkOrder.vj Virtual Join: checked Display Blank: checked Display Using Table: checked Input: number.WO.vj
8. Click Save. 9. Use the Forms Designer tool to create the WorkOrder.vj form: WorkOrderID: ID
WorkOrder Deadline: deadline WorkOrder Status: status WorkOrder Assignee: assign.name WorkOrder Description: description
10. Repeat steps 1 - 8 for the IM.close.incident. Note: You can use the WorkOrder.vj form created in step 9 for the virtual join. The following figures show samples of the tabs to add.
70
Chapter 7
71
72
Chapter 7
73
1. From the System Navigator, click Tailoring > Tailoring Tools > Links. The Link File form opens. 2. Type probsummary in Name. 3. Click Search. 4. Click after the last entry to create a blank line for a new entry. 5. In the Source field, type number.WO.vj. 6. Select the entire new line and then click Select Line. 7. Enter the following information:
Field Field (From/Source) File (To/Target) Field (To/Target) Query Expressions Value number.WO.vj EXWorkOrder RelatedID $query $query="RelatedID=\""+number in $File+"\""
8. Click Save and then Back. 9. Repeat steps to create a link line for the ID field. 10. Enter the following information.
Field Field (From/Source) File (To/Target) Field (To/Target) Query Expression Value ID EXWorkOrder ID $query $query="ID=\""+nullsub(cursor.field.contents(), "xxx")+"\""
74
Chapter 7
1. From the System Navigator, click Tailoring > Document Engine > Processes The Process Definition form opens. 2. Type im.set.close in Process Name. 3. Click Search. 4. On the Initial Javascript tab, type the following JavaScript: var WO=new SCFile ("EXWorkOrder") var FoundOpenWO=WO.doSelect ("RelatedID=\""+system.vars.$L_ file.number + "\""+" and status ~=\"" + "Closed" + "\"" if (FoundOpenWO == RC_SUCCESS) { system.vars.$openWO=true; } else { system .vars.$openWO=false; } 5. Click Save. 6. On the RAD tab, enter the following information:
Field Value
Note: Some of the fields on the RAD tab are pre-filled with values that you do not need to modify RAD Application - Select the empty section below the section calling the RAD Application us.consume.wrapper and then enter the following information: Expressions evaluated before RAD call RAD Application Condition Parameter Names Parameter Values $L.text="There are still open work orders. This incident cannot be closed yet." apm.mb.ok $openWO=true text $L.text
7. Click Save. 8. On the Final Expressions tab, enter the following information:
75
In Incident Manager, find an open incident or create one. Use the Options menu or button on the tool bar to create a work order. Create Workorder should display on the Options menu. In the Workorder wizard, enter the data to create a work order for the incident. Add the work order to the incident and save the changes to the incident. Open the incident for editing, and from the WorkOrder tab edit the work order. Save your changes. Open the incident again, and this time edit the work order and close it. You should now be able to close the incident. Repeat these steps, but this time create two work orders for an incident. Close only one work order and then attempt to close the incident. The system should generate an error message indicating that there are still open work orders for the incident, and therefore it cannot be closed. Close all work orders for the incident. You should now be able to close the incident.
76
Chapter 7