We have already build a simple custom workflow. Now we will make our previous workflow more n more complex.
Basic Requirement
Our initial requirement was "when a person applies for a leave, it should go his/her supervisor for approval and once it is approved save the information in database . If the leave gets rejected, don’t store any information in database."
Now we will change our requirement a bit. It is as mentioned below
"when a person applies for a leave it should go his/her supervisor for approval. Approver must be able to provide his/her comments for approval or rejection of the requisition(currently keep it as optional).Once it is approved save the information in database . If the leave gets rejected, don’t store any information in database."
(Change requirement is in bold)
Design Appraoch
To implement the above requirement, we have to perform the following steps to update the existing workflow definition.
1) Create a text type item-attribute
Internal Name:- SUPERVISOR_COMMENT
Display Name:- Supervisor Comment
Type :- Text
2) Copy the item attribute and paste it under message( Creating a message attribute). Open the message attribute and Select Source as "Respond"
3) Click on Apply and OK.
4) Validate the definition and save it in database.
5) Now our workflow is ready to trigger.Once we trigger our workflow, the approver notification will looks like as shown below.(wft file is uploaded)