Service Comments Viewer

Comments Guide

Introduction

When developing services for the webMethods platform, these have in their structure fields that are comments:

These comments are the first line of documentation of the service implementation and on what the service is intended for, how to use it, what kind of parameters are accepted and what kind of output to expect. Filling and maintaining this information is the job of the developer and should never be neglected. If this is information is rich and accurate enough it can effectively be used to generate de User Guide for using the service.

The objective of this document if to provide the developer with guidelines on what information can (and should) be placed in the aforementioned service comment fields and, with even more significance, how to format that information in ways that:

For the purpose of the documentation intended to be produced from the service's comments, those on the service steps and source code will not be considered.

This page contains information about the current release of the Service Profiler.

Comments Composition and Processing

Comments are expected to be composed of text formatted as markdown, DocLet-like tags and xHTML constructs.

The order of processing the comments into xHTML is:

Markdown

Common Pitfalls when using Markdown

When using markdown, there are some common mistakes or user assumptions that result in an unexpected result.

In this section are listed the most common cases and how to overcome them:

DocLet-like tags

These tags are the first ones to be processed and are translated to xHTML constructs.

The tags usage is restricted to a single comments context:

Table 1 - DocLet-like tag explanation and context usage
Tag Context Description
@author <author name> Service

The author name is any text following the @author tag up until the end of the line.

There may be more than one author. When that is the case, place one @author tag per author, each in its own text line.

@since <version> Service

The version of the package when this service was first introduced.

There can be only one of these tags per comment.

@category <category> Service

The category name is any text following the @category tag up until the end of the line.

There may be more than one category. When that is the case, place one @category tag per category, each in its one text line.

The categorization of a service serves the purpose of giving further but condensed information about the service, and grouping services by their category, such as:

  • Security;
  • Technical Utility;
  • General Utility;
  • Transformation;
  • Validation;
  • Normalization;
  • User Interface;
  • etc.
@deprecated <text> Service

Indicates that the service is deemed deprecated, and is not to be used anymore.

The deprecation tag is accompanied by a paragraph of text giving reason for the deprecation and directions to what to use in its place.

There can be only one of these tags per comment.

@conditional Argument

Does not produce any HTML construct, and has no arguments.

This tag indicates that the argument importance is Conditional, meaning that it is either Mandatory or Optional depending on a condition over another argument value. The explanation of the condition(s) has to be done as part of the argument comment text.

An example of comment text:

   @conditional
   This field is only mandatory if `recordType` is "`D`",
   and the value has to be a signed integer if the `valueSign` argument is `null`.

The tag has to appear in a line by itself, but it can be any line, not necessarily the first one.

Extended DocLet-like tags

The tags presented in the above section are the set of core tags anticipated for the comments processor. However, the processor also accepts the configuration of additional tags that extend the core set. The default distribution of this tool already defines a set of extended tags anticipated are shown the table below.

The extended DocLet-like tags are similar in structure and usage to the core DocLet-like tags, but have specific rules:

Table 2 - Out-of-the-box Extended DocLet-like tag explanation and context usage
Tag Context Default Value Description
@project <project name> Service none

The project name is any text following the @project tag up until the end of the line.

It is intended to identify the project that spawned the creation of the service.

There can be only one of these tags per comment.

@security <classification> Service none

The security classification is any text following the @security tag up until the end of the line.

There can be only one of these tags per comment.

Configuring or adding an Extended DocLet-like tag

Extended DocLet-like tag are configured in the file $IS_DIR/packages.var/WiaServiceCommentsViewer/config/custom_tags.cnf.

After editing the properties file, reload the WiaServiceCommentsViewer package so that the changes are recognized.

A complete example of a new custom tag (tag names are case-sensitive and cannot contain whitespaces):

               com.wrightia.svccmmtsvuer.customtag.mytag.caption=My Tag
               com.wrightia.svccmmtsvuer.customtag.mytag.cssClassName=mytag
               com.wrightia.svccmmtsvuer.customtag.mytag.defaultValue=Any Value
               com.wrightia.svccmmtsvuer.customtag.mytag.isMultipleInstance=false
               com.wrightia.svccmmtsvuer.customtag.mytag.name=mytag
            

To complete the setting and enabled it, you have to manually append it to the com.wrightia.svccmmtsvuer.customtags property, like this:

               com.wrightia.svccmmtsvuer.customtags=project\=Y;security\=Y;mytag\=Y
            

Special Developer Comments

In any of the service or arguments comment fields, there may be information that is specifically oriented for the developers. This information can be of any nature but normally it is either for internal maintenance guidance or a changes history log.

This kind of information is not suited to show in a document that is intended for the service consumer. There must be a way of suppressing this information from the final document without forcing its removal from the service comments and even from the development cycle.

Because the final document is a rendering of an xHTML document, the xHTML/CSS rules can be used to control its behaviour. So, the suggested solution is to encapsulate this special information in an HTML DIV using the CSS class developerNote. For example:

            <div class="developerNote">
            -----------------------------------------------------------------------------------------
            Modification History

            AUTHOR                    DATE             DESCRIPTION
            ------------------------  -------------    ----------------------------------------------
            Robert A. Smith           29-JAN-2004      Correct validation of mandatory arguments.
            -----------------------------------------------------------------------------------------
            </div>
         

Normally, these comments are discarded from the documentation generated for the final user. However, in some situations these notes may be intended to be part of the document, but restricted to the next developer and not the service's end user.

By default, this construct is referenced in the CSS with instructions to hide it.

When shown, in the default CSS distributed with the tool, the way the developer note is rendered is dependent of the HTML construct used:

Special Comment Processing

There are special cases of comments of services or arguments that are specially processed. Those special cases, and how they are processed into the final documentation, are described here.

The _env field of Publishabe Documents

The _env field of Publishable Documents is a special document added by the webMethods platform for its own internal usage when publishing documents through the Broker. This structure is very extensive and potentially intrusive in the kind of documentation that is intended to be generated.

Services that define input/output arguments that are a reference to a Publishable Documents will have the comments of that document expanded as part of the service documentation. As a consequence, the _env structure is also referenced.

To avoid documenting a structure that does not relate directly with the service usage, the comment to a field named _env is assumed as:

         @conditional
         A field used and set by the system when the document is published.