Shown below is one way to achieve this kind of use case .
- Have a method in AMImpl which returns parameter , here Map is returned .
- Drag and drop the AM method on task flow , which creates binding in DataBinding.cpx
DataBinding.cpx will have a page map and page definition usages
<page path="/Sample-TF.xml#Sample-TF@employeeAMMethod" usageId="view_Sample_TF_Sample_TF_employeeAMMethodPageDef"/>
<page id="view_Sample_TF_Sample_TF_employeeAMMethodPageDef"
path="view.pageDefs.Sample_TF_Sample_TF_employeeAMMethodPageDef"/>
Now implement a bean method activity on task flow , below i have execute AMImpl method ,result is returned and setting to bean variable which i will be showing as output text in fragment.
//Get the current binding context
BindingContext binding = BindingContext.getCurrent();
//Find our binding container by name (page id in the DataBindings.cpx)
DCBindingContainer dcBinding =
binding.findBindingContainer("view_Sample_TF_Sample_TF_employeeAMMethodPageDef");
//Execute the method
OperationBinding operation = dcBinding.getOperationBinding("employeeAMMethod");
operation.execute();
Output on fragment
Happy Learning !!!
No comments:
Post a Comment