How is this possible? I have an attribute that the log viewer separately evaluates to true and false for the same comparison when the value is UNDEFINED. I just included the lines that matter and rearranged the sequence for ease of comparison.
Evaluating condition AssessmentStateSurvey.sc_Priority>0
Condition evaluated to false: <UNDEFINED>>0
Condition evaluated to true: <UNDEFINED>>0
Evaluating condition AssessmentStateSurvey.sc_Priority=0
Condition evaluated to false: <UNDEFINED>=0
Condition evaluated to true: <UNDEFINED>=0
SOLVED: A size limitation exists for conditionals
SOLVED: A size limitation exists for conditionals
- Attachments
-
- UNDEFINED issue.png (208.86 KiB) Viewed 20278 times
Last edited by JonP on Sat Nov 17, 2018 9:48 pm, edited 1 time in total.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
I am assuming that sc_Priority is a shortcut?
If so try doing your evaluation to the referenced object directly
eg IF BO.ps_Priority.Code>20 THEN xxxx
I've had issues with evaluating shortcuts in HTML (different to what you are doing I know) but I found that evaluating against the actual referenced item worked whereas the shortcut didn't.
If so try doing your evaluation to the referenced object directly
eg IF BO.ps_Priority.Code>20 THEN xxxx
I've had issues with evaluating shortcuts in HTML (different to what you are doing I know) but I found that evaluating against the actual referenced item worked whereas the shortcut didn't.
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Every where the condition evaluated to true, like
Condition evaluated to true: <UNDEFINED>>0
you were using "NOT (AssessmentStateSurvey.sc_Priority>0)"
So the condition evaluated to false and the NOT changed to to true
It may not be in your code, but if your actual condition uses ELSE, Aware might be generating the NOT
Condition evaluated to true: <UNDEFINED>>0
you were using "NOT (AssessmentStateSurvey.sc_Priority>0)"
So the condition evaluated to false and the NOT changed to to true
It may not be in your code, but if your actual condition uses ELSE, Aware might be generating the NOT
Bob
One of my conditions is being ignored
Good catch, Bob. That's embarrassing. I'm actually not using NOT in my conditions, but for some reason, AIM does when it evaluates them.
Regardless, I'm still having a problem with AIM evaluating the conditions properly. I have a sequence of 6 If/Then statements. AIM steadfastly refuses to evaluate one of them (2nd from last). I've tried changing the order and rewording the if statement (including using Mark's suggestion of not using the shortcut shown below) to no avail.
The weird thing is, if I change the instance that is being bypassed from "Threat" to "Weakness", it gets evaluated. If I change it back to "Threat" and switch the if/then so that I check for "IN Strength, Weakness" and have Opportunity/Threat as the catch-all "Else", there is no difference in the result. I checked the FIND statement (shown below) and there is no reason for that instance not to be included.
Regardless, I'm still having a problem with AIM evaluating the conditions properly. I have a sequence of 6 If/Then statements. AIM steadfastly refuses to evaluate one of them (2nd from last). I've tried changing the order and rewording the if statement (including using Mark's suggestion of not using the shortcut shown below) to no avail.
Code: Select all
If AssessmentStateSurvey.Factor.AverageRelevance>0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: '+AS_STRING(AssessmentStateSurvey.sc_Priority)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance>0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: '+AS_STRING(AssessmentStateSurvey.Factor.AverageRelevance)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Code: Select all
FIND AssessmentStateSurvey WHERE (AssessmentStateSurvey.AssessmentState=AssessmentState AND AssessmentStateSurvey.Person=LoggedInPerson AND AssessmentStateSurvey.ScoreValue IS DEFINED AND AssessmentStateSurvey.Type IS DEFINED AND AssessmentStateSurvey.Type<>'Not Sure')
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Hey Jon,
Do you mean you looked in the logging window and you see that after the FIND statement there are the correct number of instances found?
When you say you check the FIND statement.weird thing is, if I change the instance that is being bypassed from "Threat" to "Weakness", it gets evaluated. If I change it back to "Threat" and switch the if/then so that I check for "IN Strength, Weakness" and have Opportunity/Threat as the catch-all "Else", there is no difference in the result. I checked the FIND statement (shown below) and there is no reason for that instance not to be included.
Do you mean you looked in the logging window and you see that after the FIND statement there are the correct number of instances found?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Hey Jaymer,
I said that wrong. Yeah, FIND found 6 objects (the screenshot only shows 1 because I was trying IN BATCHES OF 1 to see if that would help) and actually did evaluate all 6. But it refused to trigger the condition when sc_Priority (or equivalent) IS UNDEFINED and Type = Opportunity or Threat. Oddly, it has no problem when Type = Strength or Weakness and/or sc_Priority is a number. All 6 should render because I have a catch-all Else condition. I used a DISPLAY MESSAGE to verify that only 5 are included in DataForSWOT.
I said that wrong. Yeah, FIND found 6 objects (the screenshot only shows 1 because I was trying IN BATCHES OF 1 to see if that would help) and actually did evaluate all 6. But it refused to trigger the condition when sc_Priority (or equivalent) IS UNDEFINED and Type = Opportunity or Threat. Oddly, it has no problem when Type = Strength or Weakness and/or sc_Priority is a number. All 6 should render because I have a catch-all Else condition. I used a DISPLAY MESSAGE to verify that only 5 are included in DataForSWOT.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
IMO AIM does not handle multiple Else If statements very well, I try to avoid them.
Bob
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
What's the alternative?
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
If you have multiple items returned from a FIND it is better to evaluate them in a sub process otherwise it will evaluate the last item in the FIND.JonP wrote:FIND found 6 objects (the screenshot only shows 1 because I was trying IN BATCHES OF 1 to see if that would help) and actually did evaluate all 6. But it refused to trigger the condition when sc_Priority (or equivalent) IS UNDEFINED and Type = Opportunity or Threat.
As for sc and undefined I would try evaluating against the actual referred item instead of the shortcut.
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Multiple rules.
Rule 1
If AssessmentStateSurvey.Factor.AverageRelevance>0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: '+AS_STRING(AssessmentStateSurvey.sc_Priority)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance>0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: '+AS_STRING(AssessmentStateSurvey.Factor.AverageRelevance)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 2
If AssessmentStateSurvey.Factor.AverageRelevance=0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 3
If AssessmentStateSurvey.Factor.AverageRelevance<0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance<0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
edit
REMOVED
edit 2
disregard edit 1, it did not make mush sense. My only excuse is that I was in a hurry and not thinking clearly.
Rule 1
If AssessmentStateSurvey.Factor.AverageRelevance>0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: '+AS_STRING(AssessmentStateSurvey.sc_Priority)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance>0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: '+AS_STRING(AssessmentStateSurvey.Factor.AverageRelevance)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 2
If AssessmentStateSurvey.Factor.AverageRelevance=0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 3
If AssessmentStateSurvey.Factor.AverageRelevance<0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance<0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
edit
REMOVED
edit 2
disregard edit 1, it did not make mush sense. My only excuse is that I was in a hurry and not thinking clearly.
Last edited by BobK on Sat Nov 17, 2018 7:31 pm, edited 2 times in total.
Bob
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
This will be very inefficient as it will trigger three rules instead of one. Each one checking everything. If the Business Rule is not working with multiple if/else if then define the condition for a process and pass it off to that, then it would trigger only once.BobK wrote:Multiple rules.
Rule 1
If AssessmentStateSurvey.Factor.AverageRelevance>0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: '+AS_STRING(AssessmentStateSurvey.sc_Priority)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance>0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: '+AS_STRING(AssessmentStateSurvey.Factor.AverageRelevance)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 2
If AssessmentStateSurvey.Factor.AverageRelevance=0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Rule 3
If AssessmentStateSurvey.Factor.AverageRelevance<0 AND AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance<0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',y: 0,size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`,color: `blue`},'
Using this multiple Business Rule approach can have multiplying effects if you have forgotten to switch off Referred Rules on the related Business Objects.
On rereading the issue I have another question.
Are you trying to use FIND in a business rule? If so you are setting yourself up for a world of pain especially if it returns more than one BO. Definitely pass this off to a Process.
Also if the IN ‘Threat’, ‘Weakness’ is not working have you checked using BO.attribute=‘Threats’ OR Bo.attribute =‘Opportunity’
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Thanks Mark,
Yeah, I'm using processes, not rules in this case. If all I did was add-to DataForSWOT with each new instance, then I could use rules. But sometimes I have to wipe DataForSWOT and re-populate it for an updated instance, so processes work better.
I've been using a sub-process after the FIND for that conditional. There's no other way to do it that I know of since you can't place an If statement directly after a FIND statement (without stuffing it in a sub-process) I don't think. I tried it with and without batches of 1.
I also tried replacing the IN syntax with the clunkier OR syntax. No luck.
Yeah, I'm using processes, not rules in this case. If all I did was add-to DataForSWOT with each new instance, then I could use rules. But sometimes I have to wipe DataForSWOT and re-populate it for an updated instance, so processes work better.
I've been using a sub-process after the FIND for that conditional. There's no other way to do it that I know of since you can't place an If statement directly after a FIND statement (without stuffing it in a sub-process) I don't think. I tried it with and without batches of 1.
I also tried replacing the IN syntax with the clunkier OR syntax. No luck.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
-
- Posts: 1463
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
I’m Sean. Mark is Eagle99
I’m out of ideas then. My suggestion of last resort is a debug with DISPLAY MESSAGE and checking the values of expected attributes at various stop points.
I’m out of ideas then. My suggestion of last resort is a debug with DISPLAY MESSAGE and checking the values of expected attributes at various stop points.
Re: <UNDEFINED>=0 and <UNDEFINED>>0 evaluated to true AND fa
Sorry Sean, brain fart. Thanks for your efforts.
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)
SOLVED: A size limitation exists for conditionals
I decided to split the conditional sub-process into two sub-sub-processes and it worked. The sub-process was changed to this:
The first sub-sub-process (BuildIndExtSWOT_Matrix) looks like this:
The logic for this approach vs the previous approach is EXACTLY THE SAME. Therefore I can only conclude that there is a size limitation for conditionals above which they become unstable. Bob, I can see why you stick to rules. Now I'm getting a little paranoid about my other conditionals.
Code: Select all
If AssessmentStateSurvey.Type IN 'Opportunity', 'Threat' Then
BuildIndExtSWOT_Matrix
Else
BuildIndIntSWOT_Matrix
Code: Select all
If AssessmentStateSurvey.Factor.AverageRelevance>0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: '+AS_STRING(AssessmentStateSurvey.sc_Priority)+',category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`},'
Else If AssessmentStateSurvey.Factor.AverageRelevance=0 Then
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 0.05,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`},'
Else
LoggedInPerson.DataForSWOT=LoggedInPerson.DataForSWOT+'{x: 0,y: '+AS_STRING(AssessmentStateSurvey.ScoreValue)+',size: 3,category: `'+AS_STRING(AssessmentStateSurvey.sc_Factor)+'`},'
v8.1 on Windows 10 / MySQL 5.6 (local), v8.1 on Windows Server 2016 / MySQL 5.6 (server)