Monday 27 May 2013

what are Task Flow Activities and Control Flows?

Method Call:Invokes a method, typically a method on a managed bean. A method call activity can be placed anywhere within an application's control flow to invoke application logic based on control flow rules.

Parent Action:Allows a bounded task flow to generate outcomes that are passed to its parent view activity.

Router:Evaluates an EL expression and returns an outcome based on the value of the expression. For example, a router in a credit check task flow might evaluate the return value from a previous method call and generate success, failure, or retry outcomes based on various cases. These outcomes can then be used to route control to other activities in the task flow.

Wednesday 22 May 2013

How to pass parameters between taskflows?

Here is the sample Taskflow design and we need to pass parameters from Caller TF to Callee TF.
Go to the definition of Callee TF and goto Parameters tab and define the Input Parameter Definitions.
Now go to the taskflow design and click on the Callee TF and go to the properties tab. In the 'Parameters' section you will see the parameters that you defined earlier. Here you should fill in the values that you want to pass.

On the event of which the Callee TF is called, you should set the values in the pageFlowScope.param1 and param2.
<af:commandToolbarButton id="ctbCreate" action="dialog:showWizard" >
<af:setPropertyListener from="0"
to="#{pageFlowScope.dpDimensionId}"
type="action" />
<af:setPropertyListener from="0"
to="#{pageFlowScope.decisionPackageId}"
type="action" />
</af:commandToolbarButton >

Now you would be able to get the values of param1 and param2 as 0 in the callee TF.

Tuesday 14 May 2013

Use Checkbox For Selecting Multiple Rows From af:table

One of the feature which existed in JDeveloper 10g but not found in JDeveloper 11g is using checkbox for selecting multiple rows from af:table.
This is my workaround for achieving this feature in JDeveloper 11g. Follow this steps:


1- Make a new ADF fusion web Application.
2- choose your database connection. (assume we are using HR Schema).
3- Make one viewObject based on entity (assume Employees viewObject based on Employees Entity).
4- Open your Employees ViewObject and make a new transient attribute with type boolean and make it always updatable (assume the transient Attribute name is 'TransientAttr').


5- Make a new page and drag your employee view as a table and don't check on Row Selection checkbox.

6- In your Structure Palette goto your inputText Transient attribute and right click and choose Convert to.

7- From opening dialog choose Select Boolean Checkbox --->ok-->ok


8- Make the selectBooleanCheckbox component AutoSubmit with true and put its Id in the table partialTrigger and clear its lable and text.


9-
Select all columns and goto Style Property and inlineStyle write
this #{(row.TransientAttr)?"background-color: #ffaaaa":""};
where #ffaaaaa is the color of the selected row (you can change this color as you want).

10-Now any row has its transient Attribute with true value, this row will be selected row.

Sunday 5 May 2013

Custom SkipValidation in a fragment pageDef

Test 1 : 

-
SkipValidation=false in a fragment pagedef :
Entity level validations are executed.
All datacontrols validations of a page are executed.
And we see the other tabs validations errors. It is not the desirable behaviour for us.

Test 2:

- SkipValidation=true in a fragment pagedef :
Entity level validations are not executed when we change row ...
Validations of datacontrols are executed at the commit.
The other datacontrols validations are not executed.
Unfortunately, it is not the desirable behaviour for us because we need a validation when we change row ... entity level validation.

Test 3 :

- SkipValidation=skipDatacontrol in a fragment pagedef :
The same behaviour like test 2.
Why Entity levels validations are executed at the commit, not when we change a row. Is that normal?
The documentation said that with this value of skipValidation, the framework will execute validation
rules defined at attribute level or at entity object level for rows which are modified in the current transaction.
We dont understand the difference between SkipValidation=true and SkipValidation=skipDatacontrol


Test 4 : 

- SkipValidation=custom in a fragment pagedef : 


The custom validator in configured like managedBean in the adfc-config.xml with request Scope
The custom validator is not executed, but te behaivour is like test 2 (skipvalidator=true)

Test 5 :

- SkipValidation=custom in a main page PageDefs :

The custom validator is executed, but te behaivour is like test 2 (skipvalidator=true)
In these case we try to set the property SkipValidation of the pageDefs of tabs, but is not working.



public void validateBindingContainer(BindingContainer bindingContainer) {


DynTabManager tabMng = (DynTabManager)JSFUtil.resolveExpression("#{viewScope.dynTabManager}");

String selectedTabId = tabMng.getSelectedTabId();

for (DynTab tab : tabMng.getTabList()) { 

String tabPageDef = (String)tab.getParameters().get("pi_bindings");

DCBindingContainer binding = (DCBindingContainer) JSFUtil.resolveExpression("#{data."tabPageDef"}");


if (tab.getId().equals(selectedTabId)) {
// Normal validation in current TAB
binding.setSkipValidation(false);
} else {
//avoid validation other tabs
binding.setSkipValidation(true);
}
}
return;
}

difference between beanscope and pageflow scope?


It all depends on the kind of functionality that you have implemented in the backing bean. For example, if you want certain backing bean variables to persist from one request to another, then requestScope won't do - the backing bean will be created/destroyed for each user request. As you probably know, the scope determines the lifecycle of the bean, i.e. when the bean is created and when it is destroyed.

Now, backingBeanScope is used exclusively for page fragments (regions).

In our project we are using pageFlowScope. In this case, the backing bean persists for the duration of the page (i.e. mulitple requests for the same page).