Sunday, February 22, 2015

View Link Consistency and Association Consistency

View Link Consistency and Association Consistency


View link consistency is a feature that allows view object instances with entity usages to immediately see rows based on new entity object instances as they get created.

For example, suppose you create a row using CreateEmployeeVO based on Enitity Object definition of Employees.This would create an instance of the entity object definition Employees. View link consistency will allow that employee to appear as a row in SearchEmployeeVO (a different view object instance) without a database post and requery.

For simple view object definitions with only one updatable entity, this happens automatically unless you make manual changes to your application module by setting jbo.viewlink.consistent=false configuration property at the AM level.

However, by default, view object definitions with multiple updatable entities do not have instances with view link consistency.This is because, if an instance of each entity usage is created, it may not be clear how many new view rows to base on them (one row with both, or two separate view rows, one with each).

However, in some cases, you are creating both entity object instances by creating a single view row appropriate to a particular view object instance. In that case, you can manually set view row consistency on the view object instance by passing a value of true ViewObjectImpl.setAssociationConsistent().

Example: ViewObjectImpl.setAssociationConsistent(true);



Saturday, February 14, 2015

ADF Dynamic Region issue faced in managed bean usage

ADF Dynamic Region issue faced in managed bean usage


Following is a generic issue which many of you may come across while trying to use a task flow as a Dynamic Region on a page.

These are the steps after which you can come across this issue may not be exactly as it is

1. In a task flow1 you register a Managed Bean with a name of your choice and the scope of the same is View Scope.

2. In a page in this specific task flow1 you want to use another taskflow,  for using the same you try dropping the task flow as a region and while dropping as a region you select Dynamic Region

3. When you drop as a Dynamic Region you need to provide the Managed Bean name which is already available or create a new Managed Bean as we already have a registered Managed Bean we will use the same.

4. Now for some reason we feel the region is not created properly so we go ahead and delete the region dropped on the page and again we try dropping the task flow as a Dynamic Region on the page.

5. Now when we try to choose the managed bean name our registered managed bean name is not available in the Managed Bean drop down list what happened.

6. Reason for non availability is because a dynamic region dropped on a page will create the following method and private variable as below

private String taskFlowId = "<task flow path>";

public TaskFlowId getDynamicTaskFlowId() {
        return TaskFlowId.parse(taskFlowId);
    }
7. During the prior dropping of the taskflow as a dynamic region has already created these methods in the managed bean class and hence currently when we try to drop the dynamic region again it shows only those managed bean names in the drop down which do not have the getDynamicTaskFlowId() method in the bean java class.

8. How to then show our managed bean in the drop down simply go to the managed bean java class and remove the variable and the method try dropping the task flow as dynamic region now and you will be able to see your expected managed bean in the drop down again.

Happy Coding in ADF