<!--
    File:    TemplateDefinition.dtd
    Purpose: Document type definition for a workflow template definition.

    This file is a part of the WebLogic Process Integrator project,
    from the eCommerce Integration Division of BEA Systems Inc.
    8920 Woodbine Avenue, Suite 400, Markham, Ontario, Canada L3R 9W9.
    http://www.beasys.com

    Copyright (c) 2000 BEA Systems Inc.
    All rights reserved.
-->

<!-- The document element is 'Workflow': -->
<!ELEMENT Workflow (name, effective, expiry?, changedby?, changeddate, notes,
                    idexpression, active, audit-enabled, plugins?, nodes,
                    variables, error-handlers?)>
<!ATTLIST Workflow 
    major-version   CDATA  "1"
    minor-version   CDATA  "0"
    build-number    CDATA  "0"
    timezone        CDATA  #IMPLIED
>

<!ENTITY % node "id, x, y, notes">

<!ENTITY % std-action-types "
    ActionAuditEntry | 
    ActionBusinessOperation |
    ActionCallProgram | 
    ActionCancelEvent | 
    ActionCondition |
    ActionExpression | 
    ActionNoOp |  
    ActionPostXMLEvent |
    ActionPlugin |
    ActionSendEMail | 
    ActionSendXMLToClient |
    ActionTaskAssignRole |  
    ActionTaskAssignRoutingTable |
    ActionTaskAssignUser | 
    ActionTaskDoit | 
    ActionTaskDone |
    ActionTaskDueDate | 
    ActionTaskSetComment |
    ActionTaskSetPriority | 
    ActionTaskUnassign |
    ActionTaskUndo | 
    ActionTimedEvent |   
    ActionWorkflowAbort | 
    ActionWorkflowDone |
    ActionWorkflowSetComment | 
    ActionWorkflowStart |
    ActionXSLTransform
">

<!ENTITY % action-types "%std-action-types; | ActionInvokeErrorHandler | 
                         ActionSetErrorHandler">

<!ENTITY % commit-action-types "%std-action-types; | ActionExitErrorHandler | 
                                ActionSetErrorHandler">

<!ENTITY % rollback-action-types "ActionAuditEntry | ActionBusinessOperation |
                                  ActionCallProgram | ActionCondition |
                                  ActionExitErrorHandler |
                                  ActionExpression | ActionNoOp | ActionPlugin |
                                  ActionPostXMLEvent | ActionSendEMail | ActionSendXMLToClient">

<!-- Ambiguous definition of element 'actions'. -->
<!-- In context 'Task' it is <!ELEMENT actions (created, activated, executed, markeddone)> -->
<!-- In context 'Decision', 'ActionCondition' it is <!ELEMENT actions (false, true)> -->
<!-- In context 'Done', 'Event', 'Start', 'ActionTaskDueDate', 'ActionTimedEvent', 'ActionWorkflowStart'
     it is <!ELEMENT actions (%action-types;)*> -->
<!ELEMENT actions ((created, activated, executed, markeddone)
                 | (false, true)
                 | (%action-types;)*)>
<!ELEMENT ActionAuditEntry (notes, audittext)>
<!ELEMENT ActionBusinessOperation (notes, descriptorid, description, result, result-type, instance-variable, 
                            instance-variable-type, parms, iviewx?, iviewy?)>
<!ELEMENT ActionCallProgram (notes, program, arguments)>
<!ELEMENT ActionCancelEvent (notes, target)>
<!ELEMENT ActionCondition (notes, condition, actions)>

<!ELEMENT ActionExitErrorHandler (notes)>
<!ATTLIST ActionExitErrorHandler exit-type (rollback|stop|retry|continue) "rollback">

<!ELEMENT ActionExpression (notes, variable, (expression | xml))>

<!ELEMENT ActionInvokeErrorHandler (notes, xml?)>
<!ATTLIST ActionInvokeErrorHandler error-handler-name CDATA #REQUIRED>

