This page will explains how you can extends the DSL from Babel Camel by adding new keywords and grammar parts to the existing DSL.
Warning
The extension of the DSL requires some knowledge of the Scala language.
To create an extension, you need to create a new DSL, some definition objects and a Parser.
io.xtech.babel.camel.mock
io.xtech.babel.fish.parsing.StepDefinition
.io.xtech.babel.fish.BaseDSL
and extends a io.xtech.babel.fish.DSL2BaseDSL
io.xtech.babel.camel.parsing.CamelParsing
.Process
type and add it to the steps
of the trait.import io.xtech.babel.camel.mock._
//The Mock extension is added simply by
// extending the RouteBuilder with
val routeDef = new RouteBuilder with Mock {
//the mock keyword is the same as typing
// to("mock:output1")
from("direct:input").
requireAs[String].
mock("output1").
//the mock keyword keeps the same body type (here: String)
processBody(x => x.toUpperCase).
mock("output2")
}