<?xml version="1.0" encoding="utf-8"?>
<workflow xmlns="http://eprints.org/ep2/workflow" xmlns:ep="http://eprints.org/ep2/">

  <flow>
    <stage ref="core"/>
    <stage ref="pubinfo"/>
    <ep:ifmatch name="type" value="conference_item">
      <stage ref="event"/>
      <stage ref="status"/>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="thesis book_section other book article monograph">
      <stage ref="status"/>
    </ep:ifmatch>
    <stage ref="abstract"/>
    <stage ref="subjects"/>
    <stage ref="notes"/>
  </flow>

  <stage name="core">
    <component><field ref="title"><required/></field></component>
    <ep:ifmatch name="type" value="monograph">
      <component><field ref="monograph_type"><required/></field></component>
      <component><field ref="creators"><required/></field></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="thesis">
      <component><field ref="thesis_type"><required/></field></component>
      <component><field ref="creators"><required/></field></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="other article patent">
      <component><field ref="creators"><required/></field></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="book">
      <component><field ref="creators"/></component>
      <component><field ref="editors"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="conference_item">
      <component><field ref="pres_type"><required/></field></component>
      <component><field ref="creators"><required/></field></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="book_section">
      <component><field ref="creators"><required/></field></component>
      <component><field ref="editors"/></component>
    </ep:ifmatch>
  </stage>

  <stage name="pubinfo">
    <ep:ifmatch name="type" value="patent">
      <component><field ref="date_issue"><required/></field></component>
      <component><field ref="official_url"/></component>
      <component><field ref="patent_applicant"><required/></field></component>
      <component><field ref="id_number"><required/></field></component>
      <component><field ref="pages"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="monograph">
      <component><field ref="institution"/></component>
      <component><field ref="department"/></component>
      <component><field ref="place_of_pub"/></component>
      <component><field ref="publisher"><required/></field></component>
      <component><field ref="id_number"/></component>
      <component><field ref="pages"/></component>
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="official_url"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="book">
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="place_of_pub"/></component>
      <component><field ref="publisher"><required/></field></component>
      <component><field ref="pages"/></component>
      <component><field ref="series"/></component>
      <component><field ref="volume"/></component>
      <component><field ref="number"/></component>
      <component><field ref="isbn"/></component>
      <component><field ref="official_url"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="other">
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="official_url"/></component>
      <component><field ref="place_of_pub"/></component>
      <component><field ref="publisher"><required/></field></component>
      <component><field ref="id_number"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="book_section">
      <component><field ref="pagerange"/></component>
      <component><field ref="book_title"><required/></field></component>
      <component><field ref="volume"/></component>
      <component><field ref="place_of_pub"/></component>
      <component><field ref="publisher"><required/></field></component>
      <component><field ref="pages"/></component>
      <component><field ref="id_number"/></component>
      <component><field ref="series"/></component>
      <component><field ref="number"/></component>
      <component><field ref="isbn"/></component>
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="official_url"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="thesis">
      <component><field ref="date_issue"><required/></field></component>
      <component><field ref="official_url"/></component>
      <component><field ref="institution"><required/></field></component>
      <component><field ref="department"><required/></field></component>
      <component><field ref="pages"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="conference_item">
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="pages"/></component>
      <component><field ref="official_url"/></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="article">
      <component><field ref="publication"><required/></field></component>
      <component><field ref="volume"/></component>
      <component><field ref="number"/></component>
      <component><field ref="pagerange"/></component>
      <component><field ref="date_issue"/></component>
      <component><field ref="date_sub"/></component>
      <component><field ref="id_number"/></component>
      <component><field ref="official_url"/></component>
      <component><field ref="issn"/></component>
    </ep:ifmatch>
  </stage>

  <stage name="status">
    <ep:ifmatch name="type" value="thesis other monograph">
      <component><field ref="ispublished"><required/></field></component>
    </ep:ifmatch>
    <ep:ifmatch name="type" value="book_section book article conference_item">
      <component><field ref="ispublished"><required/></field></component>
      <component><field ref="refereed"><required/></field></component>
    </ep:ifmatch>
  </stage>

  <stage name="abstract">
    <component><field ref="abstract"/></component>
    <component><field ref="referencetext"/></component>
    <component><field ref="keywords"/></component>
  </stage>

  <stage name="subjects">
    <component><field ref="subjects"><required/></field></component>
  </stage>

  <stage name="notes">
    <component><field ref="note"/></component>
    <component><field ref="suggestions"/></component>
  </stage>

  <stage name="event">
    <ep:ifmatch name="type" value="conference_item">
      <component><field ref="event_title"><required/></field></component>
      <component><field ref="event_type"><required/></field></component>
      <component><field ref="event_location"/></component>
      <component><field ref="event_dates"/></component>
    </ep:ifmatch>
  </stage>

</workflow>
