Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Unanswered

Get order of processtages without traversedpath / RetrieveActivePathResponse of BPF

Posted on by 115

I am struggeling with an edge case i guess. 

I wrote a plugin that determines the active processstage of an opportunity. It reads the active process from the "userentityuisettings" table and than gets the processstage from all active BPF revieved by using "RetrieveProcessInstancesRequest". So it work even if i got multiple active processes on an opportunity and switch from one to another in the frontend.

If i delete a processstage in the bpf editor which still holds opportunities, the frontend falls back to the first processstage in the process but it seems that it is not realy activting the first processtage. I want to fallback in c# too but the opportunity itself respectively its businessprocessflowinstance will still show the delted processstage-guid in "processstageid". So i cannot use that. "traversedpath" is an emtpy string and RetrieveActivePathResponse will return an empty collection so i cannot use that too. It seems the only possible way to get the first stage which is shown in the frontend would be to get all processtages of the bpf itself in the order of the process and then grab the first item. But i dont know how to do that. How to achieve that without using "RetrieveActivePathResponse" of a businessprocessflowinstance?


Where is the order information even stored? Or is there a way to retrieve the defaultPath from the BPF not the instance?


EDIT: It seems that the process information itself is located in the workflow table. Column "xaml". How to parse the XAML of a business process flow?

The documentation for the loader shows an example with type <int> but i guess it has to be something workflow specific in this case?

DynamicActivity wf = ActivityXamlServices.Load(new StringReader(serializedAB)) as DynamicActivity;


docs.microsoft.com/.../serializing-workflows-and-activities-to-and-from-xaml

Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,564 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,651 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans