CurrentRequest Activity CurrentRequest Status
Hi, We have an issue with the request status of the CurrentRequest Activity, according with the request process model http://msdn.microsoft.com/en-us/library/ee652475(VS.100).aspx The authorization workflows are executed before Action Workflows, taking into account, after the authorization we need to evaluate the state of each request to perform some actions, in our case if it was Approved or Rejected we need to change a custom attribute called “Status” with the appropriate value, but the problem is that the CurrentRequest.RequestStatus property has always the value “PostProcessing” Here is our simple code void cActivity_ExecuteCode(object sender, EventArgs e) { RequestType currentRequest = this.crActivity.CurrentRequest; if (OperationType.Create != currentRequest.Operation && OperationType.Put != currentRequest.Operation) { throw new InvalidOperationException( String.Format( CultureInfo.CurrentCulture, "StatusUpdaterActivity executing against request with invalid operation: {0}.", currentRequest.Operation)); } string status = string.Empty; The value is always “PostProcessing”, why not Authorized if it was approved? if (this.crActivity.CurrentRequest.RequestStatus == RequestStatusType.Authorized) { status = "Approved"; } else { status = "Rejected"; } SequentialWorkflow parentWorkflow = null; if (!SequentialWorkflow.TryGetContainingWorkflow(this, out parentWorkflow)) { throw new InvalidOperationException("Cannot identify parent workflow!"); } this.urActivity.ResourceId = parentWorkflow.TargetId; this.urActivity.UpdateParameters = new UpdateRequestParameter[] { new UpdateRequestParameter("EmployeeStatus", UpdateMode.Modify, status) }; } } Anybody knows if it’s an issue of FIM or we are making some wrong Thanks & Regards.
January 18th, 2010 8:22pm

Good queston. This is not an issue with FIM but I think a slightly unclear flow chart in the documentation. After a request is marked Authorized FIM commits the changes and then moves the request to the PostProcessing phase. In action and AuthZ workflows the only way to determine the approval outcome is to query all referenced Approval objects. Alternatively, you can be assured that post-processing only occurs if a request was approved and base your code on that string instead. The "Authorized" request status is not long-lived since FIM quickly commits changes.
Free Windows Admin Tool Kit Click here and download it now
January 18th, 2010 9:19pm

We can take an action with postprocessing state, but In our case we need to take another action with rejected requests too, so we don’t know where the custom activity must be placed , because after reject a request, the action workflows don’t executed.Thanks,Pablo
January 19th, 2010 3:42pm

I don't believe that action workflows will ever fire if the request is not authorized. In that case you will have to add activities to the auth workflow to handle the cases where the request is not approved.AhmadAW
Free Windows Admin Tool Kit Click here and download it now
January 19th, 2010 9:42pm

Did you ever get this resolved? I am currently writting a custom workflow that will match and join users based on an XPath search and I can not seem to get the response if the request is rejected ? I added a seperate thread for this: Custom Approval Workflow - No rejection code ?
June 10th, 2010 9:51am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics