Declaring Activities Using XML Schema

An XML-Schema document must be provided to describe the interface to each activity. The schema documents for all of the activities supported by an OGSA-DAI service are then combined to form the complete XML-Schema for a perform document. This dynamically generated schema is then used to validate the perform documents received by OGSA-DAI services, before fragments of the perform documents are passed to the constructors of the corresponding activity implementation classes.

In order to construct an activity you must provide an XML Schema describing your activity. If you are going to define your own activities it is best, for the time being, if any activity XML Schema you define also live in the same namespace as those of current OGSA-DAI activities. The XML Schema is used to validate the Element object passed into the constructor of the Java class which provides the implementation of the activity.

In general, the more explicit the XML Schema is about the activity structure the less processing the activity will have to do to ensure the XML describing the activity is syntactically correct and to extract information from the set of XML elements defining the activity. An activity can assume that the Element it is passed will conform to the XML Schema it provides (full XML Schema validation is always done on Perform documents).

There are only two restrictions imposed on the XML Schema for an activity by OGSA-DAI. These are:

  1. The type of the activity must extend the XML ActivityType declared in OGSA-DAI/schema/ogsadai/types/general_types.xsd.xsd.
  2. There must only be one xsd:element defined in the XML Schema and that must specify the type declaration that defines the structure of the activity.

While these are the only two absolute restrictions there are some suggested practices that should be followed unless there is a compelling reason to do otherwise:

The last two points are an attempt to avoid type clashes when constructing the final XML Schema used by a specific OGSA-DAI service to validate Perform documents.