I didn't worked with workflows a lot but I think you can do something like this,
- When User make changes to User Profile Data start a "Approval Workflow" and then update user properties in code manually and do what you want to do after,
Here's the code for workflow completed method,
public override void WorkflowCompleted(SPWorkflowEventProperties properties)
{
base.WorkflowCompleted(properties);
if (properties.CompletionType != SPWorkflowEventCompletionType.Completed) return; //only update the Leave days when the leave request get approved.
SPSecurity.RunWithElevatedPrivileges(delegate
{
using (SPSite site = new SPSite(properties.WebUrl))
{
using (SPWeb web = site.OpenWeb())
{
SPWorkflow wf = new SPWorkflow(web, properties.InstanceId);
UpdateUserProfile(wf.AuthorUser.LoginName); //update the initiator's profile
}
}
}
}
Update the user's prfile
public void UpdateUserProfile(string userAccount)
{
string url = "http://sp.adventure.com"; //replace with your site collection
using(SPSite site = new SPSite(url)){
SPServiceContext sc = SPServiceContext.GetContext(site);
UserProfileManager upm = new UserProfileManager(sc); //now you have the manager object
UserProfile up = upm.GetUserProfile(userAccount); //for example, "adventuer\\jony"
up["Leave"] = int.Parse(up["Leave"].ToString())-1; //you may want to check if the Leave is more than 0
up.Commit();
}
}
Source : Approval Workflow to update User Profiles Details
Hope it helps :).