Groovy web console

subscribe to the feed Subscribe
to this
site
Mule transformer (via #groovywebconsole)
tweet this snippet Tweet
this
script

Mule transformer

Published 2 weeks ago by Richard R
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
def mockPayload = [  [
    park_reserve_id: 1602,
    name: 'Tarrawarra G61 B.R',
    establishment_date: '2017-02-08T02:42:32Z',
    total_park_area_ha:8.903,
    area_type:'Natural Features Reserve - Bushland Reserve',
    provider:'Parks Victoria',
    mgmt_plan_approval_year:'',
    lcc_recommendation:'G61',
    lcc_category:'Natural Features Reserve - Bushland Area', 
    lcc_report:'Melbourne 2 Review (1994)',
    regulation:'',
    lop:'E1',
    legislative_act:'fair-trade act',
    district_id:120,
    district_name:'Dandenongs and Yarra Valley District Office',
    park_share_in_district:90,
    status: 1
  ],
  [
    park_reserve_id: 1603,
    name: 'Healsville Gorge B.R.',
    establishment_date: '2017-02-08T02:42:32Z',
    total_park_area_ha:2.953,
    area_type:'Natural Features Reserve - Bushland Reserve',
    provider:'G62',
    mgmt_plan_approval_year:'',
    lcc_recommendation:'G65',
    lcc_category:'Natural Features Reserve - Bushland Area', 
    lcc_report:'Melbourne 2 Review (1994)',
    regulation:'',
    lop:'E1',
    legislative_act:'fair-trade act',
    district_id:120,
    district_name:'Dandenongs and Yarra Valley District Office',
    park_share_in_district:90,
    status: 1
  ],
  [
    park_reserve_id: 1604,
    name: 'Picnic Hill B.R.',
    establishment_date: '2017-02-08T02:42:32Z',
    total_park_area_ha:6.844,
    area_type:'Natural Features Reserve - Bushland Reserve',
    provider:'Parks Victoria',
    mgmt_plan_approval_year:'',
    lcc_recommendation:'G65',
    lcc_category:'Natural Features Reserve - Bushland Area', 
    lcc_report:'Melbourne 2 Review (1994)',
    regulation:'',
    lop:'E1',
    legislative_act:'fair-trade act',
    district_id:120,
    district_name:'Dandenongs and Yarra Valley District Office',
    park_share_in_district:90,
    status: 1
  ],
  [
    park_reserve_id: 1605,
    name: 'Wandin Yallock B.R.',
    establishment_date: '2017-02-08T02:42:32Z',
    total_park_area_ha:6.964,
    area_type:'Natural Features Reserve - Bushland Reserve',
    provider:'Parks Victoria',
    mgmt_plan_approval_year:'',
    lcc_recommendation:'G65',
    lcc_category:'Natural Features Reserve - Bushland Area', 
    lcc_report:'Melbourne 2 Review (1994)',
    regulation:'',
    lop:'E1',
    legislative_act:'fair-trade act',
    district_id:120,
    district_name:'Dandenongs and Yarra Valley District Office',
    park_share_in_district:90,
    status: 1
  ],
  [
    park_reserve_id: 1606,
    name: 'Wandin Yallock G65 B.R',
    establishment_date: '2017-02-08T02:42:32Z',
    total_park_area_ha:4.027,
    area_type:'Natural Features Reserve - Bushland Reserve',
    provider:'Parks Victoria',
    mgmt_plan_approval_year:'',
    lcc_recommendation:'G65',
    lcc_category:'Natural Features Reserve - Bushland Area', 
    lcc_report:'Melbourne 2 Review (1994)',
    regulation:'',
    lop:'E1',
    legislative_act:'fair-trade act',
    district_id:120,
    district_name:'Dandenongs and Yarra Valley District Office',
    park_share_in_district:90,
    status: 1
  ]
]

mockPayload.each { park -> 
    println 'Park Reserve id: ' + park?.park_reserve_id
}