Skip to content

Instantly share code, notes, and snippets.

@nialdarbey
Created April 29, 2012 02:22
Show Gist options
  • Save nialdarbey/2523870 to your computer and use it in GitHub Desktop.
Save nialdarbey/2523870 to your computer and use it in GitHub Desktop.
package com.mulesoft.se.wikigenerator.model;
global org.mule.module.bpm.MessageService mule;
dialect "mvel"
rule "When elements and the complexTypes they refer to in their 'type' attribute are found, then wrap them and put them back on Mule"
lock-on-active
when
$elementDocument : DefaultDocument ( $element : rootElement, $element.qName.name == "element" )
$complexTypeDocument : DefaultDocument ( $complexType : rootElement, $complexType.qName.name == "complexType", name == $elementDocument.name )
$complexTypeNameAttribute : Attribute ( qName.name == "name" ) from $complexType.attributes
Attribute ( qName.name == "type", value == $complexTypeNameAttribute.value) from $element.attributes
then
ElementSummary elementSummary = new ElementSummary($elementDocument, $complexTypeDocument);
Map map = new HashMap();
map.put("schemaName", $elementDocument.getName());
mule.generateMessage("vm://queue.elements", elementSummary, map, MessageExchangePattern.ONE_WAY);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment