Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import com.strikersoft.tetra.domain.model.xml.XmlDocumentApi;
- import com.strikersoft.tetra.domain.model.xml.XmlNodeApi;
- rule "Test XmlApi"
- when
- stateHolder : StateHolder( xmlOutApi != null, $xmlOut : xmlOutApi, $message : message);
- then
- $xmlOut.rootFind("/*").elem("actionPlanInfo");
- for (int i = 0; i < 2; i++) {
- $xmlOut
- .elem("actionPlan")
- .attr("code", "code " + i)
- .attr("name", "name " + i)
- .attr("note", "notes " + i)
- .attr("projectCode", "projectCode" + i)
- .attr("location", "loc" + i)
- .attr("existingControl", "control" + i)
- .attr("priority", "HIGH")
- .attr("dueDate", new Date())
- .attr("startDate", new Date());
- for (int j = 0; j < 3; j++) {
- $xmlOut.elem("areaOfObservation").text("code " + j).parent();
- }
- for (int k = 0; k < 3; k++) {
- $xmlOut.elem("image").text("code " + k).parent();
- }
- $xmlOut.parent("actionPlanInfo");
- }
- end
- -----------------------------------------------------------------------------------------
- <?xml version="1.0" encoding="ASCII"?>
- <hsAssessment xmlns="http://strikersoft.com/tetra" androidClientVersion="3.1" androidLocale="en_GB" androidOSVersion="22" contentVersion="2014.52.4_t" inner-id="0" version="0.3">
- <commonInfo inner-id="1">
- <assessmentDetails assessmentId="L-23911" client="Legal & General" clientId="" inner-id="2" recommendedReview="12" visitEndDate="2015-06-25T00:00:00+01:00"
- visitStartDate="2015-06-25T00:00:00+01:00"/>
- <consultant email="ochervak@strikersoft.com" fullname="Richard Flatman" inner-id="3" position="Consultant"/>
- </commonInfo>
- <resources inner-id="134">
- <image reference="4"/>
- <image caption="" id="IMG_20150625_140045186.jpg" inner-id="135" name="IMG_20150625_140045186.jpg" sha1="9c9078d4fc84fa95be5731f0c2885f0ebefa9418" size="3712269"/>
- <image caption="" id="IMG_20150625_132743612.jpg" inner-id="136" name="IMG_20150625_132743612.jpg" sha1="c812939ba46cc53007db056b26efea42665de7e0" size="3882777"/>
- <image caption="" id="IMG_20150625_134510648.jpg" inner-id="137" name="IMG_20150625_134510648.jpg" sha1="93d9dcfaae67b8925cd6961335e4b5056c71de81" size="4059946"/>
- <image caption="" id="IMG_20150625_130214065.jpg" inner-id="138" name="IMG_20150625_130214065.jpg" sha1="a50463b0bd923152783936d8d403a9371d7f0667" size="4258162"/>
- <image caption="" id="IMG_20150625_130936567.jpg" inner-id="139" name="IMG_20150625_130936567.jpg" sha1="9826c9a6d0915274ea8458b2328f514f823ab5f3" size="3884443"/>
- <image caption="" id="IMG_20150625_131117012.jpg" inner-id="140" name="IMG_20150625_131117012.jpg" sha1="51f609967c77f7d3756cd6058c2ba11e5a364692" size="4038461"/>
- <image caption="" id="IMG_20150625_132430578.jpg" inner-id="141" name="IMG_20150625_132430578.jpg" sha1="84841c600712b0d47e655169f6676a603e3c4de3" size="4575117"/>
- </resources>
- <actionPlanInfo>
- <actionPlan code="code 0" dueDate="Wed Aug 05 09:06:30 EEST 2015" existingControl="control0" location="loc0" name="name 0" note="notes 0" priority="HIGH" projectCode="projectCode0"
- startDate="Wed Aug 05 09:06:30 EEST 2015">
- <areaOfObservation>code 0</areaOfObservation>
- <areaOfObservation>code 1</areaOfObservation>
- <areaOfObservation>code 2</areaOfObservation>
- <image>code 0</image>
- <image>code 1</image>
- <image>code 2</image>
- </actionPlan>
- <actionPlan code="code 1" dueDate="Wed Aug 05 09:06:30 EEST 2015" existingControl="control1" location="loc1" name="name 1" note="notes 1" priority="HIGH" projectCode="projectCode1"
- startDate="Wed Aug 05 09:06:30 EEST 2015">
- <areaOfObservation>code 0</areaOfObservation>
- <areaOfObservation>code 1</areaOfObservation>
- <areaOfObservation>code 2</areaOfObservation>
- <image>code 0</image>
- <image>code 1</image>
- <image>code 2</image>
- </actionPlan>
- </actionPlanInfo>
- </hsAssessment>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement