include "common.rnc"

start |= Workflow

Workflow = element workflow { Service }

Implementation &= Flow

# Mobyle Dataflow Definition
Flow = element flow { Task+, Link* }

Task =
  element task {
    attribute id { xsd:string }
    & attribute service { xsd:string }
    & attribute service_url { xsd:string }?
    & attribute server { xsd:string }?
    & attribute suspend { xsd:boolean }?
    & element description { text }?
    & element position{ text }?
    & element inputValue{
        attribute name { text },
        (attribute reference { xsd:anyURI } | text)
    }*
  }

Link =
  element link {
    attribute id { xsd:string }?
    & attribute fromTask { xsd:string }?
    & attribute fromParameter { xsd:NMTOKEN }
    & attribute toTask { xsd:string }?
    & attribute toParameter { xsd:NMTOKEN }
  }

InterfaceType &= ("form"|"job_input"|"job_output"|"graph")