Note that there are some explanatory texts on larger screens.

plurals
  1. POMule Studio How to create global variable
    primarykey
    data
    text
    <p><a href="http://kongarn.com/images/mule2.png" rel="nofollow noreferrer">click hear to see my flow Image</a></p> <p>My test mule application. I use curl json post data to the http-end-point and tranforms json to object and insert on my database with name (<strong>#[message.payload.name]</strong>) </p> <p>I use catch-exception-strategy for keep error log (case Unique name)</p> <p>I want to update my table with condition in field #[message.payload.name] - mean Update mytable set Firstname = #[message.payload.name]</p> <p>but in catch-exception-strategy can't access #[message.payload.name]</p> <p>My configuration</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;mule xmlns:jdbc-ee="http://www.mulesoft.org/schema/mule/ee/jdbc" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.3.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/current/mule-jdbc-ee.xsd http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd "&gt; &lt;data-mapper:config name="Mapper" transformationGraphPath="mapper.grf" doc:name="DataMapper"&gt;&lt;/data-mapper:config&gt; &lt;jdbc-ee:mysql-data-source name="MySQL_Data_Source1" url="jdbc:mysql://localhost:3306/mule" user="root" password="1234" transactionIsolation="UNSPECIFIED" doc:name="MySQL Data Source"/&gt; &lt;jdbc-ee:connector name="Database" dataSource-ref="MySQL_Data_Source1" validateConnections="true" queryTimeout="-1" pollingFrequency="0" doc:name="Database"/&gt; &lt;flow name="httpPostTestFlow1" doc:name="httpPostTestFlow1"&gt; &lt;http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8081" path="httpPost" doc:name="httpPost"&gt;&lt;/http:inbound-endpoint&gt; &lt;json:json-to-object-transformer doc:name="JSON to Object" returnClass="java.util.Map"&gt;&lt;/json:json-to-object-transformer&gt; &lt;jdbc-ee:outbound-endpoint exchange-pattern="one-way" queryKey="INSERT_TOKEN" connector-ref="Database" doc:name="Database"&gt; &lt;jdbc-ee:query key="INSERT_TOKEN" value="insert into users(FirstName) values(#[message.payload.name]);"/&gt; &lt;/jdbc-ee:outbound-endpoint&gt; &lt;!-- &lt;http:outbound-endpoint exchange-pattern="request-response" host="localhost" port="80" path="post-debug.php" contentType="application/x-www-form-urlencoded" doc:name="post-debug.php"/&gt; --&gt; &lt;catch-exception-strategy doc:name="Catch Exception Strategy"&gt; &lt;expression-component doc:name="Create error response"&gt;#[message.payload = "{\"status\":\"error\", \"message\":\"" + exception.cause.message + "\"}"]&lt;/expression-component&gt; &lt;jdbc-ee:outbound-endpoint exchange-pattern="one-way" connector-ref="Database" doc:name="Database" queryTimeout="-1" queryKey="UPDATE_TOKEN"&gt; &lt;jdbc-ee:query key="UPDATE_TOKEN" value="update users SET fail_message = #[message.payload]"/&gt; &lt;/jdbc-ee:outbound-endpoint&gt; &lt;/catch-exception-strategy&gt; &lt;/flow&gt; &lt;/mule&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload