## Stored Process Metadata Specification:

The ClassifierMap metadata type and other types associated with it are used to represent strored processes. The ClassifierMap is the root object.

For most of the objects shown, only the fields maintained by the SMC Stored Process Manager plugin are described. A creator of metadata may set other attributes or associations. However, these attributes or associations will not be processed by the plug-in.

The ClassifierMap is the "root" object. Associated with it are several other objects. Some of these are considered to be "owned" by the stored process - they belong exclusively to the stored process, are created when the stored process is created and are deleted when the stored process is deleted. Others (e.g. servers) are linked to by the stored process or one of its objects; these objects may be used by other metadata objects and their existence does not end when the stored process is deleted. These objects are marked NO (for Not Owned) in the description that follows.

Property objects require a PropertyType object through the OwningType association. Repositories are seeded with PropertyType objects for commonly used types and a Property object may use these. If they do so, the PropertyType is considered to be Not Owned by the Stored Process. The optimization to use them outside of the Entity-Property model was made for 9.2 and metadata may contain a mix of stored processes with dedicated and shared PropertyType objects. Since the status of the PropertyType objects can be determined by examination, the owned status of PropertyType objects is not discussed in this document.

Key to the tables which follow: The code in column 1 describes whether the name in column 2 is an attribute (R) or association (C).

ClassifierMap:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | TranformRole | "StoredProcess" | Yes
R | Name | Name of the SP | Yes (1)
R | Desc | Description of the SP | No
C | Keywords | Points to Keyword objects. | No (5)
C | ComputeLocations | The Logical Server | Yes (2)(3)(4)
C | SourceCode | The SAS file which describes the SP | Yes
C | Properties | This association is also used to represent the parameters of the stored process using the Entity-Property model. | (6)
C | ClassifierSources | Input stream: discussed later in the section titled Input Streams. | No
C | ClassifierTargets | Results description: discussed later in the section titled Results Definition. | (7)

Notes:
- (1) The name must be unique within the BIP Tree Folder that contains the stored process.
- (2) If there are multiple associations only the first one will be used.
- (3) LogicalServers and associated ServerContexts are created by server definition tools. The LogicalServers must have an associated Server Context.
- (4) LogicalServers are not discussed in this document - a server definition tool (like the SMC) can be used to create one and LogicalServers are not considered to be owned (NO) by the stored process.
- (5) Keywords are not surfaced by the Stored Process Service, but can participate in Information Service searches. The Name and Description fields on a keyword are set by the plug-in.
- (6) The Entity-Property model is not discussed in this document. The Property object at the root of this model is optional if parameters are absent. It must be noted that the stored process metadata model requires all parameter names to be stored in lower-case in the metadata.
- (7) The presence of the association is determined by the result type: see the Results Definition section.

(ClassifierMap->SourceCode) File:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | IsARelativeName | "1" | Yes
R | FileName | The name of the repository instance | Yes
C | Directories | The repository. | Yes (1)(2)

Notes:
- (1) There should be only one association. If there are multiple valid associations only the first one will be used and a diagnostic sent to the logger.
- (2) More than one association (valid or not) will be considered to be malformed metadata by the SMC plugin.

(File -> Directories) Directory:(NO)
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | DirectoryName | The name of the repository | Yes
C | DeployedComponents | ServerContext | Yes (1)(2)
C | Properties | A Property object with the PropertyRole set to "SPSourceCodeRepository". | Yes

Notes:
- (1) LogicalServers and associated ServerContexts are created by server definition tools. The LogicalServers must have an associated Server Context.
- (2) While this association is not used by the Stored Process service, it may be used by stored process definition tools (e.g., SMC).
- (NO)The directory object is not "owned" by the Stored Process.

### Input Streams:

Input streams are associated via the ClassifierSources association. Each Input Stream is defined as follows:

(ClassifierMap->ClassifierSources) Report:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | ReportType | "SPInputStream" | Yes
C | ReportLocation | Points to a Stream object | Yes

