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

example for repeated execution added

parent 8978fa3e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,8 +14,8 @@ import javax.xml.bind.annotation.XmlSeeAlso;
public abstract class QuerySchedule {

	/**
	 * Duration for the query. The duration is relative
	 * to a reference timestamp and might also be negative.
	 * Duration for the queried data, relative to the request reference date
	 * {@link QueryRequest#referenceDate}. Usually negative: e.g. -D1M for previous month.
	 */
	@XmlElement(required=true)
	public Period duration;
+1 −1
Original line number Diff line number Diff line
@@ -18,5 +18,5 @@ public class RepeatedExecution extends QuerySchedule{
	 * This property will not cause any execution on the data warehouse side.
	 * It is solely for information purposes.
	 */
	public Duration repeats;
	public Duration interval;
}
+1 −1
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ public class TestUnmarshallDocuments {
	public void unmarshallQuery() throws IOException, SAXException{
		Source xml = getResource("/query.xml");
		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;
		Assert.assertNotNull(se.duration);
		Assert.assertNotNull(se.reference);
+27 −0
Original line number Diff line number Diff line
<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>
+6 −1
Original line number Diff line number Diff line
<query xmlns="http://aktin.org/ns/exchange"
	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>
	<description>Lala</description>
	<principal>
@@ -16,6 +17,10 @@
	<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>