xDM Workflow builder: SemQL condition with Lookup KO
A
Aubin JONCOUR
started a topic
over 2 years ago
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.
Matthieu DE PILLOT DE COLIGNY
said
almost 2 years ago
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
1 Comment
M
Matthieu DE PILLOT DE COLIGNY
said
almost 2 years ago
Answer
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
Aubin JONCOUR
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
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
3. Create a technical attribute in your main entity to directly access its value
Matthieu DE PILLOT DE COLIGNY
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
3. Create a technical attribute in your main entity to directly access its value
-
LOV label in Named Query
-
How we can set Dynamically changing Form field Description?
-
Is it possible to have a conditional survivorship rule based on a SemQL filter (akin to the filter on privileges)?
-
Where Do I View 2 Merged Records?
-
Show/hide an attribute in a form
-
Restrict access of attributes
-
Is it possible to manage visible/invisible value in List depend on user role??
-
Why am I unable to merge duplicates?
-
How are child records selected when parent records are manually merged?
-
Can the response from the API Call Response can be formatted differently in the JSON output?
See all 178 topics