Advertisement
Guest User

Untitled

a guest
Aug 5th, 2015
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. import com.strikersoft.tetra.domain.model.xml.XmlDocumentApi;
  2. import com.strikersoft.tetra.domain.model.xml.XmlNodeApi;
  3.  
  4. rule "Test XmlApi"
  5. when
  6. stateHolder : StateHolder( xmlOutApi != null, $xmlOut : xmlOutApi, $message : message);
  7. then
  8. $xmlOut.rootFind("/*").elem("actionPlanInfo");
  9. for (int i = 0; i < 2; i++) {
  10. $xmlOut
  11. .elem("actionPlan")
  12. .attr("code", "code " + i)
  13. .attr("name", "name " + i)
  14. .attr("note", "notes " + i)
  15. .attr("projectCode", "projectCode" + i)
  16. .attr("location", "loc" + i)
  17. .attr("existingControl", "control" + i)
  18. .attr("priority", "HIGH")
  19. .attr("dueDate", new Date())
  20. .attr("startDate", new Date());
  21. for (int j = 0; j < 3; j++) {
  22. $xmlOut.elem("areaOfObservation").text("code " + j).parent();
  23. }
  24. for (int k = 0; k < 3; k++) {
  25. $xmlOut.elem("image").text("code " + k).parent();
  26. }
  27. $xmlOut.parent("actionPlanInfo");
  28. }
  29. end
  30.  
  31. -----------------------------------------------------------------------------------------
  32.  
  33. <?xml version="1.0" encoding="ASCII"?>
  34. <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">
  35. <commonInfo inner-id="1">
  36. <assessmentDetails assessmentId="L-23911" client="Legal &amp; General" clientId="" inner-id="2" recommendedReview="12" visitEndDate="2015-06-25T00:00:00+01:00"
  37. visitStartDate="2015-06-25T00:00:00+01:00"/>
  38. <consultant email="ochervak@strikersoft.com" fullname="Richard Flatman" inner-id="3" position="Consultant"/>
  39. </commonInfo>
  40. <resources inner-id="134">
  41. <image reference="4"/>
  42. <image caption="" id="IMG_20150625_140045186.jpg" inner-id="135" name="IMG_20150625_140045186.jpg" sha1="9c9078d4fc84fa95be5731f0c2885f0ebefa9418" size="3712269"/>
  43. <image caption="" id="IMG_20150625_132743612.jpg" inner-id="136" name="IMG_20150625_132743612.jpg" sha1="c812939ba46cc53007db056b26efea42665de7e0" size="3882777"/>
  44. <image caption="" id="IMG_20150625_134510648.jpg" inner-id="137" name="IMG_20150625_134510648.jpg" sha1="93d9dcfaae67b8925cd6961335e4b5056c71de81" size="4059946"/>
  45. <image caption="" id="IMG_20150625_130214065.jpg" inner-id="138" name="IMG_20150625_130214065.jpg" sha1="a50463b0bd923152783936d8d403a9371d7f0667" size="4258162"/>
  46. <image caption="" id="IMG_20150625_130936567.jpg" inner-id="139" name="IMG_20150625_130936567.jpg" sha1="9826c9a6d0915274ea8458b2328f514f823ab5f3" size="3884443"/>
  47. <image caption="" id="IMG_20150625_131117012.jpg" inner-id="140" name="IMG_20150625_131117012.jpg" sha1="51f609967c77f7d3756cd6058c2ba11e5a364692" size="4038461"/>
  48. <image caption="" id="IMG_20150625_132430578.jpg" inner-id="141" name="IMG_20150625_132430578.jpg" sha1="84841c600712b0d47e655169f6676a603e3c4de3" size="4575117"/>
  49. </resources>
  50. <actionPlanInfo>
  51. <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"
  52. startDate="Wed Aug 05 09:06:30 EEST 2015">
  53. <areaOfObservation>code 0</areaOfObservation>
  54. <areaOfObservation>code 1</areaOfObservation>
  55. <areaOfObservation>code 2</areaOfObservation>
  56. <image>code 0</image>
  57. <image>code 1</image>
  58. <image>code 2</image>
  59. </actionPlan>
  60. <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"
  61. startDate="Wed Aug 05 09:06:30 EEST 2015">
  62. <areaOfObservation>code 0</areaOfObservation>
  63. <areaOfObservation>code 1</areaOfObservation>
  64. <areaOfObservation>code 2</areaOfObservation>
  65. <image>code 0</image>
  66. <image>code 1</image>
  67. <image>code 2</image>
  68. </actionPlan>
  69. </actionPlanInfo>
  70. </hsAssessment>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement