Hi Malaka,

In order to get the dynamic schemas we need a connection to Salesforce.
Right now we are not providing the connection when getting the schema for a
connector. Refer screenshot below.

[image: Inline image 1]

How about we keep a property (a flag) in the connector meta-data whether it
is a dynamic schema connector or a static schema connector. If it is a
dynamic schema connector, in addition to above, we can add a field to
select the connection (from already created connections) and perform the
partner API call there. Instead of operation field we can load the entity
definitions to load the schema.

Thanks,
Maheeka

Maheeka Jayasuriya
Senior Software Engineer
Mobile : +94777750661

On Sat, Jun 18, 2016 at 8:01 PM, Malaka Silva <[email protected]> wrote:

> Hi,
>
> Data mapper will be introduced with ESB 5.0.0 tooling soon. This
> discussion is related to using data mapper with connectors in your
> integration flow.
>
> Data mapper is a tool that work at design time. So for each connector
> operation we need to include a schema in order to make use of data mapping.
>
> Currently there are two types of connector operations.
>
>    1. Static output and/or input required - If the connector always
>    produce same output format no issue and we can simply generate the schema
>    and bundle it with connector.
>    2. Dynamic output and/or input required - This is becoming a
>    changeling since output may change depend on the customization done on
>    individual apps.
>
> Good example is Salesforce. Object structure from one Salesforce org to
> another org can be different.
>
> So we need some generic mechanism to run this dynamic schema generation
> within tooling and specific implementation should be included in the
> connector.
>
> However including this part in a connector can make the connector heavy
> and this may not require during the run time. Best we have those in some
> place and get to tooling on demand.
>
> I have done a POC how we can do this for Salesforce. Sample code is
> available in [1]. We may have to do the same for each method.
>
> Here we are using metadata api to get the sObject list. Partner api
> describe sObject method to get fields.
>
> So this way we can get the required input and output and using this we can
> generate the schema. This is purely written in java.
>
> Now the next challenge is to include this with ESB tooling and connectors.
> Please put your suggestions.
>
> [image: Inline image 1]
>
> [image: Inline image 2]
>
> Generated output.
>
> Query
>
> <records xmlns:xsi="sfdc" xmlns:sf="sfdc" xsi:type="sf:sObject">
>     <sf:type>Account</sf:type>
>     <sf:Site>UK</sf:Site>
>     <sf:LastModifiedDate>2016-01-05T09:44:15.000Z</sf:LastModifiedDate>
>     <sf:Ownership></sf:Ownership>
>     <sf:Description>Test</sf:Description>
>     <sf:BillingCity></sf:BillingCity>
>     <sf:Rating></sf:Rating>
>     .........................................
> </records>
>
> Upsert
>
> <sfdc:sObjects xmlns:sfdc="sfdc" type="Account">
>     <sfdc:sObject>
>         <sfdc:Site>value</sfdc:Site>
>         <sfdc:LastModifiedDate>value</sfdc:LastModifiedDate>
>         <sfdc:Ownership>value</sfdc:Ownership>
>         ................................
>         ...............................
>     </sfdc:sObject>
> </sfdc:sObjects>
>
> [1]
> https://github.com/malakasilva/ESB/tree/master/salesforce-dynamic-schema
>
> Best Regards,
>
> Malaka Silva
> Senior Technical Lead
> M: +94 777 219 791
> Tel : 94 11 214 5345
> Fax :94 11 2145300
> Skype : malaka.sampath.silva
> LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
> Blog : http://mrmalakasilva.blogspot.com/
>
> WSO2, Inc.
> lean . enterprise . middleware
> http://www.wso2.com/
> http://www.wso2.com/about/team/malaka-silva/
> <http://wso2.com/about/team/malaka-silva/>
> https://store.wso2.com/store/
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to