I am trying to implement a workflow such that it will stop an attribute from being modified based on the results of a search criteria.
So "If result=x continue workflow";"If result=y stop workflow"
The logic I have created to stop the workflow works but the originating action is still pending, which has the effect of "hanging" the target account - anything you try to do to the account fails with the Stop/Break error message.
Is there a way of cancelling the original request in a similar way to a "reject" Approval activity would.
In reply to prasad:
Thanks for responding.
So I am trying to automate the creation of admin accounts ( ie second privileged AD accounts).
I have created a VA, that sits on the main account, for the service Desk to select when a user requires an admin account, this triggers a workflow which runs an approval and if approved then creates the account, pulling in the required attributes from the main account. This all works.
Now I want to enhance the workflow with search and if/else functions to check if the admin account already exists and, 'if not exist' follow the above logic, and 'if exist' send a mail to the originator, cancel the request and stop the workflow. All of this works apart from cancelling the original request. The stop/break does a 'hard stop' but the original task is still pending and 'locks' the web UI.
As I mentioned this seems to me to be the same logic as a Reject command (from an Approval Activity) would need so I thought there may be some way to use powershell to build an automated reject function?
In reply to RoastEM:
Hi RoastEM , what condition you are putting in search?i have tested in my lab and it works fine. below is the scenario which i have configured and tested, please correct if anything missed;
1. workflow trigger condition on create user2. search activity to find the attribute which is unique for service account(in my case description) - description equals workflow target description3. if and else branch 1 - if description of found object equals description of workflow target then activity-send notification and stop/break.4. if and else branch 2 - if description of found object dose not equals description of workflow target (do not put any activity here)5. outside search activity run approval activity.