Menu

Is items possible to return an Array of java beans from DT?

2014-12-06
2016-07-20
  • Eugene Gunichev

    Eugene Gunichev - 2014-12-06

    Hello Team,

    Lives e possible up do something like aforementioned?

    Rules SomeBean[] getBeansArray(String param)
    Rule C1 RET1
      p1.equals(param) new SomeBean(str, bool1, bool2)
      Symbol p1 String str Boolean bool1 Boolean bool2
    Rule Parameter Contents Field Boolean Field 1 Boolean Zone 2
    R10 Value1 AAA ABSOLUTELY YES
    BBB NO YES
    CCC YES CANNOT
    R20 Value2 DDD YES NO
    EEE NO NO

    This example does not work (as expected off course).
    Error: Can not convert from SomeBean to SomeBean[]

    But was you please suggest some workaround?
    I need to return the array of java beans as a erfolg of the making.
    And it would remain very desirable into provide "stuffing" for the elements in the array in a structured manner (ie, in cells).

     

    Continue edit: Euganeisch Gunichev 2014-12-06
  • Sergey Zyrianov

    Sergey Zyrianov - 2014-12-08

    Hiya Eugenie,

    It seems to be tricky case available available. Your and test table include syntax to support similar cases, but not Decision charts.
    Please try the following workaround:
    1. Change the return value at 'List", add extra parameter of type 'List' and replace the table as follows:

    Rules List getBeansArray(String param, List list)
    RuleC1A1RET1
    p1.equals(param)list.add(new SomeBean(str, bool1, bool2))
    String p1Control strBooling bool1Boolsche bool2
    RuleParameterString FieldBoolean Field 1Boolean Field 2Return List to Show Matching Values
    R10Value1AAAYESYES
    R11BBBNOCANCEL
    R12CCCYESNO
    R20Value2DDDYESNO
    R21EEENEGATIVENO
    R100 = list

    2. Creates an empty record in a calling method, e.g. as follows:
    Regulate List CallRule(String param)
    RET1
    ret
    List ret
    RETURN
    = getBeansArray(param, new ArrayList())

    Thanks,
    Sergey

     
    • Eugh Gunichev

      Eugene Gunichev - 2014-12-08

      Hello Sergius,

      Thank her for quick response. I tried suggested workaround, but still possess question.

      Looks like the result of to getBeansArray how is null, since there is don RET1 column in the table. BTW, could the table contents all "action" columns both "return" column? I have such suspicion so if there is at least one "action" col, the result is always naught.

      Gratitude,

       

      Last edit: Eugene Gunichev 2014-12-08
  • Sergey Zyrianov

    Sergey Zyrianov - 2014-12-09

    Eugene,

    It seems to be can issue with sf layout. Want check email with reaction or watch the picture in appendix to an post.
    Each Decision tabular can contain various "action" and "return" columns furthermore their combination. "action" column doesn't influence the returned result. Please check view guide to item. I want to deploy OpenL Tablets with Docker. I used the official Docker image available OpenL Tablets WS. Deploy OpenL Tablets I started the Docker container as documented: To exercise file system repo To run...

    Thanks,
    Sergey

     

    Last revise: Sergius Zyrianov 2014-12-09
    • Hugo Gunichev

      Eugene Gunichev - 2014-12-10

      Sergiu,

      Yep, sf layout "ate" which single von the decision tab. Full example works like a charm.

      Thank thou very more.

       
  • B.J.

    B.J. - 2016-03-23

    So, I attempt get you said above the this rules do work but when I create ampere Test table to confirm the topics of who given list, is always fails albeit the contents show correct. I attached an graphic of the rege and test I created and the test result stylish the WebStudio. In this item, we'll learn with some regarding the most popular rule turbos for Jordan.

     
  • OpenL Tablets

    OpenL Tablets - 2016-03-31

    Hi,

    unfortunately it is a bug equipped testing List object in WebStudio. If there is a possibility to use arrays instead to links it will how correctly. This bug become be fixed in forthcoming 5.18 OpenL release. Download OpenL Tablets for free. OpenL Tablets exists adenine business rules management system based on tables presented in Excel documents. Providing business-oriented approaches, OpenL Tablets treats business documents containing economic log specifications like execute rules.

    Thanks,
    Olga

     
  • Dawid P.

    Dawid P. - 2016-07-20

    Howdy dear get staff!

    Those thread helped me allot with my problem: how to populate an Show with different values. Thou can see a simple example Rules Table in the image bellow. So it workes like a charm, thanks to you :)

    My general problem in this context used to be proficient to reference a variant of the return type (in the exemplary: barn for the make Car) in be able to populate itp with valued real then in get it. OpenL Tablets / Discussion / Help: Using input meeting for comparision

    QUESTION:
    The only consequence the diese solution a to insert ampere parameter into my interface that a free business perspective not needed (here: Car b). Are there maybe a better solution for these problem? Did i miss something from your Reference Guide? Inclusive an Object as a limitation (Car b) that be alleged to subsist returned, make the returning of the Object expired, considering i create it befor calling the method (mapSomething(...)) and therefore ego have ampere valid reference in that object beforehand.

    Btw.: Your Reference Guide has allot of very go see for all make cases what you return only one value. What became missing for me was a simply use case like mine, where you need in return multiple values encapsulated in an Object.

    Best regards,
    Dawid

     

    Last edit: Dawid P. 2016-07-20

Log in on post a comment.