How to access BPM 11g payload or process varibles in ADF task flow
I am trying to view/edit data in a UI tied to a database using a foreign key, requestId. The foreign key comes from a BPM process where it is passed into the task flow, from a human task. The foreign key comes from process variables or payload values. I know I can simply load the payload in BPM with data from the tables, but I'm looking for a better solution to leverage ADF Business components to view and edit the data directly in the UI.
The BPM process uses a web service to kick off the process. The web services takes a primary key as a parameter to reference a column in the database table. The database is pre-populated with content and a primary key reference. The first activity is a user activity. I want the task flow behind the user activity to accept this primary key and use it to locate the desired row in the database so views associated with database bounded ADF Business Components can work to present the data in the UI.
I've tried two approaches to the problem. The first uses the operation setCurrentRowWithKeyValue. The other modifies the SQL where clause, used by the ADFbc Iterator, to only return a row for the given requestId. Both approaches fail to work because I don't know how to access the BPM payload or data variables coming into the task flow. Here's the snipet of code I used to try to set the row using setCurrentRowWithKey value:
public String setRequestId() {
FacesContext context = FacesContext.getCurrentInstance();
Object requestObj = context.getApplication().evaluateExpressionGet(
context, "#{bindings.RequestId.inputValue}", Number.class);
if (requestObj== null)
return null;
Number requestId;
requestId = (Number)requestObj;
DCIteratorBinding itr = (DCIteratorBinding)
getBindings().get ("PatfRequestHdrView1");
itr.setCurrentRowWithKeyValue(requestId.toString() );
return null;
I haven't gotten very far with the second approach, modified SQL where clause, since I don't know Groovy. I think I need something like:
adf.object.viewObj.RequestId. But there isn't a viewObject associated with BPM data, so I'm sure this particular expression won't work.
Any help you can give me is very appreciated.
Regards,
Mark
The first thing I want the task flow to do is display a page with a form showing the values from the database. This is why I tried to call the method first. If I add the setCurrentRowWithKey to the form as a button, I can get the form to load the data, but it's a two step process, requiring the user to click a button. The method approach throws the following exceptioin
oracle.adf.controller.activity.ActivityLogicException: ADFC-02013: The ADF Controller cannot find metadata for activity '/WEB-INF/ApproveTravel_TaskFlow.xml#ApproveTravel_TaskFlow@setTravelRecord'.
at oracle.adfinternal.controller.util.Utils.createAndLogActivityLogicException(Utils.java:230)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:927)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:777)
at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:551)
at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:147)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:109)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:78)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:475)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:756)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._invokeApplication(LifecycleImpl.java:698)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:285)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.share.http.ServletADFFilter.doFilter(ServletADFFilter.java:62)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:2
Similar Messages
-
Issue in passing payload from Human Workflow to ADF task flow
Hi All,l
I am facing one strange issue in Human Workflow -> ADF task form integration. I have 4 Data variables to pass to the task form for displaying and modifying the request payload. E.g
1. request
2. propertiesList
3. input1
4. input2
request and properties list variables are in the same namespace. When the process is executed, I can see the data being passed in Initiate taskflow activity in BPEL. However I don't see the data in ADF form only for propertiesList variable. This is a custom schema element I added newly in the project. I don't get any error , but no data is getting displayed.
Any help in this matter is greatly appreciated.
Thanks
AshwiniI have applied workaround for this. However the main issue still exist.
When I pass hard-coded values in the list and drag and drop that list as selectOneChoice - I see the values in dropdown. Whereas, when the list is passed from program logic and I can see the values passed in initiateTask activity, and drag and drop the field as selectOneChoice, the values don't come up.
I will replicate this issue in a smaller piece of code and paste here later.
Thanks
Ashwini -
How to separate BPM 11g from ADF
Hi all,
we are facing with a huge issue about how to separate BPM 11g ADF Task page components from SOA/BPM to a new non-soa ADF managed server.
We are ready to move on pre-production server from development enironment and the new environment has two different servers, one for Soa/Bpm and the second for a non-soa ADF server.
We have deployed all and it seems work fine but...when we call:
SecurityContext securityContext = ADFContext.getCurrent().getSecurityContext();
String username = securityContext.getUserName();
got: username = anonymous.
Tried with this also:
String userName = "";
//read name from security context
ADFContext adfCtx = ADFContext.getCurrent();
SecurityContext secCntx = adfCtx.getSecurityContext();
userName = secCntx.getUserName();
//read name from bpmWorklistContext context
FacesContext context = FacesContext.getCurrentInstance();
String ctx = (String)context.getApplication().evaluateExpressionGet(context, "#{pageFlowScope.bpmWorklistContext}", String.class);
IWorkflowServiceClient workflowSvcClient = ADFWorklistBeanUtil.getWorkflowServiceClient();
ITaskQueryService wfQueryService = workflowSvcClient.getTaskQueryService();
IWorkflowContext wfContext;
try {
wfContext = wfQueryService.getWorkflowContext(ctx);
userName = wfContext.getUser();
logger.info("UserName from Oracle:" + userName);
} catch (WorkflowException e) {
logger.info(e.getMessage());
e.printStackTrace();
return userName;
And received this error:
"Oracle | Invalid Token Error in Verification Service.
Invalid Token Error in Verification Service. Received invalid token in .
Verify that correct token is passed."
I have followed this blogs but no luck:
Onkar's SOA, BPM and ADF Blog: How to separate BPM 11g ADF Task page components from SOA/BPM to a new ADF managed server
http://blog.dreamix.eu/oracle-2/ultimate-guide-separating-bpm-adf
Notes about Oracle: How to configure local integrated WebLogic non-SOA domain to access BPM worklist on separate SOA-ena…
I do not understand where the error is. Why the SecurityContext is getting lost.
Can you help me? Any suggestions will be welcome.
Thanks.
FairlieOk, these are the lines of code you can use to create a method that returns the authenticated user name:
try {
IWorkflowServiceClient wfSvcClient;
ITaskQueryService queryService;
IWorkflowContext wfContext;
// Get username of User Login
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
wfSvcClient = WorkflowService.getWorkflowServiceClient();
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
} catch (Exception e) {
e.printStackTrace();
And you can add it to the backing bean of your page (a Java Class that you can declare to handle ADF Page components). Let me know if this helps.
Jorge -
How to deploy a new ADF task flow in OIM 11g R2
Hi,
I have created a new ADF task flow.
Now I need to deploy the same in OIM 11g R2, so that when I click on a link it will call my new ADF task flow.
Please help me in identifying the steps required to deploy the adf task flow.
ThanksHi Durga,
Thanks for sharing the post. I think I am facing the same issue which you were facing.
I have already done these steps but still not able to get my custom page on click of a link which I created in OIM self service page :
1. I have created the adflibHomepagePortletsUI.jar as an adf library using Jdeveloper and copied it to oracle.iam.ui.custom-dev-starter-pack.war --> WEB-INF/lib folder after unpacking it.
2. have updated the custom-catalog.xml file inside oracle/adf/rc/metadata folder with the below lines :
<folder name="Sample Folder" id="sampleFolder">
<contents>
<resource id="helloWorld" name="Hello World"
description="Hello World Taskflow Reference"
repository="application.classpath"
path="adflibHomepagePortletsUI.jar/ADF_TaskFlow/WEB-INF+oracle+iam+ui+sample+homepage+tfs+hello-world-tf.xml#hello-world-tf">
<attributes>
<attribute value="coreDefault" attributeId="attr.background" isKey="false"/>
</attributes>
</resource>
</contents>
</folder>
3. repacked the war file and copied it in OIM_HOME/server/apps directory
4. Restarted the OIM server.
5. entered the following lines in jazn-data.xml present in user_projects\domains\idmdomain\servers\oim_server1\tmp\_WL_user\oracle.iam.console.identity.self-service.ear_V2.0\6bddg\META-INF\jazn-data.xml
<permission>
<class>oracle.adf.controller.security.TaskFlowPermission</class>
<name>/WEB-INF/oracle/iam/ui/sample/homepage/tfs/hello-world-tf.xml#hello-world-tf</name>
<actions>view</actions>
</permission>
5. Login to self service console.
6. Click on the custom link who's actionListener is pointing to bean which is launching the taskflow created in the above steps.
7. On Click of the link a new tab gets open with blank page.
Please help me in knowing the step which I am missing in order to solve this issue.
Many thanks once again. -
11g TP2 ADF Task Flows and Transaction Management
I'm wondering how ADF Task Flow Transaction Management works vis-a-vis database sessions and using stored procedure calls in an environment with connection pooling. I haven't written the code yet but am looking for a better understanding of how it works before I try.
Example:
I create a bounded adf task flow. I set the "transaction" property to "new-transaction" and the "data control scope" to "isolated".
As the task flow is running, the user clicks buttons that navigate from page to page in the flow. Each button click posts the page back to the app server. On the app server a backing bean method in each page calls a stored procedure in a database package to modify some values in one or more tables in the database. The procedure does not commit these changes.
Each time a backing bean makes a stored procedure call will it be in the same database session? Or will connection pooling possibly return a different database connection and therefore a different database session?
If the transaction management feature of the adf task flows guarantees me that I will always be in the same database session then I don't have to write any extra code to make this work. Will it do that or not?I don't know if it is documented in the adf documentation currently available for 11g TP2 but what you ask for is a normal transaction management with connection pooling and i can't imagine it is not implemented in ADF BC layer like it is in JPA or other persistence layer.
A transaction will always be executed in the same session. Normally your web session will stay in the same session even you start more than one transaction. You don't have to write any code to manage the session pooling. It is a good practices to customize it at the persistence layer during installation depending on your infrastructure.
Take a look into Fusion Developer Guide ... i'm sure you will find some better explanations about this. -
Do some processing before loading jsf fragment created using adf task flow
Hi,
I am working on JDev11g.
I want to create SelectItems of SelectOneChoice dynamically before loading jsf fragment created using adf task flow
I tried by implementing RegionController class's method RefreshRegion in my backing bean of jsf page fragement to do some processing before loading region
But it seems to be not feasible approach because it is getting called every time any component on fragement gets partially submitted.
Is there any method which is called only first time when region is loaded ?
Or any other solution to achieve this.
Regards,
DevangHi,
don't think so. You would need a phase listener, but I don't see how you get it in. Wha about using a dynamic region and then use the method that is called from the dynamic region first time it is rendered?
Frank -
Create Custom ADF Task Flow for BPM
Hi,
I'm working an project on BPM and I'm required to create a custom ADF task flow with multiple views based on the human tasks in BPM. Since I'm new to ADF, could some one please give me some pointers?
Thanks,
DebojitHi,
You have to implement your own custom worklist screens for such a subject. As you know the OOTB worklist screen shows the logged-in users' assigned, etc. tasks. You have to implement the API of SOA workflow.
You can check Mark Nelson's blogs on Redstack to accomplish this. Hope this is the answer of the problem you are looking for. -
How to call an adf task flow in a commandNavigation tab
Hi,
I have created an adf task flow, I am able to invoke the same on click of a link.
Now I have a tab and some sub tabs under it. I want to open this adf task flow on click of one of these sub tabs.
For this I have added a property of type CommandNavigationItem in parallel with exising subtabs and on the actionListener of this property I am calling the method of the adf task flow.
But it is not working. When I click on the sub tab created by me I get this error on the logs :
ADF_FACES-60096:Server Exception during PPR, #1[[javax.servlet.ServletException
Please help/guide how to solve this issue.Hi,
do you use the XML Menu Model? If so then the task flow must be referenced from a navigaqtion case in the unbounded task flow you turn into the menu model
Frank -
How to get the logged in userId value in adf task flow OIM11g R2
Hi,
I have created an adf task flow. Now I want to run some query in that based on the logged in userId.
Could you please help me in knowing how to get the logged in userID value in adf TaskFlow so that I can run a parameterized query.
Thanks3 different ways to retrieve the username (not sure what you mean by user ID) :
http://mahmoudoracle.blogspot.be/2012/06/adf-get-current-logged-user-name.html#.USI_c-h8zIo
Also provide your JDev version.
Basicly, you should use the groovy expression in a view criteria (it's the fastest and easiest way) and call that view criteria whenever you need it.
That's if you are using ADF BC of course. -
BPM 11g changes to process aren't getting deployed
I'm having trouble seeing changes I make to the process model in BPM 11g. For instance, if I add a new activity or change data associations/mapping in the activity and re-deploy, it doesn't take effect.
I've tried doing a clean all, make all, and undeploy all project artifacts (undeploy project composite from soa-server and undeploy UI ear file) before deploying. I don't see the changes unless I restart the soa-server.
Any suggestions? Is this a bug?
Thanks
MarkThere's definitely some issues with deploying changes. We've found that if there are BPEL processes in you BPM process and you make changes, you'll need to bounce the SOA server too, to see the changes. Also, some people are experiencing instability issues when you keep increasing the version number. You get to about 4 or 5 versions, and it stops locks up the SOA server. I've found un-deploying and then do a fresh deploy seems to be the best way to make changes for now. I believe engineering is aware of this problem and is working on fixing it.
-
How to access ouput of one async process in another async process
Hi
I have two asynchronous processes.In the second process i would get all the data of a particular purchase order. how do i need to access this information in first process. when i do an invoke acitivity it's not generating any o/p variable .pls help me out on this
thanks
raviYou need to put a "Receive" activity where you want to receive you asynchronous answer and link it to your partner link. Then you'll be able to create an output variable.
Have fun! -
How to customize bpm 11g workspace?
hello,
is it possible to customize new BPM 11g workspace in similar way like 10.3 workspace http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/workspace_customization/index.html ?
thanks.Thanks Sudipto!!
From this i am able to get the Audit trail image, but I am getting this image as a default given by the BPM engine with their color code. In my requirement, I want to change the color code & labels of the task in the image.
Do you have any idea on this?
Thanks in Advance -
Accessing Human Task Payload from ADF Task Flow
Hi
Using jDeveloper 11g TP4 SOA...
The scenario is this:
1. We have created a Human Task which has parameters accountId and accountType in the payload.
2. We have then created a Task Flow based on that human task.
3. Inside the web folder with task flow we have *4 task display forms* (jspx pages).
4. In the task flow we have the 4 pages and then a router
5. Now we want the router to look in the payload of the human task and based on the accountType redirect to the correct task display form.
Problem: We can't access the human task data control from the router in the task flow.
Does anyone have some insigt into how we can read the accountType from the payload and then pick the correct task display form?Hi victor,
i'm using a SOA(OSB) based task service, but i think that you have to use a "task service" (or something like this) to update your task
this is my routine
public Task updateTask(Task task) throws Exception {
TaskServiceContextTaskBaseType taskUpd =
new TaskServiceContextTaskBaseType();
taskUpd.setWorkflowContext(getWorkFlowContext());
taskUpd.setTask(task);
return taskService.updateTask(taskUpd);
where taskService is the port of my proxy.
Hope this help -
BPM 11g integration with External UI or ADF UI
Hi ,
Can any one throw some idea how to integrate BPM Human Task(User task component) with already existing ADF UI.
I've a Approval Human Task . And my ADF team has developed the UI project. I need to integrate both BPM and ADF UI.
Can any one give an idea on this...
Regards,
PavanHi Experts,
I have solved this issue..
For example if we want to integrate the ADF UI and BPM. Just run the Login.jspx and used that url and add the URI in EM console in Component metrics of Human task.
Regards,
Pavan -
How can i assign view page name at run time in task flow
Hi,
jdev 11.1.2.3.0
I have a requirement to get view page (jsff page) dynamically.
Ex: I have TF in that i have two views i.e view1 and view2. in view1 there is one inputtext and button in inputtext i will give the name of the page, In view2 that particular page should be displayed.
Input Text View2
Employee Employee Page
Department Department Page
How can i implement this ?
Thanks,
NiteshUse a router in your task flow and point to the page you want to display according to the value entered in the input text.
A sample on how to use this technique can be found here http://tompeez.wordpress.com/2011/11/27/jdev-11-1-2-1-0-using-router-to-conditionally-set-navigation-target/
Timo
Maybe you are looking for
-
A better way to print text from within java ?
Hi, I want to make an app that brints out a bill (part of a bigger project for school) and I already know how to make my object printable and print it, but the "problem" lies in the graphics (or graphics2D) object that the print function uses to draw
-
Can i use an apple remote on my macbook air 11 inches?
can i use an apple rremote on my MBA 11 inch?
-
Wireless Router reset. Iphones will no longer connect to Wifi. Help?
My wife recently reset our wireless router and now both our iphones won't connect to the WIFI? As I look into Settings it looks like it's continuously trying to connect to our network. However it never connects......
-
It's the 5th gen iPod touch and each song has the cloud symbol next to it that I can tap to download from the cloud onto my iPod but I don't want to have to do that for over 1000 songs so how can I do this all at once? I've already tried syncing my i
-
No longer able to import CVI Instrument Driver in LabView 2010
Hello, I used to be able to download the Import CVI Instrument Driver Wizard in LabView 2009, but there is no wizard for 2010? I also tried importing the driver with the shared library import, but then Binary, Slides and Rings do not come up with t