In oracle BPM applying different codes or methods to the buttons is not straight forward as in some other applications. Different logics can be applied in the jsp (for which I will give a complete tutorial in a few days). For now for easy understanding I am using the presentations from the studio to apply logic and decisions to the buttons code, it can also be used for form validations and requirements fulfillment, easy to understand for people with web development background.
I have seen the Oracle tutorials about buttons and they have made a mess of it. Its really simple.
Now if you look at the following project:
The workflow shows that when the product detail is entered by the Initiator. It goes the Head of Department (HoD) for approval. The HoD can simply approve and reject it based on the content. By default there are two buttons present in the presentation called submit and Cancel. We can remove them and add our own or edit them to function as we want them to.
First of all we need to make a new method in project-> Catalog -> Module -> right click your object -> New -> Method. Name your method like "submitApproval". In the method enter your logic as
//Any Logic
Save it.
Following is the Approval Issuance form available to the HoD:
Please take not that Approve button is selected, you can see in the properties on the right that the Action is selected as action and Method Invoked is submitApproval() as defined earlier. Now this presentation is given to the Approve form interactive component call inside the screen-flow of the Approval activity.
As shown in the figure above. Now add the logic of result="Approvesubmit" in the conditional transition and logics are entered going out of the screenflow. In the automatic activities we can define logics about different actions as per our project. I have made simple attribute that says approval=true.
Whenever a submit button is clicked the value inside the submit("") method is assigned to the result variable. Result is a predefined variable of type string. For example if submit("me") is given in method. The result variable is result="me".
In the screenshot below we can see a new conditional transition from Approve activity to Fill product detail activity. In the case of Rejection this flow is followed. In the condition its simply written approval !=true.
I have seen the Oracle tutorials about buttons and they have made a mess of it. Its really simple.
Now if you look at the following project:
Workflow |
First of all we need to make a new method in project-> Catalog -> Module -> right click your object -> New -> Method. Name your method like "submitApproval". In the method enter your logic as
//Any Logic
submit("Approvesubmit");
Save it.
Following is the Approval Issuance form available to the HoD:
Approve Reject buttons |
Approval screenflow |
As shown in the figure above. Now add the logic of result="Approvesubmit" in the conditional transition and logics are entered going out of the screenflow. In the automatic activities we can define logics about different actions as per our project. I have made simple attribute that says approval=true.
Whenever a submit button is clicked the value inside the submit("") method is assigned to the result variable. Result is a predefined variable of type string. For example if submit("me") is given in method. The result variable is result="me".
In the screenshot below we can see a new conditional transition from Approve activity to Fill product detail activity. In the case of Rejection this flow is followed. In the condition its simply written approval !=true.
Modified Screenflow |
Please leave a comment for every question, query and suggestion |
Great :)
ReplyDeleteThanks Waris
ReplyDelete