Set and Get Value from Taskflow parameter from Managed Bean- ADF

Sharing is Caring

Hello All
This post is about getting and setting value in taskFlow parameter using Java Code so for that we have created an application with the bounded task flow. Let’s see how to do this.

We have bounded task flow having Input Parameter defined in it named GLBL_PARAM_TEST

Taskflow parameter

and we have to set its value from the managed bean.
this is very simple -see how to do that

    • Get pageFlowScope Map and put parameter ‘s value in it

        Map paramMap = RequestContext.getCurrentInstance().getPageFlowScope();
        paramMap.put("GLBL_PARAM_TEST", "Ashish"); 

 

    • And get Value from taskFlow parameter in the managed bean

    public String resolvEl(String data){
               FacesContext fc = FacesContext.getCurrentInstance();
               Application app = fc.getApplication();
               ExpressionFactory elFactory = app.getExpressionFactory();
               ELContext elContext = fc.getELContext();
               ValueExpression valueExp = elFactory.createValueExpression(elContext, data, Object.class);
               String Message=valueExp.getValue(elContext).toString();
               return Message;
             }
String param=resolvEl("#{pageFlowScope.GLBL_PARAM_TEST}");

Cheers 🙂 Happy Learning

Related Posts

An Oracle ACE, Blogger, Reviewer, Technical Lead working on Oracle ADF

0 thoughts on “Set and Get Value from Taskflow parameter from Managed Bean- ADF”

Leave a Reply

Your email address will not be published. Required fields are marked *