Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6828021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:20:03+00:00 2026-05-26T22:20:03+00:00

I have an XML like this (a workflow represents a sort of a class

  • 0

I have an XML like this (a workflow represents a sort of a class that is instantiated by a process).

<workflowManagementSystem>
    <workflows>
        <workflow name="workflow1">
            <actions>
                <action name="action1" role="role1"></action>
                <action name="action2" role="role3"></action>
                <action name="action3" role="role4"></action>
            </actions>
        </workflow>
        <workflow name="workflow2">
            <actions>
                <action name="action3" role="role4"></action>
                <action name="action2" role="role3"></action>
                <action name="action4" role="role4"></action>
            </actions>
        </workflow>
    </workflows>
    <actors>
        <actor name="actor1" role="role1"></actor>
        <actor name="actor2" role="role2"></actor>
        <actor name="actor3" role="role3"></actor>
        <actor name="actor4" role="role4"></actor>
        <actor name="actor5" role="role2"></actor>
    </actors>
    <processes>
        <process workflow="workflow1">
            <actionStatuses>
                <actionStatus action="action1" actor="actor1"></actionStatus>
                <actionStatus action="action2" actor="actor3"></actionStatus>
            </actionStatuses>
        </process>
        <process workflow="workflow1">
            <actionStatuses>
                <actionStatus action="action1" actor="actor1"></actionStatus>
                <actionStatus action="action2" actor="actor5"></actionStatus>
                <actionStatus action="action3" actor="actor4"></actionStatus>
            </actionStatuses>
        </process>
        <process workflow="workflow1">
            <actionStatuses>
                <actionStatus action="action2" actor="actor5"></actionStatus>
                <actionStatus action="action4" actor="actor4"></actionStatus>
            </actionStatuses>
        </process>
    </processes>
</workflowManagementSystem>

I’d like to declare some constraints like:

1) The name of the workflow has to be unique.
2) The name of the action has to be unique within the scope of the workflow containing it.
3) An action can be repeated within the process (more actionStatus referring to the same action).
4) An actionStatus should refer only to the action belonging to the particular workflow instantiated by the father process.
5) The actor indicated in actionStatus must belong to the same role as specified in the action to which it refers.

