Skip to content
This repository has been archived by the owner on May 22, 2020. It is now read-only.

Commit

Permalink
fixed code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
porcelli committed Aug 8, 2011
1 parent 8402257 commit 0a03446
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/email/readme.md
Expand Up @@ -33,7 +33,7 @@ To hold all those properties, we'll create a `Map<String, Object>` and fill it,
And finally, to invoke the flow, all we need is call the `process` method of `Mule` class:

```java
Mule.process("SendEmail", mailContent, properties);
myMule.flow("SendEmail").process(mailContent, properties);
```

Note that you can change this example to use your own smtp server, all you need to do is remove the line that starts the fake server (line 30) and set your smtp server details (lines 35-38).
Expand Down
4 changes: 2 additions & 2 deletions examples/file/readme.md
Expand Up @@ -68,11 +68,11 @@ To execute the flow passing a file, we just create it and use it as payload, as
out.write("MY SIMPLE AD-HOC FILE!".getBytes()); //set some content
out.close(); //close

Mule.process("multipleFileMove", tempFile); //executes the flow using tempFile as payload
myMule.flow("multipleFileMove").process(tempFile); //executes the flow using tempFile as payload
```

You can also set a string as payload as follows:

```java
Mule.process("multipleFileMove", "SOME DIRECT STRING CONTENT!"); //executes the flow using a string as payload
myMule.flow("multipleFileMove").process("SOME DIRECT STRING CONTENT!"); //executes the flow using a string as payload
```
4 changes: 2 additions & 2 deletions examples/rest/readme.md
Expand Up @@ -13,7 +13,7 @@ Example that executes a stock quote rest service and them transform its return i
In this example we define a flow that is expected to be executed directly from source code using the `Mule` class, and expect as its parameter (payload) the stock symbol, as follows:

```java
StockQuote quote = Mule.process("GetQuote", "IBM").getPayload(StockQuote.class);
StockQuote quote = myMule.flow("GetQuote").process("IBM").getPayloadAs(StockQuote.class);
```

Now let's understand how we build the flow to execute it. First we had to transform the payload to the format expected by the service, to execute this transformation we use a simple expression:
Expand Down Expand Up @@ -105,7 +105,7 @@ Next step all we need is execute the previous example flow ("TweetStockQuote") a
Note that we're re-using a flow that, in this case, isn't defined in the same module. And to enable it we must start Mule passing both modules as arguments, as show here:

```java
Mule.startMuleContext(new StockQuotesRestServiceModule(), new StockQuotesModule());
new Mule(new StockQuotesRestServiceModule(), new StockQuotesModule()).start();
```

To test this example you should start the java code and, on your web browser, open some of these URLs:
Expand Down

0 comments on commit 0a03446

Please sign in to comment.