toddhalfpenny / sfflowvisualiser-vscode

Salesforce Flow to PlantUML VS Code extension
ISC License
29 stars 5 forks source link

[FEATURE] Fail More Clearly #17

Open allisonletts opened 9 months ago

allisonletts commented 9 months ago

When I have bigger flows, sometimes the visualiser seems not to run - but I'm just guessing that it's failed. Can the extension throw an error or information message if it's not successful?

As a first step, I'd love some sort of guidelines about when flows won't be able to render.

toddhalfpenny commented 9 months ago

Oh right... This is a great point. Thank you. Are you able to provide a flow XML that causes it to fail? I had to drop the version of mermaid down as it was complaining about the number of elements, and I hope this had fixed it.

CamilleGuillory commented 7 months ago

Hi @toddhalfpenny I have the same issue. This flow is not rendered: `<?xml version="1.0" encoding="UTF-8"?>

57.0 Contacts Relation Id Ass_Contacts 208 398 varT_ContactIds Add Loop_TaskRelations.RelationId Loop_TaskRelations Contacts Relation Id Ass_EventContacts 512 398 varT_ContactIds Add Loop_EventRelations.RelationId Loop_EventRelations Set Accounts Last Planned Activity Date Ass_UpdateAccounts 138 1766 Loop_Accounts.CRM_LastPlannedActivityDate__c Assign varB_ActivityDate varR_UpdateAccounts Add Loop_Accounts Loop_Accounts Set Contact Last Planned Activity Date Ass_UpdateContacts 468 950 Loop_Contacts.CRM_LastPlannedActivityDate__c Assign varB_ActivityDate varT_AccountIds Add Loop_Contacts.AccountId varR_UpdateContacts Add Loop_Contacts Loop_Contacts Dec_AccountEmpty 380 1166 Ys (Default) Out_AccountEmpty_No and varT_AccountIds IsNull false Get_RecordType Task Relation Or Event Relation Dec_RelationType 380 158 No relation (Default) Out_RelationType_Task and varR_TaskRelations IsNull false varR_EventRelations IsNull true Loop_TaskRelations Out_RelationType_Event and varR_EventRelations IsNull false varR_TaskRelations IsNull true Loop_EventRelations Account RecordType Dec_RTAccount 182 1406 No (Default) Out_RTAccount_Yes and varR_RTAccount IsNull false Get_Accounts Default CRM_Activity_LastPlannedActivityUpdate {!$Flow.CurrentDateTime} iterate Accounts From Contacts Account Id Loop_Accounts 50 1646 Get_Accounts Asc Ass_UpdateAccounts Iterate Contacts From Task Relations Loop_Contacts 380 830 Get_Contacts Asc Ass_UpdateContacts Dec_AccountEmpty Iterate Event relation Loop_EventRelations 424 278 varR_EventRelations Asc Ass_EventContacts Get_Contacts Iterate Task relation Loop_TaskRelations 120 278 varR_TaskRelations Asc Ass_Contacts Get_Contacts BuilderType LightningFlowBuilder CanvasMode AUTO_LAYOUT_CANVAS OriginBuilderType LightningFlowBuilder AutoLaunchedFlow Accounts From Contacts Account Id Get_Accounts 50 1526 false Loop_Accounts 1 AND 2 AND (3 OR 4) Id In varT_AccountIds RecordTypeId EqualTo varR_RTAccount.Id CRM_LastPlannedActivityDate__c LessThan varB_ActivityDate CRM_LastPlannedActivityDate__c IsNull true false Account Id true Get Contacts From TaskRelations Get_Contacts 380 710 false Loop_Contacts 1 AND 2 AND (3 OR 4) Id In varT_ContactIds RecordTypeId EqualTo varR_RTContact.Id CRM_LastPlannedActivityDate__c LessThan varB_ActivityDate CRM_LastPlannedActivityDate__c IsNull true false Contact Id AccountId true Account RecordType Get_RecordType 182 1286 true Dec_RTAccount and DeveloperName EqualTo CRM_Client SobjectType EqualTo Account RecordType varR_RTAccount Id 254 0 Dec_RelationType Active Event or Task Activity date varB_ActivityDate Date false true false varR_EventRelations SObject true true false EventRelation Account RecordType varR_RTAccount SObject false false false RecordType Contact RecordType varR_RTContact SObject false true false RecordType Task Relations varR_TaskRelations SObject true true false TaskRelation Update Accounts varR_UpdateAccounts SObject true false true Account Update Contacts varR_UpdateContacts SObject true false true Contact Account Ids varT_AccountIds String true false false Contact Ids varT_ContactIds String true false false

`

Here is the output: `flowchart TB START(( START )) Ass_Contacts("⚌ Assignment Assign Contacts"):::assignments Ass_EventContacts("⚌ Assignment Assign Contacts"):::assignments Ass_UpdateAccounts("⚌ Assignment Update Accounts"):::assignments Ass_UpdateContacts("⚌ Assignment Update Contacts"):::assignments Dec_AccountEmpty{{"⇋ Decision Account Empty"}}:::decisions Dec_RelationType{{"⇋ Decision What type of relations?"}}:::decisions Dec_RTAccount{{"⇋ Decision Account RecordType exist?"}}:::decisions Loop_Accounts("↻ Loop Loop through Accounts"):::loops Loop_Contacts("↻ Loop Loop through Contacts"):::loops Loop_EventRelations("↻ Loop Loop through Event Relations"):::loops Loop_TaskRelations("↻ Loop Loop through Task Relations"):::loops Get_Accounts("🔍 Get Records Get Accounts"):::recordLookups Get_Contacts("🔍 Get Records Get Contacts"):::recordLookups Get_RecordType("🔍 Get Records Get RecordType"):::recordLookups END(( END ))

Ass_Contacts --> Loop_TaskRelations Ass_EventContacts --> Loop_EventRelations Ass_UpdateAccounts --> Loop_Accounts Ass_UpdateContacts --> Loop_Contacts Dec_AccountEmpty --> |No| Get_RecordType Dec_AccountEmpty --> |Ys (Default)| END Dec_RelationType --> |Is Task Relation| Loop_TaskRelations Dec_RelationType --> |is Event Relation| Loop_EventRelations Dec_RelationType --> |No relation (Default)| END Dec_RTAccount --> |Yes| Get_Accounts Dec_RTAccount --> |No (Default)| END Loop_Accounts --> Ass_UpdateAccounts Loop_Accounts ---> END Loop_Contacts --> Ass_UpdateContacts Loop_Contacts ---> Dec_AccountEmpty Loop_EventRelations --> Ass_EventContacts Loop_EventRelations ---> Get_Contacts Loop_TaskRelations --> Ass_Contacts Loop_TaskRelations ---> Get_Contacts Get_Accounts --> Loop_Accounts Get_Contacts --> Loop_Contacts Get_RecordType --> Dec_RTAccount START(( START )) --> Dec_RelationType

classDef actionCalls fill:#344568,color:white classDef assignments fill:#F97924,color:white classDef collectionProcessors fill:#DD7A00,color:white classDef customErrors fill:#032D60,color:white classDef decisions fill:#DD7A00,color:white classDef loops fill:#E07D1C,color:undefined classDef recordCreates fill:#F9548A,color:white classDef recordLookups fill:#F9548A,color:white classDef recordUpdates fill:#F9548A,color:white classDef screens fill:#1B96FF,color:white classDef subflows fill:#032D60,color:white

`