Loading TOC...

MarkLogic 10 Product Documentation
p:status-transition

p:status-transition(
   $status as xs:string,
   $description as xs:string,
   $on-success as xs:anyURI?,
   $on-failure as xs:anyURI?,
   $priority as xs:unsignedLong?,
   $default-action as element(p:action)?,
   $rules as element(p:execute)*
) as element(p:status-transition)

Summary

Construct a new status transition element.

Parameters
status The status: either "created", "updated", or "deleted".
description A description of the transition.
on-success The successor state, should the transition succeed. If no successor state is defined, the document will remain in its current state.
on-failure The successor state, should the transition fail. If no successor state is defined, the document will remain in its current state.
priority The priority for this transition. Higher priority transitions will be examined before lower priority ones. If no priority is passed, then the transition gets the highest priority.
default-action The default action to execute on entry into this status, if none of the rules apply.
rules The execution rules to apply in this transition. The first rule whose condition is true will have its action executed.

Example

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

  p:status-transition("created", 
                      "Document creation: Put in initial state.",
                      xs:anyURI("http://example.com/states/initial"), (), (),
                      (), () )
  

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