EEM Nested Conditional

Hi all,
  I have an EEM script written using CLI that includes a nested conditional. I have no problem running only one of the conditional. However, if I nest one conditional within the other, it just gives me this "Missing "end" action in conditional block" message. Here is the basic core structure of my script:
foreach RUN A LOOP
  if CONDITION
     BLAH BLAH BLAH
     exit
     break //if the condition in the if block returns true, I want to do something and break out of the entire foreach loop. Do I use them (exit and break) both or just one?
  else
     BLAH BLAH BLAH
     exit
     continue //again, do I need them both or just 'continue'?
  exit //exit foreach loop
  if CONDITION //another IF conditional
     BLAH BLAH BLAH
     exit
end
  If nested conditional is allowed, is my script in the correct syntax?
Regards,
Angela

Nested conditionals are supported.  It's hard to see if there is a problem with your code or a problem with the device as you did not post your actual applet or IOS version.  However, from the pseudo-code above, it does appear you're missing an "end".  Here is a working applet I wrote to illustrate the nested conditional:
event manager applet nct event none action 001 set var "5" action 002 if $var lt 10 action 003  if $var gt 1 action 004   if $var eq 5 action 005    puts "Found it!" action 006   end action 007  end action 008 end
Note how each conditional must be terminated with an associated "end" action.

