Topic
  • 10 replies
  • Latest Post - ‏2014-08-13T07:27:58Z by akesa123
SystemAdmin
SystemAdmin
938 Posts

Pinned topic Behaviour Extension

‏2011-04-20T09:15:24Z |
Hi,
I had a scenario where a Contract already exist in my database and wish to add a new contract component which is related to this contract, provided it satisfy a few business rules. The detailed scenario is as follows

1. I have an extension for contract. Say the extended field name is 'privilege number' and the extended object is XContractBobjExt
2. The user has the ability to add multiple contract components related to the above XContractBobjExt.
3. The only field from XContractBobjExt which is used to relate the contract to contract component is 'privilege number'

Now my problem is as follows
1. The input will have privilege number(from XcontractBobjExt) and other fields from ContractComponent
2. Before adding the ContractComponent, we need to check certain business rules.
3. So we have decided to provide a behavior extension for addContractComponet (at component level –Pre action)(say AddContractComponetExtBehv).
because we need these rules to be executed only when an attempt to add contract component is made.
4)From AddContractComponetExtBehv I will check the business rules .
How can I access the extended attribute (privilege number) in XContractBobjExt inside AddContractComponetExtBehv since a behavior extension of contact component takes only TCRMContractComponentBObj and its extensions?.

Appreciate any help!.

Thanks in advance.

