Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Unanswered

Get order of processtages without traversedpath / RetrieveActivePathResponse of BPF

(0) ShareShare
ReportReport
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

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

News and Announcements

Announcing Category Subscriptions!

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,359 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,370 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans