Loading TOC...

MarkLogic Server 11.0 Product Documentation
p:state-transition

p:state-transition(
   $state as xs:anyURI,
   $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:state-transition)

Summary

Construct a new state transition element.

Parameters
state The name of the state.
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 state, 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:state-transition( xs:anyURI("http://example.com/states/review"),
                      "Document review state", 
                      (), xs:anyURI("http://example.com/states/error"), (),
                      p:action("/app/send-to-reviewer.xqy",(), ()),
                      () )
  

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