---json { "page_id": "rdsmd9ruqzgoaxl9wefva" } --- ====== Data Operation - Define ====== ===== Define ===== ''define'' is a [[:docs:flow:supplier|supplier]] [[op|operation]] that defines one or more inline [[docs:resource:resource|data resources]] in a [[docs:flow:pipeline|pipeline file]]. Note that a [[select|select operation]] may not return any [[docs:resource:resource|data resources]] but the ''define'' operation must return always the data resource that it defines. This is a first step of a [[:docs:flow:pipeline|pipeline]] (known as the [[docs:flow:supplier|supplier step]]) because it supplies [[docs:resource:resource|data resources]] to the [[:docs:flow:intermediate|others operations (known as intermediate)]] in the pipeline. ===== Example ===== * [[howto:pipeline:define]] ===== Arguments ===== The ''define'' operation accepts the following [[:docs:flow:argument|arguments]]. ^ Arguments ^ Default ^ Definition ^ | ''data-resource'' | | One [[#data resource definition]] | | ''data-resources'' | | A list of [[#data resource definition]] | | ''processing-type'' | ''batch'' | The [[:docs:flow:processing-type|processing type]] (''batch'' or ''stream'') | ==== Data resource Definition ==== The following argument defines one data resource and can be set: * once in the `data-resource` argument * multiple time in the `data-resources` argument You can define a data resource by: * `data-uri` * or by `data` (inline rows) but not both ^ Arguments ^ Mandatory ^ Definition ^ ^ One resource definition by Data Uri ^^^ | ''data-uri'' | only if ''data'' is not defined | The [[docs:resource:data_uri|data uri]] is the location of the resource | | ''media-type'' | | The [[docs:resource:media-type|media type]] of the data uri resource | ^ One resource definition by Data ^^^ | ''data'' | only if ''data-uri'' is not defined | The ''data'' as a list of [[docs:resource:record|records]] (the data are in the inline) | ^ The optional data attributes ^^^ | ''data-def'' | no | The data attributes in a [[docs:resource:data-definition|data definition format]] | ==== Processing Type ==== * In a ''batch'' [[:docs:flow:processing-type|processing type]], the data resources are sent in the pipeline only once. * In a ''stream'' [[:docs:flow:stream_pipeline|stream processing type]], the same data resources are rebuild at poll time and resend.