0

Guys. I have a custom BPF in a custom entity. There is a plugin triggered by another entity to update this custom entity which has BPF. The problem I have now is if the custom entity(with BPF) BPF stage is not first stage, the plugin will fail with this error:

The traversed path should end with the new active stage.

If the custom entity(with BPF) BPF stage is in first stage, then the plugin runs well. The plugin simply updates some fields of the custom entity(with BPF).

Could you guys please give me any advice? I really don't understand that error and I try to google it, but there is little information I can find. Thanks.

Simeng
  • 13
  • 1
  • 6
  • It seems you are trying work with fields from the first stage, and because of that, you can not turn back once they are 'settled' in it. We need more info about the BPF and the plug in, but my guess is that you would need to make those fields not obligatory in the BPF. – Analyst Apr 15 '15 at 17:46
  • @Analyst, I am not trying to work with fields in/related BPF, only some regular fields like dates, text fields. The plugin only updates those instead of fields in BPF. – Simeng Apr 16 '15 at 18:35
  • They are related, if you have a field in the form that says Name for example, it can also say Description or Full Name in the BPF, as you can change the display name on the BPF, but it will still being the same field for the CRM, the difference is that it belongs to an specific stage (in your case a former one), and helps the user know in what order he is supossed to enter the data, so, going back (update) might not be available with the BPF active or the field restricted by it. – Analyst Apr 17 '15 at 14:58

2 Answers2

2

if you get travesed path error their is an field in entity called

travesedpath

so this field contain stages id from 1st to current active stage eg if your entity has a process flow and it has 6 stages and current active stage is 3rd stage. so travesedpath contain 3 Guid from 1st stage to 3rd stage like c1a07479-aa88-4b50-9675-61d840083530,efff5adb-48f2-47c7-8d0b-5f3807702f9b,a2717242-a072-4cd0-ac57-3a4eaddbcca7with comma separated this travesedpath field is text field in plugin you will first get traversedpath from current entity or preimage then add new guid with this travesed path. eg. string traversedPath = currentEntity.Attribute["traversedpath"]; thentravesedPath += newStageid;` then update your entity

Fawad Ali
  • 21
  • 2
0

The problem here is that the BPF needs a list of all of the guids created as it uses it for branching. What that means is that you need to do the following:

string straversed = entity["traversedpath"].ToString();
string stageid = entity.Attributes["stageid"].ToString();   
entity.Attributes["traversedpath"] = straversed + "," + stageid;

try
{
 service.Update(entity);
}

The current stage is the last guid in the traversed path, so you add the stageid to the traversed path.

This should work! Let me know if it does!

Lucia Clifford
  • 136
  • 1
  • 6