<!ELEMENT ActionNoOp (notes, description)>
<!ELEMENT ActionPlugin (id, notes, plugin-data, actions*)>
<!-- description is displayed in action lists if the plugin is unavailable. -->
<!ATTLIST ActionPlugin label CDATA #REQUIRED>
<!ELEMENT ActionPostXMLEvent (notes, (topic | queue), transaction, addressees?,
                              message-properties?, delivery-mode,
                              priority, time-to-live, orderkey?,
                              (variable | xml),
                              iviewx?, iviewy?)>
<!ELEMENT ActionSendEMail (notes, subject, message, charset?, to, cc, bcc)>
<!ELEMENT ActionSendXMLToClient (id, notes, xml, variables, iviewx?, iviewy?)>

<!ELEMENT ActionSetErrorHandler (notes)>
<!ATTLIST ActionSetErrorHandler error-handler-name CDATA #REQUIRED>

<!ELEMENT ActionTaskAssignRole (notes, target, role, expression)>
<!ELEMENT ActionTaskAssignRoutingTable (notes, target, routeconditions)>
<!ELEMENT ActionTaskAssignUser (notes, target, user, expression, role)>
<!ELEMENT ActionTaskDoit (notes, target)>
<!ELEMENT ActionTaskDone (notes, target)>
<!ELEMENT ActionTaskDueDate (id, notes, target, expression, calendartype,
                             calendarname, actions)>
<!ELEMENT ActionTaskSetComment (notes, target, comment)>
<!ELEMENT ActionTaskSetPriority (notes, target, priority)>
<!ELEMENT ActionTaskUnassign (notes, target)>
<!ELEMENT ActionTaskUndo (notes, target)>
<!ELEMENT ActionTimedEvent (id, notes, expression, calendartype, executionunits,
                            scheduleunits, executiontime, scheduletime, recoverable?,
                            stopwhentaskdone, usetimeexpression, actions)>
<!ELEMENT ActionWorkflowAbort (notes)>
<!ELEMENT ActionWorkflowDone (notes)> 
<!ELEMENT ActionWorkflowSetComment (notes, comment)>
<!ELEMENT ActionWorkflowStart (id, notes, templateid, template-name, refvariable,
                               orgexpression, parameters, results, actions,
                               iviewx?, iviewy?)>
<!ELEMENT ActionXSLTransform (notes, input-expression, transform-document, transform-source,
                                output-variable, xsl-parameters?)>
<!ELEMENT xsl-parameters (xsl-parameter+)>
<!ELEMENT xsl-parameter (name, expression)>
<!ELEMENT activated ((%action-types;)*)>
<!ELEMENT addressee (name, expression, type)>
<!ELEMENT addressees (instanceid)>
<!ELEMENT bcc (addressee*)>
<!ELEMENT cc (addressee*)>
<!ELEMENT commit-actions ((%commit-action-types;)*)>
<!ELEMENT created ((%action-types;)*)>
<!ELEMENT Decision (%node;, condition, truenexts, falsenexts, actions)>
<!ELEMENT Done (%node;, actions, plugin-data?)>
<!ELEMENT Event (%node;, ((root, description, key, condition) | (plugin-data)), actions, variables,
                                iviewx?, iviewy?)>
<!ELEMENT error-handlers (error-handler*)>
<!ELEMENT error-handler (notes, variables, commit-actions, rollback-actions)>

<!-- No more than one error-handler can have initial set to true -->
<!ATTLIST error-handler 
    name    CDATA        #REQUIRED
    initial (true|false) "false"
>

