ADF 12cR2: Using WebSockets for warning Task Flow Concurrency
Hi all,
I started to upload ADF 12cR2 POCs in my GITHub Repository with samples I develop for my current clients for technical feasibility.
https://github.com/DanielMerchan/adf
The first project is WebSocketConcurrentTaskFlowEdit.
Basically, it uses CDI Managed Bean + Jakarta EE WebSockets for communicating users which are concurrently editing the same information in an ADF Page / ADF Bounded Task Flow.
The components are the following:
Have a look into the code and execute test.jsf. Login in one browser with user A and another browser with user B.
You will see the warning ;).
Happy learning!. Follow your dreams.
I started to upload ADF 12cR2 POCs in my GITHub Repository with samples I develop for my current clients for technical feasibility.
https://github.com/DanielMerchan/adf
The first project is WebSocketConcurrentTaskFlowEdit.
Basically, it uses CDI Managed Bean + Jakarta EE WebSockets for communicating users which are concurrently editing the same information in an ADF Page / ADF Bounded Task Flow.
The components are the following:
- TaskFlowWebSocketServer.java: Contains the WebSocket Server Side Logic.
- TaskFlowSessionHandler.java: It is a CDI Bean injected in our TaskFlowWebSocketServer.java for decoupling the logic and handling the mapping between Socket Sessions with Task Flows.
- TaskFlowWebSocket.js: It is the WebSocket Client written in JavaScript which is the responsible of opening the Socket Connection and manage the messages received (in JSON Format) from the TaskFlowWebSocketServer.java
- SocketHandler.java: Is an ADF Managed Bean used by TaskFlowWebSocket.js for sending a message to the backend to produce a JSF Faces Message based on the message received in the socket. This component is optional as also we can intercept the message and use directly JS to show the notification using ADF Components or just plain HTML/CSS non-obstructive popup.
- test.jsf: It is the test page which initializes the WebSocket connection when pageLoad by passing the userId and the TaskFlowId from the binding layer.
- Fake-tf.xml: It is just a mock Task Flow for demo purposes.
Have a look into the code and execute test.jsf. Login in one browser with user A and another browser with user B.
You will see the warning ;).
Happy learning!. Follow your dreams.
Comments
Post a Comment