Oracle Workflow also provide us a provision to launch Oracle form/s from a notification.It helps the performer to see the details that is stored in core HR without explicitly login into system from another session.
We are now quite familiar with oracle workflow and already developed some of simple workflows. Now we will discuss here how can we give the user a provision to open a form from notification itself.
Basic Requirement
Our old requirement looks like "when a person applies for a leave it should go his/her supervisor for approval.Approver must be able to provide his/her approval/rejection comments. The comments must be entered by the approver while rejecting the leave requisition.If he/she rejects the leave requisition without entering comments, then it should raise an application error.If he/she approves the requisition it should be optional.Approver must also be able to select the Organization Leave Type from a list of values . If the leave gets rejected, don’t store any information in database."
In addition to the above requirement:- The approver should able to view/edit the person "Special Information Types" before approving the leave request.
Design Appraoch
To implement the above requirement, we have to create a "Form Type" item attribute
1) Create a new item attribute of 'Form' type
Internal Name:- PERSON_SPECIAL_INFORMATION
Display Name:- Person Special Information
Type:- Form
Default Type:- Constant
Value:- PERWSPDC
The format of the default value should be:- <Function Name>:argument1="value1" ......
Function Name:- The internal name of the form function that open up the Special information while clicking on the form menu
argument1:- arguments required for form
Value1:- value for argument1.The value of argument can be a text string enclosed in quotes (" ") or can be token substituted with another item type attribute in where &item_attr represents the internal name of the item type attribute
<Function Name>:argument1="&item_attr".......
Example:- If we want to make special information type form as read only then it should be
PERWSPDC:QUERY_ONLY="YES"
2) Now copy this item attribute and paste it in message to make it a message attribute.Keep the message attribute source as Send.
3) Save the definition in database. Once we trigger the workflow notification will looks like as shown below
Note:- Once we click on the hyper link available in the notification it will open up the forms that shows the list of valid responsibility attached with the person. The person needs to select the proper responsibility to open up the desired form otherwise it will throw an error.
Once we select the desired responsibility the SIT form will open up and if we query for a person, it will open up the details in editable mode.
Note:-
1) As we discussed earlier,form will open list of valid responsibility present with the user. If we select wrong responsibility that doesn't contain SIT form, then it will through an error.
2) If we want to open up our form in "view only" mode then we have to define the default value as mentioned below
PERWSPDC:QUERY_ONLY="YES"
(format:- <Function Name>:argument1="Value1".......)
Here Function Name:- PERWSPDC
Argument1 :- QUERY_ONLY
Value1 :- YES
3) By default, when a user chooses an attached form link in a notification, Oracle Applications displays a list of responsibilities assigned to that user . The user can then select the responsibility with which he or she wants to navigate to the form.we can optionally specify the responsibility through which we want users to access that form. In this case, users do not need to select a responsibility when they choose the attached form link; instead, they can navigate directly to the form. However, we must ensure that the users who receive the notification have the specified responsibility assigned to them.
To specify a responsibility in the form attribute, append two special arguments in the argument string for the form function.
• #RESP_KEY - The responsibility key
• #APP_SHORT_NAME - The application short name for the responsibility
The value for each of these arguments can be a text string enclosed in quotes (" ") or can be token substituted with another item type attribute.
Now save the definition and trigger the custom workflow. The notification will contain a link that will open a form in View mode from a specific responsibility (here it is US HRMS SUPER Manager).
4) It is very obvious that different person will have different responsibility depending on their role in organization.So, It is very much required to make the #RESP_KEY and #APP_SHORT_NAME argument value dynamic.
The default value should be
PERWSPDC: QUERY_ONLY="&QUERY_ONLY" #RESP_KEY="&RESP_KEY" #APP_SHORT_NAME="&RESP_APL"
(Format:- Function_Name:Argumnt1="&<Internal name of item attribute>"..................)
Here QUERY_ONLY,RESP_KEY,RESP_APL are three newly created item attribute.
Remember:- Copy all the item attribute and paste it in message to make a message attribute along with the form attribute
Since we have used three attribute in the default value of Form attribute, so we need to set the value for those attribute. We can set it while triggering workflow.
Note:-'Send' and 'Respond' message attributes of type Form appear only when your Worklist Web pages are
launched from Oracle Applications. The attached form icon is enabled if a notification message includes
a 'Send' message attribute of type Form. The notification recipient can click on the attached form icon to
drill down to the form function defined by the message attribute.
Hence Form attribute can only appear when notification is accessed through web page not from Email.
References
1) https://metalink.oracle.com
2)Oracle Workflow Developer's Guide ( Release 12) B31433-04