<!ELEMENT executed ((%action-types;)*)>
<!ELEMENT false ((%action-types;)*)>
<!ELEMENT falsenexts (next*)>
<!ELEMENT Join (%node;, and)>
<!ELEMENT markeddone ((%action-types;)*)>
<!ELEMENT message-properties (property+)>
<!ELEMENT nexts (next*)>
<!ELEMENT nodes (Decision | Done | Event | Join | Start | Task)*>
<!ELEMENT parameters (parm*)>
<!-- Ambiguous definition of element 'parm' -->
<!-- In context 'ActionBusinessOperation' it is <!ELEMENT parm (#PCDATA)> -->
<!-- In context 'ActionWorkflowStart' it is <!ELEMENT parm (name, value)> -->
<!-- N.B. Content model shows repeatable elements purely to conform with DTD syntax. -->
<!-- <parm> elements only appear in the two forms exemplified above. -->
<!--ELEMENT parm ((#PCDATA | (name, value))*)-->
<!ELEMENT parm ((#PCDATA | name | value)*)>
<!ELEMENT parms (parm*)>
<!-- The 'plugins' element appears if the template definition uses plugin functionality 
	 or any plugin defines its own template definition property. -->
<!-- The Studio is responsible for updating this element when saving the definition. -->
<!ELEMENT plugins (plugin*)>
<!-- One 'plugin' element appears for each plugin referenced by a template definition 
	 and each plugin which defines its own template definition property. -->
<!ELEMENT plugin (plugin-data?)>
<!-- name is the plugin name, referenced means whether this template definition uses 
	 this plugin-specific functionality, version is the plugin version number. -->
<!ATTLIST plugin
    name CDATA #REQUIRED
    referenced (true|false) #REQUIRED
    major-version CDATA #REQUIRED
    minor-version CDATA #REQUIRED
    vendor CDATA #REQUIRED
    url CDATA ""
>
<!ELEMENT property (name, value)>
<!-- Ambiguous definition of element 'result'. -->
<!-- In context 'ActionBusinessOperation' it is <!ELEMENT result (#PCDATA)> -->
<!-- In context 'ActionWorkflowStart' it is <!ELEMENT result (name, value)> -->
<!--ELEMENT result ((#PCDATA | (name, value))*)-->
<!ELEMENT result ((#PCDATA | name | value)*)>
<!ELEMENT results (result*)>
<!ELEMENT rollback-actions ((%rollback-action-types;)*)>
<!ELEMENT routecondition (to, type, condition)>
<!ELEMENT routeconditions (routecondition*)>
<!ELEMENT Start (%node;, description, (manual
                                     | called
                                     | (timed, dateexpression, reschedamount, reschedunits, 
                                             recoverable?, calendarname, startorg)
                                     | (event, root, key, condition, startorg)
                                     | (plugin-data, startorg)),
                 nexts, actions, variables, iviewx?, iviewy?)>
<!ELEMENT plugin-data ANY>
<!-- name is the plugin name,
     id is the plugin-provided unique ID for the xxxInfo object. -->
<!ATTLIST plugin-data
    name CDATA #REQUIRED
    id CDATA #REQUIRED
>
<!ELEMENT Task (%node;, name, priority, donewithoutdoit, doitifdone,
                unmarkdone, modifiable, reassignment, nexts, actions)>              
<!ELEMENT to (addressee*)>
<!ELEMENT true ((%action-types;)*)>
<!ELEMENT truenexts (next*)>
<!-- Ambiguous definition of element 'variable' -->
<!-- In context 'Workflow' it is
     <!ELEMENT variable (name, notes, (type|plugin-data), xmltype, inmandatory, in, out)> -->
<!-- In context 'Start', 'ActionSendXMLToClient' it is
     <!ELEMENT variable (name, expression)> -->
<!-- In context 'ActionExpression' it is
     <!ELEMENT variable (#PCDATA)> -->
<!-- N.B. Content model shows repeatable elements purely to conform to DTD syntax. -->
<!-- <variable> elements only appear in the three forms exemplified above. -->
<!--ELEMENT variable (((name, notes, (type|plugin-data), xmltype, inmandatory, in, out)
                  |  (name, expression)
                  |  (#PCDATA))*)-->
<!ELEMENT variable ((name | notes | type | plugin-data | xmltype | inmandatory
                     | in | out | name | expression | #PCDATA)*)>
<!--ELEMENT variable (#PCDATA)-->
<!ELEMENT variables (variable*)>

<!ELEMENT active (#PCDATA)>
<!ELEMENT and (#PCDATA)>
<!ELEMENT arguments (#PCDATA)>
<!ELEMENT audit-enabled (#PCDATA)>
<!ELEMENT audittext (#PCDATA)>
<!ELEMENT calendarname (#PCDATA)>
<!ELEMENT calendartype (#PCDATA)>
<!ELEMENT called (#PCDATA)>
<!ELEMENT changedby (#PCDATA)>
<!ELEMENT changeddate (#PCDATA)>
<!ELEMENT comment (#PCDATA)>
<!ELEMENT condition (#PCDATA)>
<!ELEMENT correlationid (#PCDATA)>
<!ELEMENT dateexpression (#PCDATA)>
<!ELEMENT delivery-mode (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT descriptorid (#PCDATA)>
<!ELEMENT doitifdone (#PCDATA)>
<!ELEMENT donewithoutdoit (#PCDATA)>
<!ELEMENT effective (#PCDATA)>
<!ELEMENT expiry (#PCDATA)>
<!ELEMENT event (#PCDATA)>
<!ELEMENT executionunits (#PCDATA)>
<!ELEMENT executiontime (#PCDATA)>
<!ELEMENT expression (#PCDATA)>
<!ELEMENT id (#PCDATA)>
<!ELEMENT idexpression (#PCDATA)>
<!ELEMENT in (#PCDATA)>
<!ELEMENT inmandatory (#PCDATA)>
<!ELEMENT input-expression (#PCDATA)>
<!ELEMENT instanceid (#PCDATA)>
<!ELEMENT instance-variable (#PCDATA)>
<!ELEMENT instance-variable-type (#PCDATA)>
<!ELEMENT iviewx (#PCDATA)>
<!ELEMENT iviewy (#PCDATA)>
<!ELEMENT jmstype (#PCDATA)>
<!ELEMENT key (#PCDATA)>
<!ELEMENT manual (#PCDATA)>
<!ELEMENT message (#PCDATA)>
<!ELEMENT charset (#PCDATA)>
<!ELEMENT modifiable (#PCDATA)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT next (#PCDATA)>
<!ELEMENT notes (#PCDATA)>
<!ELEMENT orderkey (#PCDATA)>
<!ELEMENT orgexpression (#PCDATA)>
<!ELEMENT out (#PCDATA)>
<!ELEMENT output-variable (#PCDATA)>
<!ELEMENT priority (#PCDATA)>
<!ELEMENT program (#PCDATA)>
<!ELEMENT queue (#PCDATA)>
<!ATTLIST queue expression (true | false) #REQUIRED>
<!ELEMENT reassignment (#PCDATA)>
<!ELEMENT refvariable (#PCDATA)>
<!ELEMENT replyto (#PCDATA)>
<!ELEMENT reschedamount (#PCDATA)>
<!ELEMENT reschedunits (#PCDATA)>
<!ELEMENT result-type (#PCDATA)>
<!ELEMENT role (#PCDATA)>
<!ELEMENT root (#PCDATA)>
<!ELEMENT scheduletime (#PCDATA)>
<!ELEMENT scheduleunits (#PCDATA)>
<!-- The 'recoverable' element has the value 'true' or 'false', that indicates
     whether or not to recover any timed events lost during a server outage. -->
<!ELEMENT recoverable (#PCDATA)>
<!ELEMENT startorg (#PCDATA)>
<!ATTLIST startorg expression (true | false) #REQUIRED>
<!ELEMENT stopwhentaskdone (#PCDATA)>
<!ELEMENT subject (#PCDATA)>
<!ELEMENT target (#PCDATA)>
<!ELEMENT templateid (#PCDATA)>
<!ELEMENT template-name (#PCDATA)>
<!ELEMENT timed (#PCDATA)>
<!ELEMENT time-to-live (#PCDATA)>
<!ELEMENT topic (#PCDATA)>
<!ATTLIST topic expression (true | false) #REQUIRED>
<!ELEMENT type (#PCDATA)>
<!-- The 'transaction' element has the value 'true' or 'false'. -->
<!ELEMENT transaction (#PCDATA)>
<!ELEMENT transform-document (#PCDATA)>
<!ELEMENT transform-source (#PCDATA)>
<!ELEMENT unmarkdone (#PCDATA)>
<!ELEMENT user (#PCDATA)>
<!ELEMENT usetimeexpression (#PCDATA)>
<!ELEMENT value (#PCDATA)>
<!ELEMENT x (#PCDATA)>
<!ELEMENT xml ANY>
<!ATTLIST xml
    publicid CDATA #IMPLIED
    systemid CDATA #IMPLIED
    escape-node-values (true|false) "true"
 >
<!ELEMENT xmltype (#PCDATA)>
<!ELEMENT y (#PCDATA)>
