JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
ToolTalk User's Guide
search filter icon
search icon

Document Information

Preface

1.  Introducing the ToolTalk Service

2.  An Overview of the ToolTalk Service

3.  Message Patterns

Message Pattern Attributes

Scope Attributes

Scoping to a Session Only

Scoping to a File Only

Scoping to a File in a Session

Scoping to a File and/or a Session

Adding Files to Scoped Patterns

Context Attributes

Pattern Argument Attributes

Disposition Attributes

4.  Setting Up and Maintaining the ToolTalk Processes

5.  Maintaining Application Information

6.  Maintaining Files and Objects Referenced in ToolTalk Messages

7.  Participating in ToolTalk Sessions

8.  Sending Messages

9.  Dynamic Message Patterns

10.  Static Message Patterns

11.  Receiving Messages

12.  Objects

13.  Managing Information Storage

14.  Handling Errors

A.  Migrating from the Classing Engine to the ToolTalk Types Database

B.  A Simple Demonstration of How the ToolTalk Service Works

C.  The ToolTalk Standard Message Sets

D.  Frequently Asked Questions

Glossary

Index

Scope Attributes

You can specify the following types of scopes in your message patterns:

  1. Scope to a session only.

  2. Scope to a file only.

  3. Scope only to a file in a particular session.

  4. Scope to either or both a file and a session.


Note - File scopes are restricted to NFS and UFS file systems; you cannot scope a file across other types of file systems (for example, a tmpfs file system).


Scoping to a Session Only

The type TT_SESSION scopes to a session only. Static session-scoped patterns require an explicit tt_session_join call to set the scope value; dynamic session-scoped patterns can be set with either the tt_session_join call or the tt_pattern_session_add call.


Note - The session specified by these calls must be the default session.


shows a static session-scoped pattern; shows a dynamic session-scoped pattern.

Example 3-1 Static Session-Scoped Pattern

Obtain procid
tt_open();
Ptype is scoped to session
tt_ptype_declare(ptype);
Join session
tt_session_join(tt_default_session());

Example 3-2 Dynamic Session-Scoped Pattern with a File Attribute

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat, TT_SESSION);
Add session to pattern
tt_pattern_session_add (tt_default_session());
Register pattern
tt_pattern_register(pat);

Scoping to a File Only

The type TT_FILE scopes to a file only. shows a static file-scoped pattern; shows a dynamic file-scoped pattern.

Example 3-3 Static File-Scoped Pattern

Obtain procid
tt_open();
Ptype is scoped to file
tt_ptype_declare(ptype);
Join file
tt_file_join(file);

Example 3-4 Dynamic File-Scoped Pattern

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat, TT_FILE);
Add file to pattern
tt_pattern_file_add (pat, file);
Register pattern
tt_pattern_register(pat);

Scoping to a File in a Session

The type TT_FILE_IN_SESSION scopes to the specified file in the specified session only. A pattern with this scope set will only match messages that are scoped to both the file and the session. adds the session and then registers the pattern.

Example 3-5 Adding a Session to the TT_FILE_IN_SESSION-Scoped Pattern

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat,TT_FILE_IN_SESSION);
Add file to pattern
tt_pattern_file_add(pat, file);
Add session to pattern
tt_pattern_session_add(pat, tt_default_session());
Register pattern
tt_pattern_register(pat);

registers the pattern and then joins a session.

Example 3-6 Joining a Session to Set the Session of a TT_FILE_IN_SESSION-Scoped Pattern

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat, TT_FILE_IN_SESSION);
Add file to pattern
tt_pattern_file_add(pat, file);
Register pattern
tt_pattern_register(pat);
Join session
tt_session_join(tt_default_session());

sets the scope value for a static pattern.

Example 3-7 Setting the Scope Value for a TT_FILE_IN_SESSION Static Pattern

Obtain procid
tt_open();
Declare Ptype
Tt_ptype_declare(ptype);
Join File
tt_file_join(file);
Join session
tt_session_join(tt_default_session());

Scoping to a File and/or a Session

A TT_BOTH-scoped pattern will match messages that are scoped to the file, the session, or the file and the session. However, when you use this scope, you must explicitly make a tt_file_join call; otherwise, the ToolTalk service will only match messages that are scoped to both the file and session of the registered pattern. and show examples of how to use this scope.

Example 3-8 A Dynamic Pattern that Uses the TT_BOTH Scope

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat, TT_BOTH);
Add session to pattern
tt_pattern_session_add(pat,tt_default_session());
Add file to pattern
tt_pattern_file_add (pat, file);
Register pattern
tt_pattern_register(pat);

Example 3-9 A Static Pattern that Uses the TT_BOTH Scope

Obtain procid
tt_open();
Declare Ptype
Tt_ptype_declare(ptype);
Join file
tt_file_join(file);
Join session
tt_session_join(tt_default_session());

Adding Files to Scoped Patterns

To match TT_SESSION-scoped messages and TT_SESSION-scoped patterns that have the same file attributes, you can add file attributes to TT_SESSION-scoped patterns with the tt_pattern_file_add call, as shown in .


Note - The file attribute values do not affect the scope of the pattern.


Example 3-10 Adding Two File Attributes to a Session-Scoped Pattern

Obtain procid
tt_open();
Create pattern
Tt_pattern pat = tt_create_pattern();
Add scope to pattern
tt_pattern_scope_add(pat, TT_SESSION);
Add session to pattern
tt_pattern_session_add(tt_default_session());
Add first file attribute to pattern
tt_pattern_file_add(pat, file1);
Add second file attribute to pattern
tt_pattern_file_add(pat, file2);
Register pattern
tt_pattern_register(pat);