Loading TOC...

p:create

p:create(
   $name as xs:string,
   $description as xs:string,
   $success-action as element(p:action)?,
   $failure-action as element(p:action)?,
   $status-transitions as element(p:status-transition)*,
   $state-transitions as element(p:state-transition)*
) as xs:unsignedLong

Summary

Create a new content processing pipeline.

Parameters
name The name of the pipeline. It must be unique.
description A description of the pipeline.
success-action The default action for successful transitions. If none is provided the system default success action will be used. Create using p:action.
failure-action The default action for failed transitions. If none is provided the system default failure action will be used. Create using p:action.
status-transitions Status transition definitions. There should be exactly one status transition for the statuses "created", "deleted", and "updated". Create using p:status-transition.
state-transitions State transition definitions. There should be at most one state transition for a given state. Create using p:state-transition.

Example

  xquery version "1.0-ml";
  import module namespace p = "http://marklogic.com/cpf/pipelines" 
		  at "/MarkLogic/cpf/pipelines.xqy";

  let $init-state := xs:anyURI("http://example.com/states/init")
  let $error-state := xs:anyURI("http://example.com/states/error")
  return
  p:create( "Empty", "No nothing much", (), (), 
            ( p:status-transition("created", "", 
                                  $init-state, 
				  $error-state, 
				  (), (), () ),
	      p:status-transition("deleted", "", 
	                          (), 
	                          $error-state, 
				  (), (), () ),
	      p:status-transition("updated", "", 
				  (), 
				  $error-state, 
				  (), (), () )
             ), ()
          )
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.