[MarkLogic Dev General] Workflow in Marklogic
Hans-Juergen Rennau
hrennau at yahoo.de
Wed Nov 9 14:06:27 PST 2011
Hello Gurbeer,
as a postscript to what Damon said: I think properties documents are well suited to support workflows, too, as the "Application Developer's Guide", section 11.2 ("Using Properties for Document Processing") suggests.
Kind regards,
Hans-Juergen
----------------------------------------------------------------------
Gurbeer,
One simple way MarkLogic supports workflow is simply by being a transactional database. If you have an article that is represented by XML like <article><title>my title</title><body>my body</body></article> you can add a status such as <article status="submitted">... or status="reviewed". They populate the reviewer's inboxes with an element-attribute-value-query for the status attribute in the submitted status. When the reviewer approves it your XQuery will call xdmp:node-replace() on the status attribute (attributes are nodes too) to set it to reviewed, and it will disappear from the inbox.
If you don't want to alter tha actual XML, store workflow information and the actual article xml together:
<envelope>
<workflow-info> ... <status>submitted</status> ... </workflow-info>
<article> ... </article>
</envelope>
and query using cts:element-value-query() since in this format the status is an element rather than an attribute.
Hope this helps,
Damon
------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://developer.marklogic.com/pipermail/general/attachments/20111109/a3a46561/attachment.html
More information about the General
mailing list