2017090621PM-Key Helper

Where to use key Resolver

 

Key Helper is nothing but a java expression which can be added as a custom property on attribute level or VO def level. At runtime we invokes this expression to resolve attributes with the provided inputs in this expression.

It can be used to resolve -
 

  •   Primary key attribute
  •   Parent Attribute
  •   Foreign key attribute
    • Lookup attribute

How to write a Key Helper Expression

 

Once we finalized the attribute which need to be resolve, we have to find out the dependency and the resolving VO for them.

Input required to write a key helper expression :-
 

1. Resolver VO or Resolver Helper Class Name

2. Bind attributes(dependent attributes)

3. Return attributes
 

There could be two type of VO we will use in expression writing
 

1. ResolvingVO is the VO for which we are resolving attributes. Like if we are resolving EmployeeId for EmployeeVO then EmployeeVO is a ResolvingVO.

2. ResolverVO is the VO from the VO we are resolving attribute. Like DeptId for EmployeeVO we are resolving DeptId from DepartmentVO so DepartmentVO is ResolverVO.
 

Here is the format to write a key helper expression :-
  

keyContextHelper.resolve("Resolver_VO_Name", "Resolving_VO_Bind_Attribute1:Resolver_VO_Bind_Attribute1;Resolving_VO_Bind_Attribute2:Resolver_VO_Bind_Attribute2;........", "Resolving_VO_Return_Attribute:Resolver_VO_Return_Attribute");

  
If we have more than one Bind attributes then we can add them using semi colon separated ( ; ) , Resolving and resolver bind attribute names can be separated with colon ( : ) .
  

Lets take an example of parent key (DeptId) of EmployeeVO -
  
Resolving attribute - DeptId

ResolvingVO - EmployeeVO

ResolverVO - DepartmentVO ("oracle.apps.hcm.common.core.publicModel.view.DepartmentVO")

Bind attributes - DeptName, LocationId

Return attribute - DeptmentId from DepartmentVO --> DeptId of EmployeeVO

  

keyContextHelper.resolve("oracle.apps.hcm.common.core.publicModel.view.DepartmentVO", "DeptName:DepartmentName;LocationId:LocationId", "DeptId:DepartmentId" );

Where to add Key Helper Expression

  

Steps to add a key helper expression :-
  

1. Go to attribute Def 

2. click on add custom properties

3. Select non-transient property

4 write Property --> KeyHelper , value -> (Expression) 
  
  

  

Property name must be KeyHelper, otherwise it will not be considered as a key helper expression property.

How Key Resolver works

  
Key resolver basically works in to two modes -

1. Forward :- To resolve Id's from the user provided attributes or user key attributes. (Import Case)
  
  
        
  

  •   DepartmentName and LocationId from Employee, will be provided as a input for Department.
  •   Query to get DepartmentId will be execute with the provided input value.
  •   DepartmentId from the query result will be passed to the Employee's DeptId.

2. Backward (Reverse) :- To resolve user key attributes form the Id's. (Export Case)

Same key expression used to resolve attributes in backward case.
  
  
        
  

  • DeptId from Employee will be provided as a input to execute a query.
  • Query will return DepartmentName and LocationId from Department.
  • DepartmentName and LocationId will be returned to Employee.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值