- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2014 03:14 AM
Hi all
I am working on an approval process to give us flexibility and to use the same approval code over and over again for ease.
Initial tests are all good, but now at the next test I have an issue
I have a workflow - "Run Approvals".
It will grab data passed to it via script into the scratchpad and then run the approvals.
This is fine until I call it a second time
I have a workflow
It sets the details into the scratchpad and call "Run Approvals" as a sub workflow (see below)
Approvals are sent and updated and ultimately approved. - all is good.
The next phase is to set more details into a new scratchpad and call "Run Approvals" again
It now removed ALL the old approvals and creates a new set.
Creating a new set is correct, but I need to keep the old approvals there too.
I cannot workout if this is a Script Include or a Business Rule on one of the "wf_" tables.
Does anyone have a better idea than me of what mechanism is being used when this happens.
The errors when you run this process this way is
- Approvals have been reset
On taking this I did think it was the Script Include, but by skipping the whole of the section in the WorkflowApprovalUtils it still cleared the old approvals.
I may also need to run the "Run Approvals" in parallel which it can do with different Scratchpads, but when I do this one of the workflows is run and adds its approvers, then the other one then kicks in, removes the approvers and leaves just its approvers there.
This time the error messages are (the approval process here is looking for where it need just one approval from the group, hence the rule One of.)
- Group approval for KIN Emergency IT deleted since it no longer matches approval rule One of.
- Group approval for KIN EMEA MMS IT deleted since it no longer matches approval rule One of.
Solved! Go to Solution.
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2014 04:42 AM
After a lot of hunting down, I did see a message on here (lost the link now) that mentioned "Workflow Activity Definitions".
I headed in there there and there is one called "Approval - Group"
Looking at it, I can see it removes some approvals if there is a difference in ID's, of which mine will be as they are different workflows
I added a small section that looks at the wf_context for the current record that searches for my "Run Approvals" workflow
It there are NO matches, it will then delete as per normal
If there are matches, it skips the step and the approvals are left alone.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2014 06:19 AM
Are you sure that the old approvals are being removed (deleted) and new ones are created?
I know this process as that if already some approvals have been created by a specific workflow and they are triggered again, that the existing approvals are reset to "Requested" again and all previous information is kept.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2014 06:24 AM
Hi Eican, I see a trend here
Yes, I am sure they are disappearing and it is the same mechanism but far easier to see when I run in serial
So "Run Approvals" is called and I may need to approve 2 our of the 5 approvers. As soon as I have approved 2, then they are removed and however many approvers are requested when "Run Approvals" runs again are added.
I have also noticed, that in the above, if I try to approve 3, then the 3rd approval gets a message about the record not existing - clear as it has been removed.
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2014 06:34 AM
Well, that sounds weird — why would approval records be removed/deleted?
And looking at the business rules on the approval table it always queries itself and checks if there any other approvals that need to be updated — there is no direct reference where the result could be "not existent".
It sounds like there is some custom code which is causing this or the conditions for the created approvals or approval coordinator is causing this.
Also I wonder how they are "disappearing". Did you check if there are any filters in place either via breadcrumbs or business rule (before query)?
Also try to grab all sys_ids of the approval records, confirm via background script that they exist, do the approvals and after each approval step run the check again.
That should shine some light on what is happening with the records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2014 04:42 AM
After a lot of hunting down, I did see a message on here (lost the link now) that mentioned "Workflow Activity Definitions".
I headed in there there and there is one called "Approval - Group"
Looking at it, I can see it removes some approvals if there is a difference in ID's, of which mine will be as they are different workflows
I added a small section that looks at the wf_context for the current record that searches for my "Run Approvals" workflow
It there are NO matches, it will then delete as per normal
If there are matches, it skips the step and the approvals are left alone.
Cheers