Commit 84d9a866 authored by R.W.Majeed's avatar R.W.Majeed

example for repeated execution added

parent 8978fa3e
...@@ -14,8 +14,8 @@ import javax.xml.bind.annotation.XmlSeeAlso; ...@@ -14,8 +14,8 @@ import javax.xml.bind.annotation.XmlSeeAlso;
public abstract class QuerySchedule { public abstract class QuerySchedule {
/** /**
* Duration for the query. The duration is relative * Duration for the queried data, relative to the request reference date
* to a reference timestamp and might also be negative. * {@link QueryRequest#referenceDate}. Usually negative: e.g. -D1M for previous month.
*/ */
@XmlElement(required=true) @XmlElement(required=true)
public Period duration; public Period duration;
......
...@@ -18,5 +18,5 @@ public class RepeatedExecution extends QuerySchedule{ ...@@ -18,5 +18,5 @@ public class RepeatedExecution extends QuerySchedule{
* This property will not cause any execution on the data warehouse side. * This property will not cause any execution on the data warehouse side.
* It is solely for information purposes. * It is solely for information purposes.
*/ */
public Duration repeats; public Duration interval;
} }
...@@ -72,7 +72,7 @@ public class TestUnmarshallDocuments { ...@@ -72,7 +72,7 @@ public class TestUnmarshallDocuments {
public void unmarshallQuery() throws IOException, SAXException{ public void unmarshallQuery() throws IOException, SAXException{
Source xml = getResource("/query.xml"); Source xml = getResource("/query.xml");
Query query = JAXB.unmarshal(xml, Query.class); Query query = JAXB.unmarshal(xml, Query.class);
Assert.assertEquals(query.schedule.getClass(), SingleExecution.class); Assert.assertEquals(SingleExecution.class, query.schedule.getClass());
SingleExecution se = (SingleExecution)query.schedule; SingleExecution se = (SingleExecution)query.schedule;
Assert.assertNotNull(se.duration); Assert.assertNotNull(se.duration);
Assert.assertNotNull(se.reference); Assert.assertNotNull(se.reference);
......
<query xmlns="http://aktin.org/ns/exchange"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dwh="http://aktin.org/ns/dwh"
xmlns:psm="http://www.i2b2.org/xsd/cell/crc/psm/1.1/">
<id>123</id>
<description>Lala</description>
<principal>
<name>Prince Ipal</name>
<organisation>AKTIN</organisation>
<email>it-support@aktin.org</email>
<phone>+49 (441) 798 - 2772</phone>
</principal>
<schedule xsi:type="repeatedExecution">
<duration>-1W</duration>
<interval>P1D</interval>
</schedule>
<concepts>
<concept id="birthdate" xsi:type="raw"/>
</concepts>
<!-- also possible: xsi:type="psm:query_definition" -->
<!-- also possible: xsi:type="dwh:eclectic_query",
see http://methods.schattauer.de/en/contents/archivestandard/issue/2168/manuscript/21349/show.html
-->
<dwh:sql xsi:type="dwh:sqlt">
SELECT a, b;
</dwh:sql>
</query>
<query xmlns="http://aktin.org/ns/exchange" <query xmlns="http://aktin.org/ns/exchange"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dwh="http://aktin.org/ns/dwh"> xmlns:dwh="http://aktin.org/ns/dwh"
xmlns:psm="http://www.i2b2.org/xsd/cell/crc/psm/1.1/">
<id>123</id> <id>123</id>
<description>Lala</description> <description>Lala</description>
<principal> <principal>
...@@ -16,6 +17,10 @@ ...@@ -16,6 +17,10 @@
<concepts> <concepts>
<concept id="birthdate" xsi:type="raw"/> <concept id="birthdate" xsi:type="raw"/>
</concepts> </concepts>
<!-- also possible: xsi:type="psm:query_definition" -->
<!-- also possible: xsi:type="dwh:eclectic_query",
see http://methods.schattauer.de/en/contents/archivestandard/issue/2168/manuscript/21349/show.html
-->
<dwh:sql xsi:type="dwh:sqlt"> <dwh:sql xsi:type="dwh:sqlt">
SELECT a, b; SELECT a, b;
</dwh:sql> </dwh:sql>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment