Topic
  • 9 replies
  • Latest Post - ‏2012-02-29T05:51:53Z by Barnali9985
Evyatar
Evyatar
12 Posts

Pinned topic MDM Txn vs. Business Proxy

‏2009-08-12T15:54:21Z |
As a part of our new functionality we are trying to create a new internal business transaction.

We used the MDM module to define new MDM Txn.
After following MDM instructions we were able to reach the handle method of our newly created component.
Within this method we are trying to call a method of a different MDM core component (party_component).

It looks like this:

TCRMPartyComponent personComponent = (TCRMPartyComponent) TCRMClassFactory.getTCRMComponent(
"party_component");   TCRMPersonBObj responsePersonBObj = (TCRMPersonBObj) personComponent.addPerson(requestPersonBObj);


Although the person was created successfully, all other objects that were included within the personBObj (address, contequiv) are not getting created and are missing from the DB.
No exceptions are thrown and no errors appear in the logs.
Should it matter if there extensions on the Person object?

Are we going in the right direction or should everything be done from a Business Proxy?
(On BP we can call processPersistentObject instead...)

Are there any known issues on MDM 8.5 around this area?

Thanks in advance
Updated on 2012-02-29T05:51:53Z at 2012-02-29T05:51:53Z by Barnali9985
  • vincponcet
    vincponcet
    21 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-12T16:03:53Z  
    In workbench new TxN, you are at the component layer, whereas for business proxies, you are at controller level.
    Hence, when you are calling addPerson, you are calling the fine grained addPerson, which handles only PersonBObj (and PersonName), whereas you used to call a coarse grained addPerson, which handles all child objects.

    Personally, I prefer to be at component layer, that way, I know exactly what I'm doing, specially when having to create maintain type services, which are always customer&application specific.
    Also, using workbench give you webservice exposure for free, whereas if you do a BP, you will have to do your ws layer yourself.
  • LenaW
    LenaW
    15 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-12T17:13:46Z  
    Since Person is a subtype of the Party, you should be calling addParty() on TCRMPartyComponent. All of the child objects are associated with the super type Party and only name is associated with the Person and Org specifically.
    Another very important reason for calling addParty() is suspect processing, which you would be by-passing if going directly to the fine grain component method to add person.
  • Evyatar
    Evyatar
    12 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-13T07:31:09Z  
    Thanks for the answers so far, but they led me to the following questions -

    1. Is there a way to call the coarse grained TXNs from the component level?

    2. Can we call from one Business Proxy class to another Business Proxy class?

    We need to split our business logic between several classes in order to generate different notifications according to the different flows.

    Your quick responses are greatly appreciated.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-13T08:37:20Z  
    • Evyatar
    • ‏2009-08-13T07:31:09Z
    Thanks for the answers so far, but they led me to the following questions -

    1. Is there a way to call the coarse grained TXNs from the component level?

    2. Can we call from one Business Proxy class to another Business Proxy class?

    We need to split our business logic between several classes in order to generate different notifications according to the different flows.

    Your quick responses are greatly appreciated.
    Hi,

    You shouldn't try and call controller level transactions from the component level.

    You can call one business proxy from another - they are just Java classes. See the sample code shipped with MDM Server for examples.

    Hope that helps, Catherine.
  • Evyatar
    Evyatar
    12 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-13T09:36:59Z  
    Hi,

    You shouldn't try and call controller level transactions from the component level.

    You can call one business proxy from another - they are just Java classes. See the sample code shipped with MDM Server for examples.

    Hope that helps, Catherine.
    This all comes down to a functional issue that is consisted of the following requirements -

    1. Execute one big composite transaction, which calls smaller composite transactions.
    2. The smaller composite transactions perform some logic and execute (hopefully coarse-grained) core transactions.
    3. Send notifications on the smaller composite transactions.

    We tried to create internal (component) transactions, but we could not execute coarse-grained transactions from that level.
    If we would only call an instance of another Business Proxy, could we register a notification on that activity?

    We also consider performing all the small composites' logic within the TxnBean level (instead of the component level).
    Does that sound like a good idea?

    Thanks in advance
  • LenaW
    LenaW
    15 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2009-08-17T15:36:41Z  
    • Evyatar
    • ‏2009-08-13T09:36:59Z
    This all comes down to a functional issue that is consisted of the following requirements -

    1. Execute one big composite transaction, which calls smaller composite transactions.
    2. The smaller composite transactions perform some logic and execute (hopefully coarse-grained) core transactions.
    3. Send notifications on the smaller composite transactions.

    We tried to create internal (component) transactions, but we could not execute coarse-grained transactions from that level.
    If we would only call an instance of another Business Proxy, could we register a notification on that activity?

    We also consider performing all the small composites' logic within the TxnBean level (instead of the component level).
    Does that sound like a good idea?

    Thanks in advance
    You have several options:

    1. Introduce custom component level tx. MDM Server already have some component level transactions that are in fact "course-grained", for example, addParty. So feel free to introduce your own course-grained component level transactions if you know you will be reusing it from other controller or component level transactions. This does not work if you need to call controller level core transactions because you should not be calling Controller level tx from component. But if you can find equivalient course-grained component tx, then you are fine, as the case with addParty.

    2. Create custom controller level txs for your "smaller composite transactions" and string them together into "one big composite transaction" in proxy. Same problem if you can't find neccesary course-grained component tx.

    3. Create several proxies for "smaller composite transactions" and string them together into "one big composite transaction" in proxy by calling other proxies. Your smaller proxies can still issue notification but you would have to add the code to call notification framework. Your one big composite proxy would have to know the logical names of the proxy it will be calling and call its execute() method passing correct transaction object (ex.DWLTransactionPersistent). You can use DWLCommonProperties.getProperty("BusinessProxy.tcrm.mySmallerCompositeTransactionName") to get the class name of the proxy and then instantiate it using reflection.
  • Barnali9985
    Barnali9985
    19 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2012-02-27T11:55:00Z  
    Hi,
    I am trying to create a Custom Transaction through which I want to add my custom entity along with a person. For this I have created one Txn Transaction. I have created one transient data object which has a person and a custom entity in it. I have created one Txn Transaction and declared the transient data object as the request and response type of the txn transaction.

    Can anyone please suggest what is the difference between selecting the Implementation type as 'Business Proxy' or 'Component'?
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2012-02-28T12:36:18Z  
    Hi,
    I am trying to create a Custom Transaction through which I want to add my custom entity along with a person. For this I have created one Txn Transaction. I have created one transient data object which has a person and a custom entity in it. I have created one Txn Transaction and declared the transient data object as the request and response type of the txn transaction.

    Can anyone please suggest what is the difference between selecting the Implementation type as 'Business Proxy' or 'Component'?
    Hi,

    Component and Business Proxy are the two different coding patterns for implementing a custom transaction which are supported by the workbench. You can get similar function using either coding pattern. If you need to implement a composite transaction which calls an out-of-the-box transaction such as addPerson, you are best to use the Business Proxy implementation style. This allows you to call addPerson at the controller level.

    See the workbench user guide for more information: http://publib.boulder.ibm.com/infocenter/mdm/v10r0m0/topic/com.ibm.mdmhs.wb.tools.models.doc/c_creating_custom_transactions.html

    There is also a developerWorks article on writing custom query transactions, which explains some of the concepts: http://www.ibm.com/developerworks/data/tutorials/dm-1111customquerymdm/

    Hope that helps, Catherine.
  • Barnali9985
    Barnali9985
    19 Posts

    Re: MDM Txn vs. Business Proxy

    ‏2012-02-29T05:51:53Z  
    thnks:)