(Report ->ReportLocation) Stream:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | Name | Stream name | Yes
C | Properties | A Property object with the PropertyName set to "MultiPass" and value set to non-zero if multipass behavior is desired. If not present, it’s assumed that multipass behavior is not desired. | As needed

### Results Definition:

This discusses the modeling of Stored process results. It is assumed you’re familiar with the Stored Process Service document which describes various result patterns.

(ClassifierMap->ClassifierTargets) Report:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | ReportType | See below | Yes
C | ReportLocation | See below | As needed

The contents of the above depend on the result pattern:

No results delivered by the service: The stored process is considered to have no results returned by the service if either of the following is true:

- No Report object is the target of the ClassifierMap->ClassifierTargets association, or
- A Report object is the target, but the ReportType attribute of the Report object contains a value not explicitly defined in any of the other result types listed below.

Note: for all the other result types a Report object must be present. There may also be mulitple Report objects, but there will be only one with one of the following ReportTypes:

- SPResultsTransientPackage
- SPResultsPermanentFilePackage
- SPResultsPermanentWebdavPackage
- SPResultsPermanentWebdavPRPackage
- SPResultsStream

The plug-in only maintains Report objects with the above recognized ReportType attributes.

Transient Result Package: ReportType is set to "SPResultsTransientPackage"; ReportLocation is not processed.

Permanent Result Package (file backing): ReportType is set to "SPResultsPermanentFilePackage"; ReportLocation can point to a Directory (if a new instance of the result package is to be created) or to an ArchiveFile (if the instance name of the result package is to be specified).

(Report -> ReportLocation) ArchiveFile:
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | IsARelativeName | "1" | Yes
R | FileName | The name of the repository instance | Yes
C | Directories | The repository. | Yes (1)

Notes:
- (1) If there are multiple valid associations only the first one will be used.

(Report -> ReportLocation or ArchiveFile -> Directories) Directory:(NO)
R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | DirectoryName | The name of the repository | Yes
C | DeployedComponents | ServerContext | Yes (1)(2)
C | Properties | A Property object with the PropertyRole set to "SPPackageFileRepository" | Yes

Notes:
- (1) LogicalServers and associated ServerContexts are created by server definition tools. The LogicalServers must have an associated Server Context.
- (2) While this is association is not used by the StoredProcess service, it may be used by stored process definition tools (e.g., SMC).
- (NO) The directory object is not "owned" by the Stored Process.

Permanent Result Package (WebDAV backing): ReportType is set to "SPResultsPermanentWebdavPackage"; ReportLocation points to a Directory. The directory can either be "owned" by the stored process, in which case its parent points to a base-path directory of a DAV Server; or, the directory can be the base-path directory. Note: the base-path directory is part of the DAV server definition and is not owned by the stored process. Unless, a new instance is to be created, ReportLocation must point to a Directory object owned by the stored process. If the directory is owned by the stored process:

R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | DirectoryName | The relative name of the collection instance. | Yes
R | IsRelative | "1" | Yes
C | Parent | The base path directory of the DAV server. | Yes
C | Properties | A Property object with the PropertyName set to "FileSystemType" and value set to "WebDAV". | Yes

Permanent Result Package (Personal Repository backing in the MyResults folder): ReportType is set to "SPResultsPermanentWebdavPRPackage"; ReportLocation optionally points to a Directory(see Note 2). If it does:

R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | DirectoryName | The relative name of the collection instance. | Yes (1)

Notes:
- (1) The collection name is relative to the MyResults folder of the user's Personal Repository.
- (2) The Directory object will not be present if a new instance is to be created at the MyResults level. In all other cases the Directory object must be present.

In the case of WebDAV backing and Personal Repository backing in the MyResults folder a new instance of the results is requested by attaching a Property object to the Report:

R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | PropertyName | "SPNewInstance" | Yes
R | DefaultValue | 0: no new instance; non-zero: new instance | Yes

Streaming Output: : ReportType is set to "SPResultsStream"; ReportLocation points to a Stream:

R/C | Attribute / Association Name | Attribute / Association Value | Required
--- | --- | --- | ---
R | Name | The name of the Stream. | Yes