Is it possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T22:20:04+00:00Added an answer on May 26, 2026 at 10:20 pm

    Some or your requirements can, others cannot be done using XML Schema.

    One note before going into details, I’ve also added an additional key/keyref (referential integrity), that you did not ask for, but I thought it might be good for future references. The uniqueWorkflowInWorkflows is what you’ve asked for; the pkWorkflow/fkProcessToWorkflow I’ve added. There are subtle differences between unique and key clauses, but if you accept the key/keyref, you don’t need uniqueWorkflowInWorkflows.

    It is worth mentioning here that in general, if your design allows for an xsd:unique clause, but not an xsd:key; an xsd:keyref can reference an xsd:unique…

    The answers are:

    1) See uniqueWorkflowInWorkflows or pkWorkflow

    2) See uniqueActionInWorkflow

    3) Nothing to do here.

    4) Cannot be done in XML Schema (intuitively I would say due to limitations in the supported XPath syntax for the selectors).

    5) Cannot be done in XML Schema.

    Below is an XML Schema generated from your XML, following a Russian Doll authoring style, that is the only “global” declaration is that of the root element.

    <?xml version="1.0" encoding="utf-8"?>
    <!--W3C Schema generated by QTAssistant/W3C Schema Refactoring Module (http://www.paschidev.com)-->
    <xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
        <xsd:element name="workflowManagementSystem">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element name="workflows">
                        <xsd:complexType>
                            <xsd:sequence>
                                <xsd:element maxOccurs="unbounded" name="workflow">
                                    <xsd:complexType>
                                            <xsd:sequence>
                                                <xsd:element name="actions">
                                                    <xsd:complexType>
                                                        <xsd:sequence>
                                                    <xsd:element maxOccurs="unbounded" name="action">
                                                        <xsd:complexType>
                                                            <xsd:attribute name="name" type="xsd:string" use="required"/>
                                                            <xsd:attribute name="role" type="xsd:string" use="required"/>
                                                        </xsd:complexType>
                                                    </xsd:element>
                                                </xsd:sequence>
                                            </xsd:complexType>
                                        </xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="name" type="xsd:string" use="required"/>
                                </xsd:complexType>
                                <xsd:unique name="uniqueActionInWorkflow">
                                    <xsd:selector xpath="actions/action"/>
                                    <xsd:field xpath="@name"/>
                                </xsd:unique>
                            </xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                    <xsd:unique name="uniqueWorkflowInWorkflows">
                        <xsd:selector xpath="workflow"/>
                        <xsd:field xpath="@name"/>
                    </xsd:unique>
                </xsd:element>
                <xsd:element name="actors">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element maxOccurs="unbounded" name="actor">
                                <xsd:complexType>
                                    <xsd:attribute name="name" type="xsd:string" use="required"/>
                                    <xsd:attribute name="role" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
                <xsd:element name="processes">
                    <xsd:complexType>
                        <xsd:sequence>
                            <xsd:element maxOccurs="unbounded" name="process">
                                <xsd:complexType>
                                    <xsd:sequence>
                                        <xsd:element name="actionStatuses">
                                            <xsd:complexType>
                                                <xsd:sequence>
                                                    <xsd:element maxOccurs="unbounded" name="actionStatus">
                                                        <xsd:complexType>
                                                            <xsd:attribute name="action" type="xsd:string" use="required"/>
                                                            <xsd:attribute name="actor" type="xsd:string" use="required"/>
                                                        </xsd:complexType>
                                                    </xsd:element>
                                                </xsd:sequence>
                                            </xsd:complexType>
                                        </xsd:element>
                                    </xsd:sequence>
                                    <xsd:attribute name="workflow" type="xsd:string" use="required"/>
                                </xsd:complexType>
                            </xsd:element>
                        </xsd:sequence>
                    </xsd:complexType>
                </xsd:element>
            </xsd:sequence>
        </xsd:complexType>
        <xsd:key name="pkWorkflow">
            <xsd:selector xpath="workflows/workflow"/>
            <xsd:field xpath="@name"/>
        </xsd:key>      
        <xsd:keyref name="fkProcessToWorkflow" refer="pkWorkflow">
            <xsd:selector xpath="processes/process"/>
            <xsd:field xpath="@workflow"/>
        </xsd:keyref>
    </xsd:element>
    

    This is a visualization of the XSD source:

    XSD Visualization

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have XML that looks like this: <Parameter Name=parameter name Value=parameter value /> which
I have xml like this: <configurationData> <path name='b'> <path name='a'> <setting name='s1'> ![CDATA[XXXX]] </setting>
Let's suppose I have xml like this one: <Server Active=No> <Url>http://some.url</Url> </Server> C# class
I have xml structure like this: <Group id=2 name=Third parentid=0 /> <Group id=6 name=Five
I have some xml like this: <Data> <Rows> <Row> <Field Name=title>Mr</Field> <Field Name=surname>Doe</Field> <Row>
I have XML that looks like this: <ROW ref=0005631 type=04 line=1 value=Australia/> <ROW ref=0005631
I have XML like this: <assessment name=Assessment> <section name=Section1> <item name=Item1-1/> <item name=Item1-2/> <item
I have XML like this: <exam> <section name=SampleSection1> <attributes> <variable_name data_type=String value=SCORE/> </attributes> <item
Suppose I have xml like this: <Products> <Product name=Liquid Oxygen> <Manufacturer name=Universal Exports country=UK
I have a XML like this: <group name=A> <element>1</element> <groups> <group name=B> <element>2</element> <element>3</element>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.