Similar Messages

  • Can you create nested condition in merge(e.g. insert/update) using owb

    Hi,
    Does OWB9iR2 allow you to build in nested condition in merge. such as
    If no match on col1 and col2 then
    if col3 match then no new sequence insert <---
    else insert new sequence;
    else (there is match on col1 and col2)
    update col3 and sequence.
    I have an incremental load for a lookup table, where insert/update is used. There are two match columns and surrogate key is used. When there is no match, it shall not insert a sequence when there is a match on third column. I can not use the 3rd column in the original match because it shall be updated where there is a match for the two match column.
    I am trying to avoid using transformant for performance impact. Thanks

    HIi I think the misleading thing is that in PL/SQL you can use booleans, which is not possible in SQL. So in a PL/SQL tranformation, this is OK:
    a:= case when not orgid_lkup( INGRP1.ORG_ID )
    then get_supid(..)
    else ...
    but, the following SQL does not work:
    select case when not orgid_lkup( INGRP1.ORG_ID )
    then get_supid(..)
    else ...
    into a
    from dual;
    I ended up using only 0/1 as boolean return values for these reasons;
    so I can have:
    select
    case when orgid_lkup( INGRP1.ORG_ID ) = 0 then ...
    though true booleans are better if you don't have to embed them in SQL.
    Antonio

  • Nested Conditions in a Query or Priority setting

    Hi all
    Would anyone know whether it would be possible to do nested conditions or set the priority of conditions in a query?
    My problem is that I have two conditions, A and B. Both are optional, however, if both are entered together I want condition A to take effect before condition B.
    Example:
    Condition A is amount received (range)
    Condition B is Top N customers
    When both are entered together, I want to see the top N customers within the specified amount range.
    Currently, both conditions are together, meaning that if my specified range does not encompass the top N customers, I do not get any data retrieved.
    Any help on this would be appreciated and points awarded.
    Thanks in advance
    Nicholas

    I have exact same question that Nicholas Chia asked last year. Does anybody have any suggestions to achieve this?
    Here is the example scenario:
    CHAR          KF
    ABC          10
    BCD          -5
    CDE          0
    DEF          4
    EFG          6
    FGH          2
    IJK          -8
    Condition 1: Top 5
    Condition 2: Key figure <> 0
    I expect to see the results like this:
    CHAR          KF
    ABC          10
    BCD          -5
    DEF          4
    EFG          6
    FGH          2
    But, BEx outputs like this:
    CHAR          KF
    ABC          10
    DEF          4
    EFG          6
    FGH          2
    I think BEx is first applying the Top N condition. Takes the resulting data and then applies KF <> 0 condition.
    Is there a way to achieve the results the way we like (first apply condition 2 and then the condition 1). Creating the conditions in different order have no effect.

  • Nested conditional Expression language in ADF

    I am trying to get a nested conditional operator to work in my inlinestyle field and It doesnt seem to work. can someone show me what is being done wrongly.
    inlineStyle="#{row.bindings.Slot1.inputValue == &quot;0&quot; ? (row.bindings.Slot1.inputValue == &quot;1&quot; ? 'background-color:Yellow;' : 'background-color:White;' ) : 'background-color:Gray;' }"
    Thanks,
    RAS

    Timo,
    I tried with or inbetween each check and setting the color accordingly and it didnt work either and I was playing around with conditional statement to see if that might help. Do you ahve any suggestions on how to set a back ground color based off of the input value in El and I need to set three different colors based on 0,1 and 2 as input values. Your help here is appreciated!
    Thanks,
    RAS

  • How to create nesting in a smartlist

    This is for adding a nested condition to a smartlist in iTunes 11
    I have a smartlist that has nesting that looks like this:
    Per the help section, it states:
    To add another set of rules, hold down Option key & click the Nest button. (When you hold down the Option key, the Add button changes to the Nest button.)
    When I do this, I can only create a new nest within the larger nest that you see on the screen. For example, I press Option Key,  the Add button becomes a Nest button under Any>Plays>is less than>41. But, I want to creat a "larger" Any nesting that is not nested within the two larger nestings. Does that make sense? Any tips?

    It is a bit clumsy, isn't it. In your case, I'd start again form the begining and get your nesting structure in place first, then fill in the details.

  • Nested If...Else blocks in PixelBender Kernel Don't Work in Flash Player?

    I'm writing a kernel which has a several conditional steps.  It contains a structure like the following:
    if(condition)
    dst = outputA;
    else
       if(anotherCondition)
          dst = outputB;
       else
          if(yetAnotherCondition)
              dst = outputC;
          else
             dst = outputD
    I realize that this is a bit ugly, and that conditionals are already less than ideal for a kernel (and nested conditionals even less ideal), however, it does seem to work in the PixelBender Toolkit environment itself when I run the filter.  It will also export as a pbj for Flash without any objections from the Toolkit.  However, when I run the filter in Flash it seems to do... nothing.  When I strip out the nested conditionals, I will at least see the first if / else level working, but with nested conditionals, everything seems to be ignored and the kernel doesn't run at all within Flash Player. 
    Is this a bug?  Has anyone else successfully used nested conditional blocks in a PixelBender kernel running inside Flash Player?

    This is fixed in version 2.0 of the Pixel Bender toolkit which will be up soon at the Pixel Bender Developer Network (http://www.adobe.com/devnet/pixelbender/).
    The Pixel Bender 2.0 toolkit is also installed with CS5 AE or Flash Pro or any suite that includes either of those applications.
    Bob

  • Conditionally Formatting Dates

    I'm working on a calendar. I have my generator working. Now I want to conditionally format days of the month, ie. colour the cell if the day falls within a defined range or equals a particular date like today. My main problem is the number series I've generated are just numbers, whereas my format condition is a date. Unlike Excel I'm unable to nest conditions of different formats in the one statement. I've tried an intermediate step by 'stripping out' the day data using the day function then acting on that which works so long as my date range does not extend longer than a month. If it does my result is erroneous.
    Can someone give some ideas how I might achieve my intended result.
    Thanks

    Hi Yvan, thanks for your response. I thought I might be able to post an picture of my screen, but it appears I'm not able to do so. Ok, so I'll try and best describe what I'm trying to do.
    My calendar is project-focused. I have two cells, a start date and an end date (these cells are formatted as dates). The start date is used to generate the calendar: its month, the previous month and the following 2 months. The end date can be any date you like. To produce each month in the calendar, the generator carries out a few tests in the first week and the last week of each month to find the day the first of the month falls on and the day the last of the month occurs. Once the first and the last days have been determined cells for the second, third fourth day etc merely increment the previous day by one until the last of the month is reached. The cells containing the numbers corresponding to the days in each month are just numbers - the sum of the previous day number plus 1. All this works fine.
    Having generated the calendar, I want to highlight the date range between the start date and the end date using conditional formatting. I have this working in Excel with a conditional formating rule builds a date then tests to see if it is within the range of the start and end date; (=AND(DATE(YEAR,MONTH,DAY CELL [being formatted])>=(START DATE),DATE(YEAR,MONTH,DAY CELL [being formatted])<=END DATE).
    Of course, Numbers does not have this complexity when it comes to conditional formatting, so I'm wondering if there is another way of doing it.
    Thanks

  • Jdev 10g, ADF- expression based on column value

    Hi,
    I have an ADF table with a column in it that is populated through a data control. The column can be one of five values (1 - 5) which mean different statuses (Approved, Denied, Pending, etc). I was just wondering if anyone could recommend a way to do the translation in the table column.
    I was looking at the expression builder but it didn't seem like it would take more than the #{row.Status==1 ? 'Approved': 'Others'} and I have 5 different statuses that I'd like displayed to the user.
    Thanks

    Hi,
    yes you can nest conditions like here:
    inlineStyle="#{row.Status == '1' and row.ErrStatus == '0' ? 'color:rgb(0,255,0);' : row.Status == '2' and row.ErrStatus == '0' ? 'color:rgb(210,170,0);' : row.ErrStatus == '1' or row.ErrStatus == '5' ? 'color:rgb(0,0,255);' : row.ErrStatus == '3' ? 'color:rgb(255,0,255);' : row.ErrStatus == '4' or row.ErrStatus == '9' ? 'color:rgb(255,0,0);' : row.ErrStatus == '2' ? 'color:rgb(205,0,0);' : ''}
    {code}
    regards,
    Branislav                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to store logical operator in an array in java

    how to store logical operator in an array in java.
    Array should not be String type if i pass an element of that array it should be considered as logical operator

    my exact requirment is like this, i need some logic
    to convert string like this "2 Equals 3 AND 4 greater
    than 7" to condition like this
    2 == 3 && 4 >7 which i can pass to if
    condition.So you want to create an expression parser?
    No need for something as ugly as what you think you need, a simple nested conditional will do it for just the few logical operations.

  • Plsql procedure containing select statement to fill page items

    I would like to fill items :P200_A and :P200_B and so on
    with the result of a SELECT which depends on the different values of many select lists.
    E.G. :P200_list_alpha with the list of values
    STATIC:less than 10;less,equal than 10;equal,above 10;above,indifferent;indiff
    :P200_list_beta with the list of values
    STATIC:active;active,passiv;passiv,excluded;excluded
    How do I write the select statement ? I think it has to be executed in an anonymous PLSQL Procedure (after submit).
    What is a convenient way to write the select statement ?
    I could imagine to use lots of IF , ELSIF, ELSE statements and in each branch (here 12 ) the whole/complet SELECT statement is written.
    How to solve this problem in an elegant way ?
    In my opinion the CASE statement could be helpful, but how to use it in the WHERE clause with this nested conditions ?

    I think I got it:
    SELECT col1, col2, col3, ...
    INTO :P200_A , :P200_B , ....
    FROM mytable_1, mytable_2
    WHERE mytable_1.col1 = mytable_2.col1
    AND (
    CASE
    WHEN :P200_LIST_ALPHA = 'less' AND NVL(TO_COL_WITH_ALPHA, 0) < 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'equal' AND NVL(TO_COL_WITH_ALPHA, 0) = 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'above' AND NVL(TO_COL_WITH_ALPHA, 0) > 10 THEN 1
    WHEN :P200_LIST_ALPHA = 'indiff' THEN 1
    ELSE 0
    END = 1 )
    AND
    ( CASE
    WHEN :P200_LIST_BETA = 'active' AND TO_COL_WITH_BETA IN ( 'a', 'A', 'akt', 'AKT' ) THEN 1
    WHEN :P200_LIST_BETA = 'passive' AND TO_COL_WITH_BETA IN ( 'p', 'P' ) THEN 1
    WHEN :P200_LIST_BETA = 'excluded' AND TO_COL_WITH_BETA = 'X' THEN 1
    ELSE 0
    END = 1 )
    ;Edited by: wucis on Oct 24, 2011 4:09 PM

  • Case statement on Variable SSIS

    Hi friends,
    I have a small issue in my package I would like to write a case statement on Variable or Column in derived column Transformation
    I was using forloop container that pulls the data from different database so the database names also loading into table under one of the column but I wanna load with integer value instead database name
    for example
    Database A -- 1
    Database B -- 2
    so I would like to write a case statement on variable or column but It was not allowing me to write when I tried.
    what I have tried was I took one derived transformation and added one new column and passed that variable to that new column.
    then again I took another derived transformation here I was trying to write case statement on the colum which is belongs to previous derived column.
    Derived Column Tran 1:
    Derived Column Name         Expression                        DataType
    RegionID                           @[User::InitialDB]        Unicodestring[DT_WSTR]
    Derived Column Tran2:
    Can anyone please check and guide me the solution please.
    Thanks for your help

    Hi BandSr,
    You were close, just missing the false part in your second conditional operator.
    [RegionID] == "KAPS" ? "1" : [RegionID] == "LAPS"? "2" : ""
    In fact, I won't call that a Case statement but rather a nested conditional expression.
    Hope this helps.
    ~ J.

  • StackOverflowException compiling 8000 source file

    I am trying to compile a source file with ~8000 lines. It has many (hundreds) of static members (instances of that class), and methods containing conditional statements to take a string and return the instance of that name. This is generated code, so I do not think I can change it.
    Every time I try to compile it with Maven (Sun JDK 1.4.2_05) I get a java.lang.StackOverflowException. I have tried giving Maven more stack memory via the -Xss option (as much as 10m per thread), but that didn't help at all.
    I commented out 90% of the code and it works fine, so I know it is the size that is the problem.
    Has anyone had to deal with something like this before? If so, how did you fix it?

    Thank you to everyone who has replied. After some experimentation I discovered that the problem is not the 800+ static objects being created - it was the 1000's of lines of nested conditional statements. The generator has been modified to make if, if, if... instead of if, else-if, else-if, ... and all is well. :)
    I do not believe any sort of hard limit was reached, b/c Eclipse had no problem with the file. Also, one of our projects has a source file with 12k lines, and it works fine (though it has a different structure).
    I find it interesting that people are being so critical about the generator, especially since this is only one small piece of its modelling. The generator does far more than just create the key types and values.
    Furthermore, I don't understand the criticism of the code as-is. No, it's not something I'd write myself, nor would I wish to maintain such code - but no one has to! That's what the generator is for. If I want to add or delete a key type/value, I do so in the generator, and then regenerate the code.
    I also don't understand why anyone thinks this code is not object-oriented. Perhaps I just didn't explain it well. All classes representing key types extend AbstractDiscreteValue, so there's inheritance. The reason why all the values exist as static (and final) instances is b/c we never need more than one instance of each value, the values are known at generation time, and all instances are immutable.
    How would any of you construct such a class? Keep in mind that maintenance is not an issue, and most key types (probably 95% or more) have fewer than a dozen values.
    Anyway, thanks again for the help.

  • Publication has failed

    In BPM studio 10g, a process has 4 interactive activities. After activity A, there is a conditional gateway. In each brunch, there is an interactive activity. Then, it is the final interactive activity.
    I set the runtime property of all activities to user select transition. However, it shows error as follow:
    The project publication has failed. Reason: This activity has the user select transition property enabled and has outgoing transitions with measurement marks or outgoing tranitions that target a conditional activity.
    Then, I unselect the select transition of activity 1. It works.
    However, the participant of the activity 1 cannot select the participant before send the activity.
    How to let the participant of the fist activity can select the participant before sending?
    Thanks

    Hi Ye,
    Others will disagree (and rightly so), but I don't use Conditional activities (commonly referred to as "Decision Diamonds) very often. Typically I'll just have the transitions that would have come out of the Conditional activity instead come directly out of the preceding activity. While business analysts who use Conditional activities are modeling processes correctly and in accordance with what industry pundits like Bruce Silvers would prefer seeing, my personal feeling is that their use just adds clutter to a process. There's an elegance to a well designed business process. I always strive to keep them as simple and as understandable as possible to both the business and IT.
    I'll use Conditional activities in two cases:
    1) When the business is more familiar with Condtional activities and have used them extensively when modeling processes in the past using process modeling tools (e.g. Visio). If they're used to seeing Conditional activities, not using Conditional activities would be a distraction that some business analysts or business people would find annoying.
    or
    2) When I have a process design pattern where there are nested Conditional activities. For example:
    <pre class="jive-pre"><p />
    "Activity A" -> Conditional -> "Activity B"
    V
    "Activitiy C" -> Conditional -> "Activity D"
    V
    "Activity E"</pre>
    Here, the work item instance flows from A to either B or C. If it goes to C then it either flows to D or E. While having Conditional activities for this use case is not essential (again - you could have the transitions come out of A and C directly), it makes the process easier to understand for business analysts and the business. I think not having the Conditional activities here makes the process look a bit like an electronics wiring diagram.
    Hope this helps,
    Dan

  • Decode and Ifthenelse

    Hi Experts,
                    I would like to know the functioning of decode and ifthenelse functions. Which one is faster. Is there difference in the performance of these two.
    Thanks & Regards
    Alex Oommen

    Hi Alex,
    ifthenelse function Allows conditional logic in expressions Returns one of the values provided, based on the result of condition. The data type of the return
    value is the data type of the expression in true_branch. If the data type of false_branch is not
    convertible to the data type of true_branch, Data Services produces an error at validation.
    decode returns the value associated with the first condition that evaluates to TRUE. The data type of the return value is the data type of the first expression in the condition_and_expression_list. If the data type of any subsequent expression or the default_expression is not convertible to the data type of the first expression, Data Services produces an error at validation. If the data types are convertible but do not match, a warning appears at validation.
    The decode function provides an easier way to write nested ifthenelse functions. In nested
    ifthenelse functions, you must write nested conditions and ensure that the parentheses are in the
    correct places, as the following example shows:
    ifthenelse ((EMPNO = 1), '111',
    ifthenelse((EMPNO = 2), '222',
    ifthenelse((EMPNO = 3), '333',
    ifthenelse((EMPNO = 4), '444',
    'NO_ID'))))
    In the decode function, you list the conditions, as the following example shows. Therefore, decode is
    less error prone than nested ifthenelse functions.
    decode ((EMPNO = 1), '111',
    (EMPNO = 2), '222',
    (EMPNO = 3), '333',
    (EMPNO = 4), '444',
    'NO_ID')
    Regards,
    M Ramesh

  • Custom step description

    When creating a custom step type, what do I need to enter in the "Step Description Expression" box to display the "operation" and "route(s) to connect/disconnect" the programmer has entered in the switching tab properties of each step?
    This custom step is only switching so i don't want to have to open the properties dialog and look at each step to find out what it is switching.
    Thanks,
    Jason
    Solved!
    Go to Solution.

    Hello Jason,
    In the "Step Description Expression" box you could do something like:
      "Operation: " +
        Step.TS.SwitchEnabled ?
            Step.TS.SwitchOperation==1?
                "Connect " + " | Route(s): " + Step.TS.RouteGroupConnect:
                    Step.TS.SwitchOperation==2?
                        "Disconnect"+ " | Route(s): " + Step.TS.RouteGroupDisconnect:
                            Step.TS.SwitchOperation==3?
                                "Disconnect All":
                                    Step.TS.SwitchOperation==4?
                                    "Connect/Disconnect" + " | Route(s) Connect: " + Step.TS.RouteGroupConnect + " | Route(s) Disconnect: " + Step.TS.RouteGroupDisconnect:
                                        "Error" 
        :"Switching not enabled"
    It is a bit confusing because SwitchOperation is a number that corresponds to an operation so that's why we have the nested conditional statements.  
    Let me know if you have any questions.
    Kristen
    National Instruments

Maybe you are looking for