<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Bryan Thompson (self) -->
<!-- This DRAFT DTD provides an XML language for interchanging
     activity instance representations between interchanging activity
     state between an actor (user agent that is the delegate of an
     atomic activity) and the workflow controller.

     
     The official URI for the current version of this document is:
     
     http://www.cognitiveweb.org/xml/REST_WFC.dtd

     An annotation version of this document may be found at:
     
     http://wiki.cognitiveweb.org/CognitiveWeb/AnnotatedWorkflowControllerDtd

     
     Copyright (c) 2002-2003 by Bryan Thompson, All rights reserved.
     
-->
<!-- Used to provide type information for the value in an 'lvar' or 'param' element. @problem: move to workflow specification DTD-->
<!ENTITY % entityType "( int | boolean | string | resource )">
<!-- A boolean attribute value. -->
<!ENTITY % boolean "( true | false )">
<!-- There are several kinds of events: named external events, named internal events, condition change events, termination events, and temporal events (cf. Section 2.4). These event types are mutually exclusive: an event has only one type. We partition set Events in six subsets: NamedExternalEvents, NamedInternalEvents, ConditionChangeEvents, TerminationEvents, WhenEvents and AfterEvents. Sets WhenEvents and AfterEvents together comprise the set of temporal events. Note that an event in WhenEvents is a temporal event, not a condition change event. -->
<!ENTITY % eventType "( NamedExternalEvent | NamedInternalEvent | ConditionChangeEvent | TerminateEvent | WhenEvent | AfterEvent )">
<!-- The 'resourceGraph' element is used for interchanging the representations of hyperlinked resources within a single XML instance document.  -->
<!ELEMENT resourceGraph (identityRef*, resourceRef*)>
<!ATTLIST resourceGraph
	xmlns CDATA #FIXED "http://www.cognitiveweb.org/xml/REST_WFC.dtd"
	xml:base CDATA #IMPLIED
>
<!-- The 'activity' expresses the current state of a running workflow instance. -->
<!ELEMENT activity (identityRef*, modelRef?, actorRef?, parent?, (activityRef | lvar)*)>
<!ATTLIST activity
	id ID #IMPLIED
	xmlns CDATA #FIXED "http://www.cognitiveweb.org/xml/REST_WFC.dtd"
	xml:base CDATA #IMPLIED
>
<!-- This element represents a typed instantenous event with zero or more named arguments, e.g., e1(args).  Event representations are POSTed to activity instances.  -->
<!ELEMENT event (param*)>
<!ATTLIST event
	id ID #IMPLIED
	type %eventType; #REQUIRED
	name CDATA #REQUIRED
	xmlns CDATA #FIXED "http://www.cognitiveweb.org/xml/REST_WFC.dtd"
	xml:base CDATA #IMPLIED
>
<!-- The identityRef element expresses a URI for the resource represented by the parent element in the XML document.  -->
<!ELEMENT identityRef EMPTY>
<!ATTLIST identityRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- An xlink element that expresses an untyped xlink.  -->
<!ELEMENT resourceRef EMPTY>
<!ATTLIST resourceRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- An xlink element that expresses an xlink to a <resourceGraph>, i.e., to the root of a web service.  -->
<!ELEMENT resourceGraphRef EMPTY>
<!ATTLIST resourceGraphRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- A kind of xlink element that always identifies a resource that provides an actor for workflow instance. -->
<!ELEMENT actorRef EMPTY>
<!ATTLIST actorRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- A kind of xlink element that always identifies the resource that
     provides the workflow specification for a workflow instance. -->
<!ELEMENT modelRef EMPTY>
<!ATTLIST modelRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- A kind of xlink element that always identifies the governing workflow specification for a workflow activity resource. -->
<!ELEMENT activityRef EMPTY>
<!ATTLIST activityRef
	xmlns:xlink CDATA #FIXED "http://www.w3.org/1999/xlink"
	xlink:type NMTOKEN #FIXED "simple"
	xlink:href CDATA #REQUIRED
>
<!-- This element contains the reference to the parent activity or to the root container of the web service iff there is no parent activity.  This element is not used when POSTing the representation of a new activity and is automatically filled in by the web service when the activity is created.  -->
<!ELEMENT parent (activityRef | resourceGraphRef)>
<!--<!ATTLIST parent>-->
<!--The 'lvar' expresses the bound value of a local variable for a workflow activity.  An unbound value may be indicated using the 'null' attribute.  The datatype constraint is provided by the governing workflow specification.  Local variables can be simple data types, including boolean, number, and string or a business object data type.  A business object maintains named business states, e.g., Order.pending, that codify milestones in a conversation in which business documents being exchanged.  The definition of business objects is provided by the workflow specification.  Within the workflow controller, a business object is simply a URI for a rest web service.  The workflow controller uses XPath expressions provided by the governing workflow specification are used to extract named states for the XML representation returned by a GET on that URI.  The workflow actors are responsible for creating (via POST), modifying (via PUT), and destroying (via DELETE) business objects.  Business objects are often used together with rest web services that provide queuing services for the business object resources.  Actors are responsible for maniulating these queues, normally using a optimistic locking policy in which a resource is read and then deleted from the queue, leaving the responsibility for processing the business object with the actor.  The workflow controller enforces pre- and post-conditions for activities, in part based on the observable state of these business objects. The distinction between a business object and a business document is that business document are interchanged during the conversation while the business object represents the ratified agreement concerning the state of that conversation.  A business object may be a gateway to non-rest persistent business objects, but that is an integration issue and outside of the architectural concern of the workflow controller.-->
<!ELEMENT lvar (#PCDATA)>
<!ATTLIST lvar
	name NMTOKEN #REQUIRED
	null %boolean; "false"
>
<!-- The 'param' expresses a bound parameter value for an 'event'.  An unbound value may be indicated using the 'null' attribute.  The datatype constraint  is provided by the governing workflow specification, except for pre-defined workflow events, which are declared in the workflow controller specification.-->
<!ELEMENT param (#PCDATA)>
<!ATTLIST param
	name NMTOKEN #REQUIRED
	null %boolean; "false"
>
