Groovy expression to return a string.

Version 12.1.3

I got this groovy expression that evaluates to true or false
don't #{pageFlowScope.userName, null}

How to rewrite, so that it returns a string when it is false?

Thank you

I think it's just EL, not Groovy.

#{pageFlowScope.username == null? {"it was null": 'it was not null'}

Tags: Java

Similar Questions

  • execution of groovy expression based on a condition

    Hello

    I'm on jdev 11.1.2.4 and MySql db.

    I use under groovy expression to get the domain in my name of the VO. area is a temporary variable.

    key oracle.jbo.Key = new oracle.jbo.Key (AreaId);

    Return LookupAreaVO1.findByKey(key,1) [0] .getAttribute ("AreaName");

    It works very well if there is a value in AreaId. However, he throws a NPE when there is no value.

    How I can only run this code if AreaId has value?

    It works very well if there is a value in AreaId. However, he throws a NPE when there is no value.

    How I can only run this code if AreaId has value?

    Add an if to test the value AreaId.

    If (AreaId! = null) {}

    key oracle.jbo.Key = new oracle.jbo.Key (AreaId);

    Return LookupAreaVO1.findByKey(key,1) [0] .getAttribute ("AreaName");

    }

  • How to call a method defined in AppmoduleImpl using a groovy expression?

    Hi experts,

    With the help of jdev 11.1.1.5.0 - adfbc battery.

    I followed this post as the blogger says.
    How to call a method defined in AppmoduleImpl using a groovy expression?
    https://blogs.Oracle.com/ADF/entry/how_to_call_a_method

    While a button insert hit

    Suite error survey.
    java.sql.SQLException: ORA-20483: ADM-
    ORA-06512: at "RMSTD.FUNC_FIND_PLNT_DESC", line 22
    ORA-06512: at line 1
    
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
         at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
         at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
         at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
         at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
    It is my code for the function.
    CREATE OR REPLACE FUNCTION func_find_plnt_desc (
       p_bu        VARCHAR2,
       p_plnt_id   VARCHAR2,
       p_lang      NUMBER
    )
       RETURN VARCHAR2
    IS
       CURSOR cur_find_plant
       IS
          SELECT bup_name1, bup_name2
            FROM bus_unit_plants
           WHERE bup_bu = p_bu AND bup_plant_id = p_plnt_id;
    
       rec_find_plant   cur_find_plant%ROWTYPE;
    BEGIN
       OPEN cur_find_plant;
       FETCH cur_find_plant INTO rec_find_plant;
    --RAISE_APPLICATION_ERROR(-20999,P_BU||P_PLNT_ID);
       IF cur_find_plant%NOTFOUND
       THEN
    
          raise_application_error (-20483, 'ADM' || P_PLNT_ID ||'-'||P_BU);
          --NULL;
       END IF;
    
       CLOSE cur_find_plant;
    
       IF p_lang = 1 THEN
          RETURN (rec_find_plant.bup_name1);
       ELSIF p_lang = 2 THEN
          RETURN (rec_find_plant.bup_name2);
       END IF;
    END;
    /
    Reason behind:
    while hitting the insert means null from the value of the survey so error function.

    If am not hitting doesn't mean no problem. the function works correctly return description.

    can someone help me how to override?

    Published by: ADF7 on April 10, 2012 23:51

    ADF7,
    the subject of the post has nothing to do with the question (for as far as I see it).
    As you can see the error message clearly comes from the procedure pl/sql you call the application module, works of groovy appeal method.

    We cannot decide what makes your service if you pass null as a parameter. You can check the settings before you proceed to the procedure or write the procedure in how it treats null parameters.

    Timo

  • can I return a string in a custom dialog box created with app.execDialog ()?

    Adobe LiveCycle Designer Cookbooks by BR001: using app.execDialog () in a form in Adobe Designer

    I am the above post and try to do the following:

    Capture.PNG

    I want to write the output of one of the selection of list to PDF dialog box, what I'm going to script?

    Something like document. Write() in Javascript (see: http://www.tutorialspoint.com/javascript/javascript_dialog_boxes.htm ). I tried to use document. Write() in the script dialog box, but it doesn't seem to work.

    Or can the dialog box return a string value?

    According to the PDF example in the first link, this dialogObject is what is returned when you see a dialog box:

    var dialogObject = {}

    DS1: ({}),

    execDialog: function() {}

    Return app.execDialog (dialogDescriptor);

    },

    selectedItem: {function (control)}

    If (typeof (control) = "string") {}

    control = this [control];

    }

    for (var control element) {}

    If (typeof (control [item]) = 'object') {}

    var r = this.selectedItem (control [item]);

    If (r! == undefined) {}

    Return r;

    }

    } else {}

    If (control [point] > 0) {}

    Returns [dot] control;

    }

    }

    }

    },

    };

    Return dialogObject;

    Hello

    Yes it is possible, by removing the execDialog() function and call the just before execDialog the dialogObject return, you call the dialog box to be executed directly in the service, so if you start a string on the top of the function and the validation value you set the string value of the item found in the list box then you will be able to return the value of the string instead of the dialogObject...

    Here is a short example:

    dialog() {} function

    var strValue = "";

    var dialogDescriptor =

    {

    Description:

    {

    align_children: "align_row."

    items:]

    {

    type: "display."

    align_children: 'align_left,

    items:]

    {

    type: 'edit_text. "

    item_id: "txt1"

    Width: 300

    },

    ]

    },

    {

    type: "ok_cancel."

    }

    ]

    },

    validate: function (dialog)

    {

    No validation required

    Returns true;

    },

    commit: function (dialog)

    {

    elements var = dialog.store ();

    strValue = items ["txt1"];

    },

    };

    var dialogObject =

    {

    execDialog: function() {return app.execDialog (dialogDescriptor);},

    //...

    };

    app.execDialog (dialogDescriptor);

    return strValue;

    }

    Hope this will help you

  • Error with groovy expression of sequence number of EO attribute assignment?


    Hello world

    My version of Jdeveloper is 11.1.2.3.0.
    Starting from this post: https://tompeez.wordpress.com/category/adf/page/6/
    I found to add a groovy expression for the sequence number to my attribute. I created a single sequence and added that the groovy expression to my attribute but got the error below:

    Utils > < buildFacesMessage > ADF: addition of the following JSF error message: failed to start, bc4j_model_TestEntityObject_Empno_null_gs.groovy: 1: lack of hook closing ' > ' for generic types.
    solution: Please specify the missing support! @ line 1, column 12.
    1 error

    org.codehaus.groovy.control.MultipleCompilationErrorsException: failed to start, bc4j_model_TestEntityObject_Empno_null_gs.groovy: 1: lack of hook closing ' > ' for generic types.
    solution: Please specify the missing support! @ line 1, column 12.
    1 error

    Note: groovy expresion used in my EO attribute is given below:
    (new class < SPAN > 'skimlinks-fidget' = > oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ())) .getSequenceNumber </span >)

    also used:
    (new class < SPAN > 'skimlinks-fidget' = > oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ()) .getSequenceNumber () </span >

    What can be the problem?
    Please give me your valuable contributions...


    Thank you.

    Sorry, somehow the code in the blog is messed up. Use

    (new oracle.jbo.server.SequenceImpl ("SampleSeq", adf.object.getDBTransaction ()) .getSequenceNumber)

    Where SampleSeq is the name of the sequence defined in the comic book.

    Timo

  • Groovy expression in the output text

    Hi all

    I want to use groovy expression in the output as text

    < af:outputFormatted value = "#{adf.currentDate}" id = "2" / > "

    < af:outputFormatted value = "#{adf.userSession.userData.user}" id = "2" / > "

    but the values are not seen at the exit and the value to the property inspector area becomes red...

    This is because groovy can be used on the side of the model. For the user interface, you use the expression language.

    For the user, you can use adfsecurity information (control http://docs.oracle.com/cd/E14571_01/web.1111/b31974/adding_security.htm#CHDFFGDJ)

    To date, you must implement a bean method that you call via EL.

    Timo

  • problem in the groovy expression

    Hi all
    I have three attributes: "WorkDateFrom", which is of type Date and "Working days" which type number and "WorkDateTo", of type Date.

    the value of 'WorkDateTo' must be
    WorkDateFrom+WorkDays
    After the execution of the Application Module to test. I write the value of "WorkDateFrom" and the value of "Working days", the WorkDateTo value will be zero.
    This expression is wrong?

    Just tested on the opinion of the employees in the HR schema. My groovy expression

    HireDate+DetartmentId.intValue()
    

    Displays the correct result. So, if your WorkDateFrom is of type Date and days of work is of type number and then

    WorkDateFrom + WorkDays.intValue()
    

    should work. Always check null values.

    Timo

  • WebService returning a string

    Maybe I should know this, but:

    I call a method of a Web service that returns a string. Works very well.

    The string is basically an XML document, but how do I use these data (the string returned by the call) or place these data in a properly formatted XML file? Because right now I'm back a long chain... It is an object, but I want it to be XML.

    See this FB 2.0.1 help topic:
    Manipulation of the results in XML format with the e4x result format

    http://livedocs.Adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=live Docs_Book_Parts & file = dataservices_099_17.html

    <>
    ID = "WS".
    destination = useProxy "stockservice' = 'true '.
    Fault = "Alert.Show (Event.Fault.FaultString), 'Error'" > "


    ADBE


  • Regular expression for middle of string

    Little background. I get the data (only the numbers) and text (can contain numbers) series. Since I don't know which I get and when it starts / ends, I do the sender send 'textSTART ###textSTOP' where ' # ' is what I want to extract. # can contain text, numbers, new line, carriage return or whatever.

    The same for the data : "dataSTART ###dataSTOP", where # contains only numbers.

    I think I should use the match pattern, but I don't know how to make my regular expression.

    Any help is appreciated.

    There are many solutions if you want to only extract the string between your specific delimiters. Here's a solution:

  • How to manage a transitional calculated attribute in my vo than sometimes groovy expression of null values?

    Mr President

    My worm jdev is 12.2.1

    In my transient VO sometimes attribute I have null values in the expression groovy

    (Purqty*Unitpurprice)+ (Purqty*Unitpurprice)*Staxrate/100
    

    Some products have sales tax rates, and some have Staxrate NULL.

    And I get the following error because of this.

    NULL ERRORS.png

    My question is that how to avoid this error.

    Concerning

    You can do a null control in your expression.

    If (Staxrate! = null & Salestax! = null) {}

    Return ((Purqty*Unitpurprice) + (Purqty * Unitpurprice) * Staxrate/100)

    }

    else {}

    Returns 0

    }

  • Groovy Expression not worked on jdeveloper 11.1.1.7.0

    Hi Experts,

    In my case, I created a simple display object which have variable bind. I'll put the link using Expression Groovy variable value.

    <Variable
        Name="empcode"
        Kind="where"
        Type="java.lang.String">
        <TransientExpression><![CDATA[adf.context.sessionScope.get('empcd')]]></TransientExpression>
      </Variable>
    

    but when I run the program in the module of application I get following error

    (oracle.jbo.jbotester.ErrorHandler$ ExceptionWrapper) Houston-29000: Unexpected exception caught: java.lang.NoClassDefFoundError, msg = Loracle/jrf/ServerPlatformSupport;

    Use same case worked on jdev 11.1.1.5.0 version but in the fact that this version error has occurred.

    My question is is this a bug on the jdev 11.1.1.7.0 version and what is the solution of this problem?

    Thank you

    Manish

    If you set the value to UserData with key 'empcd', you can access fi groovy with: adf.userSession.userData.empcd

    Dario

  • Groovy expression to create a range of business rules

    Hello

    JDev 11.1.2.4

    I need to check if a date is between now and 6 months ago. I created a range validation rule, I put the maximum value of adf.currentDate. I need to do the same for the minimum value.

    What is the groovy syntax on 6 months ago?

    Thank you

    Something like this perhaps? (You can add this as the groovy for the attribute expression end date).

    import java.util.Calendar;

    Calendar cal = Calendar.GetInstance ();

    Cal.Add (Calendar.MONTH,-6);

    Return cal.getTime ();

    Arun-

  • Groovy expression session bean managed property

    Hi all
    I can't establish the expression of right groovy for obtaining a value of session...
    <managed-bean>
        <managed-bean-name>user</managed-bean-name>
        <managed-bean-class>ro.sinoptix.view.managed.User</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
    in my VO...
     <Variable
        Name="pid"
        Kind="where"
        Type="java.lang.String">
        <TransientExpression>
          <![CDATA[sessionScope.user.id]]>
        </TransientExpression>
      </Variable>
    and the error is... Variable sessionScope unrecognized... session does not work

    Thank you
    PS: where can I find something on groovy in adf?

    You can't do that. Managed bean reside only on the side of ViewController. You do not have access to them in the part of the model.
    Expose a method in your module to request to put value on the client side to side Server and y. Alternatively, you can pass the value as a parameter to a method in the t that can then work with it.

    Timo

  • Series read returns the string with excess-need information to extract data from the middle of the string

    I read data from a STI flow meter using the base series writing and reading which used the VISA.  The read string begins with 'OK' or an error code, then a carriage return, then the data follows streaming rate temp pressure flow rate comma comma comma comma Temp... and so on. The string ends with a CR LF.  I need to pull the flow, temperature and pressure data out of the string and write it to a file.  I have difficulties to find a function that will retrieve the data for the string.  Any suggestions?  Thank you.

    Try the subset of string in the palette of the chain.

    Or match the model if you want a more direct control.

    Also a good way is the string analysis, but you must be willing to read oexactly, what happens or an error, pass the entrance.

  • Value of the EL Expression always return false

    Hello

    I use JDEV 12.1.3

    I have it here's the expression where it always returns false? Why? I set the value always true

    #{ApplicationParameter.isShowLetter}

    Java class:

    public class ApplicationParameter {}

    Private boolean isShowLetter = true;

    {} public void setIsShowLetter (boolean isShowLetter)

    this.isShowLetter = isShowLetter;

    }

    public boolean isIsShowLetter() {}

    Return isShowLetter;

    }

    JSPX:

    "http://Java.Sun.com/jsp/page" version = "2.1" xmlns:f ="http://java.sun.com/jsf/core"

    xmlns:af ="http://xmlns.oracle.com/adf/faces/rich" >. "

    Bean code:

    package com.avio.otn;

    Import org.apache.myfaces.trinidad.event.AttributeChangeEvent;

    public class MyBean {}

    Private boolean showLetter = true;

    public MyBean() {}

    }

    {} public void setShowLetter (boolean showLetter)

    this.showLetter = showLetter;

    }

    public boolean isShowLetter() {}

    System.out.println ("show:" + showLetter);

    Return showLetter;

    }

    }

    Taskflow recording of the bean:

    MyBean

    com.avio.otn.MyBean

    pageFlow

    And everything works as expected... If I put real, this one appears fine, set it to false, it disappears...

    HTH

Maybe you are looking for

  • Open a new empty window without address bar, the buttons or tabs

    I am the creating an add-in and how to create a blank window with nothing in it, I can not solve. Address, bar buttons, tabs etc. As a window that uses the bookmark manager. Any help would be appreciated.

  • mail for Mac

    was just looking at my mail, receipt of mail is OK, but when I went to send mail, it is said, "cannot send message using the server...". "and it highlights my server and says it is offline, but I am able to receive mail. POP is online but the smtp is

  • HPSF.exe has encountered a problem and needs to close

    using pavilion hp Elite desktop, windows 7 Edition 150ff Home premium, receive a HPSF error message. EXE has encountered a problem and needs to close. I tried to download it again from the HP website, but I get a message saying "your system does not

  • less red sign on the main screen

    How can I get the Red minus sign off the main screen that appears next to the battery icon?   something with expired subscription? Thank you

  • recovery of Favorites and bookmarks

    I work in a system recovery to a desktop pc with ms vista home premium 64-bit OS. the system would not start after months of get slower and slower boot times.  tried to do system recovery when finally be able to start the system but when choosing a b