On Wed, Jan 18, 2012 at 5:03 PM, Dinusha Senanayaka <[email protected]>wrote:

> Hi All,
>
> We are going to develop a ESB mediator which can be shipped as a feature
> and once this feature is installed within ESB, the DS mediator can be used
> to make data services calls in-line, without making actual SOAP requests,
> but it will use in-memory calls to invoke data service operations.
>

I think first you need to think the features this mediator going provide
for an ESB user and hence what type of interface expect from the mediator
configuration.
For an example I am not seeing much relevance of service/operation resource
here.
Then think about the mediator configuration according to that and implement.

For an example Rules also has to support both as a web service and a
mediator.

The idea of rule mediator is to use it as

1. Transformer
2. Rule based content routing

If we take the mediation aspect there is not need to have the WS- aspects.
For an example ws component only shift with BRS server and Mediation
component only shift with ESB.

For an instance in the transformation case it can either get the soapBody
apply rules and send the result to soapBody (or some part given as an Xpath)

thanks,
Amila.




>
> So this will add the capability to have .dbs file in registry or some
> other file location and invoke the data-service operations without
> deploying the .dbs as a data-service and process the response within the
> ESB.
>
> Possible mediator configuration will look as follows:
>
> <!-- normal request -->
> <dsCall serviceName/servicePath="...">                      <!--
> serviceName is used when calling to a actually deployed data-service within
> current service configuration &
>
> servicePath is used to invoke a operation from .dbs file which has not
> deployed -->
>   <operation/resource name/path=".." />                       <!--
> operation name or resource path to be invoke -->
>   <params expression="xpath">                                   <!-- xpath
> expression is optional, which can be defined to take all input parameters.
> -->
>     <param name="name1" value="value1" />                <!-- if the xpath
> expression in "params" is not provided then provide the parameters in line
> -->
>     <param name="arrayName1" value="arrayVal1" />
>     <param name="arrayName1" value="arrayVal2" />
>     <param name=".." expression="xpath" />                 <!-- inline
> parameter value can be provided through xpath -->
>   <params>
>   </operation>
>   <target expression="xpath" />                                   <!-- If
> the xpath is not provided, response message after invoking the operation
> will added as fist child element of
>
> the SOAP body. If an xpath expression is provided then it will set in the
> given location.
> </dsCall>
>
> <!-- batch request -->
> <dsCall serviceName/servicePath="...">
>   <operation/resource name/path=".."/>
>   <params expression="xpath">
>     <batch expression="xpath">                                  <!-- xpath
> expression can be used to define parameter set for a one batch -->
>       <param name="name1" value="value1" />
>       <param name="arrayName1" value="arrayVal1" />
>       <param name="arrayName1" value="arrayVal2" />
>       <param name=".." expression="xpath" />
>     <batch>
>     <batch ..>...</batch>
>   <params>
>
> </dsCall>
>
> <!-- boxcarring -->
> <dsCall serviceName/servicePath="...">
>   <boxcarring>
>     <request>
>       <operation/resource name/path=".." />
>         <params expression="xpath">
>           <param name="name1" value="value1" />
>           <param name="arrayName1" value="arrayVal1" />
>           <param name="arrayName1" value="arrayVal2" />
>           <param name=".." expression="xpath" />
>         <params>
>       </operation>
>     </request>
>     <request ...></request>
>   </boxcarring>
>
>   <target expression="xpath" />
>
> </dsCall>
>
> Appreciate any feedback and ideas.
>
> Regards,
> Dinusha.
>
> _______________________________________________
> Carbon-dev mailing list
> [email protected]
> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
>
>


-- 
*Amila Suriarachchi*

Software Architect
WSO2 Inc. ; http://wso2.com
lean . enterprise . middleware

phone : +94 71 3082805

Attachment: placeOrder.rsl
Description: Binary data

<ruleMediator xmlns="http://wso2.org/carbon/rules"; backendRuntimeFactory="org.wso2.carbon.rule.backend.drools.DroolsBackendRuntimeFactory">
    <source>soapBody</source>
    <target>soapBody</target>
    <ruleSet>
        <rule resourceType="drl" sourceType="inline">
            <![CDATA[
                package OrderApproval;

                import samples.userguide.OrderAccept;
                import samples.userguide.OrderReject;
                import samples.userguide.PlaceOrder;

                rule "Order Approval Rule" dialect "mvel" no-loop true salience 4

                when
                $placeOrder : PlaceOrder( ( symbol == "IBM" && quantity > 10 ) || ( symbol == "SUN" && price > 100 ) || ( symbol == "MSFT" && price > 50 && quantity < 200 ) )
                then

                OrderAccept orderAccept = new OrderAccept();
                orderAccept.setMessage("Accepted order for: "+ $placeOrder.quantity + " stocks of "+
                $placeOrder.symbol +" at$ " + $placeOrder.price);
                insertLogical(orderAccept);

                end

                rule "IBM Order Deny Rule" dialect "mvel" no-loop true salience 3

                when
                not ( OrderAccept())
                $placeOrder : PlaceOrder( symbol == "IBM" )
                then
                retract($placeOrder);
                OrderReject orderReject = new OrderReject();
                orderReject.setReason("An Order for stocks of IBM is accepted only if the number of stocks is higher than 10.");
                insertLogical(orderReject);
                end

                rule "SUN Order Deny Rule" dialect "mvel" no-loop true salience 2
                when
                not ( OrderAccept())
                $placeOrder : PlaceOrder( symbol == "SUN" )
                then
                retract($placeOrder);
                OrderReject orderReject = new OrderReject();
                orderReject.setReason("An Order for stocks of SUN is accepted only if the stock price is higher than 100 $.");
                insertLogical(orderReject);
                end

                rule "MSFT Order Deny Rule" dialect "mvel" no-loop true salience 1
                when
                not ( OrderAccept())
                $placeOrder : PlaceOrder( symbol == "MSFT" )
                then
                retract($placeOrder);
                OrderReject orderReject = new OrderReject();
                orderReject.setReason("An Order for stocks of MSFT is accepted only if the stock price is higher than 50 $ and the number of stocks is lower than 200.");
                insertLogical(orderReject);
                end
            ]]>
        </rule>
    </ruleSet>
    <input wrapperElementName="placeOrder" namespace="http://com.test/placeorder";>
        <fact elementName="order" namespace="http://com.test/placeorder";
              type="samples.userguide.PlaceOrder"></fact>
    </input>
    <output wrapperElementName="placeOrderRespone" namespace="http://com.test/placeorder";>
        <fact elementName="orderAccept" namespace="http://com.test/placeorder";
              type="samples.userguide.OrderAccept"></fact>
        <fact elementName="orderReject" namespace="http://com.test/placeorder";
              type="samples.userguide.OrderReject"></fact>
    </output>
</ruleMediator>

Attachment: ruledesign.pdf
Description: Adobe PDF document

_______________________________________________
Carbon-dev mailing list
[email protected]
http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev

Reply via email to