Regards
Nikkie
Updated on 2012-04-23T13:58:40Z at 2012-04-23T13:58:40Z by SystemAdmin
  • prashanta.nc
    prashanta.nc
    99 Posts

    Re: Behaviour Extension

    ‏2011-04-20T14:59:26Z  
    If the XContractBObj is not available in the behavior extension of the ContractComponent, I would probably do an inquiry transaction to get it. Since you know which contract this component is getting attached to, you will have all the information you need to run get transaction isn't it ?

    • PC
  • prashanta.nc
    prashanta.nc
    99 Posts

    Re: Behaviour Extension

    ‏2011-04-20T15:10:36Z  
    If the XContractBObj is not available in the behavior extension of the ContractComponent, I would probably do an inquiry transaction to get it. Since you know which contract this component is getting attached to, you will have all the information you need to run get transaction isn't it ?

    • PC
    Also, since you are at component level, Try getting an handle to contract_component and invoke getContract method in TCRMContractComponent class.

    Be cautious with inquiry levels :)

    -PC
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Behaviour Extension

    ‏2011-04-21T04:51:55Z  
    Also, since you are at component level, Try getting an handle to contract_component and invoke getContract method in TCRMContractComponent class.

    Be cautious with inquiry levels :)

    -PC
    Hi Prashanta,
    Thanks for the response.I think I confused you a little by stating
    "1. The input will have privilege number(from XContractBobjExt) and other fields from ContractComponent".

    I wish to have the privilege number(from XContractBobjExt) in my behavior extension class of ContractComponent so that I can use an inquiry transaction as you suggested.

    The steps I wish to follow are
    a)I need some way to pass the privilege number to the behavior extension class(for ContractComponent -AddContractComponetExtBehv).
    b)Using the privilege number I can get the contract_id.
    c)Using the contract_id I can set it to the TCRMContractComponent object and perform the addContractComponent.

    I am looking for a solution to step a :)

    Appreciate any help!.

    Regards
    Nikkie
  • Barnali9985
    Barnali9985
    19 Posts

    Re: Behaviour Extension

    ‏2012-02-27T12:19:59Z  
    What is the difference between Action Event and Transaction Event?
    What is the difference between Action Category Event and Transaction Category Event?
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Behaviour Extension

    ‏2012-02-28T12:29:33Z  
    What is the difference between Action Event and Transaction Event?
    What is the difference between Action Category Event and Transaction Category Event?
    Hi,

    Action Event and Transaction Event both associate the behavior extension with a specific transaction. Transaction Event will trigger the behavior extension when the transaction is called externally or from a business proxy. Action Event will trigger the behavior extension when the transaction is called internally. For example, if you define a behavior extension with an Action Event associated with addAddress, that will be called whenever an address is added to the system, whether the addAddress is called directly or by another transaction like addPerson.

    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_creatingbehaviorextensions.html

    Hope that helps, Catherine.
  • Barnali9985
    Barnali9985
    19 Posts

    Re: Behaviour Extension

    ‏2012-04-16T10:46:13Z  
    Hi,

    Action Event and Transaction Event both associate the behavior extension with a specific transaction. Transaction Event will trigger the behavior extension when the transaction is called externally or from a business proxy. Action Event will trigger the behavior extension when the transaction is called internally. For example, if you define a behavior extension with an Action Event associated with addAddress, that will be called whenever an address is added to the system, whether the addAddress is called directly or by another transaction like addPerson.

    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_creatingbehaviorextensions.html

    Hope that helps, Catherine.
    I am trying to create one behaviour extension on MatchParties transaction on Post Action Event. But when I am executing the matchParties transaction the behaviour extension is not getting executed. I have executed all the DMLs that have been generated by the workbench. Please let me know what are the probable causes.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Behaviour Extension

    ‏2012-04-16T11:29:18Z  
    I am trying to create one behaviour extension on MatchParties transaction on Post Action Event. But when I am executing the matchParties transaction the behaviour extension is not getting executed. I have executed all the DMLs that have been generated by the workbench. Please let me know what are the probable causes.
    Hi,

    I think matchParties is a transaction that does not have an associated internal action - so a behavior extension registered as a transaction event should work, but action event won't.

    Hope that helps, Catherine.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Behaviour Extension

    ‏2012-04-23T10:17:59Z  
    Hi,

    Action Event and Transaction Event both associate the behavior extension with a specific transaction. Transaction Event will trigger the behavior extension when the transaction is called externally or from a business proxy. Action Event will trigger the behavior extension when the transaction is called internally. For example, if you define a behavior extension with an Action Event associated with addAddress, that will be called whenever an address is added to the system, whether the addAddress is called directly or by another transaction like addPerson.

    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_creatingbehaviorextensions.html

    Hope that helps, Catherine.
    Hi Catherine,

    I am still not clear what exactly creating behavior extension @ Controller(Transaction) & Component(Action) level.Please correct me if below my undestanding is wrong.

    My understanding is that

    1. Controller level menas creating behavior ext. at corse-grained transaction level(for example, like, updatePerson)

    2.Component level menas creating behavior ext. at fine-grained transaction level(for example, like, updateAddress)

    And the link you have provided in your post is not accessible for me for some reason. Could you please point me to any good resource like tech paper on behavior extension.

    Thanks in Advance :)

    Thanks
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Behaviour Extension

    ‏2012-04-23T13:58:40Z  
    Hi Catherine,

    I am still not clear what exactly creating behavior extension @ Controller(Transaction) & Component(Action) level.Please correct me if below my undestanding is wrong.

    My understanding is that

    1. Controller level menas creating behavior ext. at corse-grained transaction level(for example, like, updatePerson)

    2.Component level menas creating behavior ext. at fine-grained transaction level(for example, like, updateAddress)

    And the link you have provided in your post is not accessible for me for some reason. Could you please point me to any good resource like tech paper on behavior extension.

    Thanks in Advance :)

    Thanks
    Hi,

    All the transactions described in the transaction reference guide are controller level transactions - you can call them from outside MDM through a web service or by sending an XML request over RMI.

    Each of those controller-level transactions then calls one or more internal, component-level transactions (actions) to actually do its work. So a coarse grained transaction like addPerson will call component-level transactions like addPerson, addPersonName, addAddress...

    If you call a transaction like updateAddress, there are still the two levels of implementation - updateAddress at the controller level calls updateAddress at the component level.

    However, some controller-level transactions don't have a matching component-level transaction (and the other way round). You also need to be aware that addPerson at the controller level doesn't do the same thing as addPerson at the component level.

    There is a developerWorks article on behavior extensions here: http://www.ibm.com/developerworks/data/tutorials/dm-0910infospheremasterdata/

    Hope that helps, Catherine.
  • akesa123
    akesa123
    2 Posts

    Re: Behaviour Extension

    ‏2014-08-13T07:27:58Z  

    Which behaviour extension gets executed first? Post component behaviour extension or post transaction behaviour extension?

    My understanding is that post component behaviour extension gets executed first. Is that correct?