Hello,

I want to use my own ComplexType with YDocumentType defined in Data Definitions with XSD.

But I've got a problem when I trying to define new data type.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
<xs:element name="Doc1" type="YDocumentType"/>
</xs:schema>

Error: 2:48: src-resolve: Cannot resolve the name 'YDocumentType' to a(n) 'type definition' component.

I found this topic: http://www.yaug.org/content/ydocumenttype-defining-complex-data-type

When I try this:

<xs:complexType name="YDocumentType">
<xs:sequence>
<xs:element name="id" type="xs:long" minOccurs="0"/>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="Doc1" type="YDocumentType"/>

I've got: Error 2:22: [YDocumentType] is a reserved type name.

Then I try go this way:

<xs:include schemaLocation="http://www.yawlfoundation.org/yawlschema"/&gt;

YAWL Editor dies with this descriptions.

If I try something like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
<xs:element xmlns:yawl="http://www.yawlfoundation.org/yawlschema&quot; name="Doc1" yawl:type="YDocumentType"/>
</xs:schema>

I've got Tomcat Error: Failed to build dynamic form.

Next, I try this:

<xs:complexType name="doc_sum">
<xs:sequence>
<xs:element xmlns:yawl="http://www.yawlfoundation.org/yawlschema&quot; name="Doc1" yawl:type="YDocumentType"/>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>

See the error by link below:
http://pastebin.com/3RUXVGDv

What I'm doing wrong? Please, help me. It's very important for me to understand use YDocumentType in ComplexType.

You are right: there are limitations in XSD in YAWL. AFAIK you cannot import other XSD.

Would it help to define a type similar to YDocumentType but with a different name?

<xs:complexType name="myYDocumentType">
<xs:sequence>
  <xs:element name="id" type="xs:long" minOccurs="0"/>
  <xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
 

Thank you for your answer.

I tried to do that. YAWL Engine operate with YDocumentType and engine doesn't know how to work with this type because eninge detects this complex type as "not reserved".

But my question is HOW TO ADD YDocumentType in my complex type. Maybe we can do that xsd instead.

I'll be really appreciate if you can help me to solve this problem.

This is the answer from Michael Adams: YDocumentType is a YAWL internal type specifically designed and used to support document passing and storage within a YAWL workflow instance. As such, it cannot be redeclared, extended, restricted or used as a type for a member element of a user-defined complex type.YDocumentType cannot be used in user-defined types