Assume we're on the develop branch:
git checkout develop
When the bitbucket server keeps disconnecting mid-conversation, use two steps instead of one to pull the latest code:
alias: Overnight | |
description: Turn down heating overnight | |
trigger: | |
- platform: time | |
at: "22:30:00" | |
condition: | |
- condition: numeric_state | |
entity_id: climate.thermostat_2 | |
attribute: temperature | |
above: 19 |
xquery version "1.0-ml"; | |
(: run against App-Services to export workspace(s) into /tmp directory as individual scripts :) | |
declare namespace qconsole="http://marklogic.com/appservices/qconsole"; | |
for $workspace in ('WorkFlow', 'Workspace') | |
let $export := /qconsole:workspace[qconsole:name=$workspace and qconsole:security/qconsole:userid=xdmp:get-current-userid()] | |
return ( (:$export,:) | |
for $qq in ( $export/qconsole:queries/qconsole:query )[1] |
declare function local:assert-equal-xml($expected, $actual) { | |
typeswitch ($actual) | |
case document-node() return | |
typeswitch ($expected) | |
case document-node() return | |
local:assert-equal-xml($expected/node(), $actual/node()) | |
default return | |
local:assert-equal-xml($expected, $actual/node()) | |
case element() return | |
if (fn:empty($expected)) then |
xquery version "1.0-ml"; | |
import module namespace sec="http://marklogic.com/xdmp/security" at "/MarkLogic/security.xqy"; | |
declare function local:role-name( | |
$role-id as xs:unsignedLong | |
) as xs:string { | |
xdmp:invoke-function( | |
function() { sec:get-role-names($role-id) }, | |
<options xmlns="xdmp:eval"> | |
<database>{xdmp:database("Security")}</database> |
// clunky gradle bits to get ml-unit-test to play nicely with DHF 2.0.4 - tests will only be deployed in test or local environment | |
task copyTests(type: Copy) { | |
from file("test-src") | |
into file("plugins") | |
} | |
task removeTests(type: Delete) { |
xquery version "1.0-ml"; | |
let $uri := "https://api.github.com/repos/marklogic-community/marklogicworkflow/issues?state=all&per_page=200" | |
let $result := xdmp:http-get($uri) | |
return | |
xdmp:document-insert("/marklogic-community/marklogicworkflow/issues.json", $result[2]) | |
; | |
import module namespace json = "http://marklogic.com/xdmp/json" at "/MarkLogic/json/json.xqy"; | |
declare namespace jbas = "http://marklogic.com/xdmp/json/basic"; |
{ | |
"readResponse": { | |
"outcome": "SUCCESS", | |
"document": { | |
"process": { | |
"id": "c50e740e-bf6c-406a-9ec2-ccce4bb4f9f0-2017-11-21T15:05:50.160185Z", | |
"title": "015-restapi-tests__1__2", | |
"name": "015-restapi-tests", | |
"major": "1", | |
"minor": "2", |
<?xml version="1.0" encoding="UTF-8"?> | |
<ext:readResponse xmlns:ext="http://marklogic.com/rest-api/resource/process"> | |
<ext:outcome>SUCCESS</ext:outcome> | |
<ext:document> | |
<wf:process id="c50e740e-bf6c-406a-9ec2-ccce4bb4f9f0-2017-11-21T15:05:50.160185Z" title="015-restapi-tests__1__2" name="015-restapi-tests" major="1" minor="2" xmlns:wf="http://marklogic.com/workflow"> | |
<wf:data> | |
<choiceA>B</choiceA> | |
<choiceB>C</choiceB> | |
<newassignee>admin</newassignee> | |
<unlock-new-data>Some data created on request to unlock</unlock-new-data> |