Start a new topic

xDM Workflow builder: SemQL condition with Lookup KO

Hello,


I am facing an issue with the router in the workflow builder. 

There are two possible routes, depending on the value  of child entity in the stepper. 

Here is the code of both routes' SemQL condition: 

  Route 1 : 

Lookup
        FIRST  FamilleAchat.Referent
        FROM PreviousDataSet.Tiers.LienTiersBranche.LiensTiersBrancheFamilleAchat
        WHERE FamillePrincipale = '1'
End = 'valid_auto'

Route 2 :

Lookup
        FIRST  FamilleAchat.Referent
        FROM PreviousDataSet.Tiers.LienTiersBranche.LiensTiersBrancheFamilleAchat
        WHERE FamillePrincipale = '1'
End <> 'valid_auto'

The problem is that it never works because the router is not able to find a "valid route", even though the value is valid_auto... 

I also tried to reverse the logic: if value <> valid_auto routs to next task, else end => in all the case it ends the workflow... 


I wonder if 'lookups' works in the router condition, since I've added the SemQL in the stepper's form ( without PreviousDataSet ) to check the value, and there it works. 


Any help welcome! 


Attached the error returned and the workflow screenshot. 


Version: 2024.1

WFBuilder.png
(19.7 KB)
WFError.png
(33 KB)
1 Comment

Hello,


Here are a few elements that can help with this issue


1. Remove the condition on the second branch. A router works just like a "case when" statement, which means that the last route doesn't require a condition, and if no condition is provided it will act like an else statement (which means the last route will be used only if none of the other route can be used). Setting a condition in every branch may lead to cases where the workflow can't find a proper route (for example if the value returned by the lookup is null)


2. Replace the "Lookup" statement with a "any" statement, with the following syntax. Here is the documentation about the any/all

 

any LienTiersBranche.LiensTiersBrancheFamilleAchat have (FamillePrincipale = '1' AND FamilleAchat.Referent = 'valid_auto')


3. Create a technical attribute in your main entity to directly access its value 

Login to post a comment