Programmatically disable "mandatory business rule"

Hello,
Using jdevelopper 11.1.2.3.0 and HR schema, there is my use case :
An entity object (Departments) with an attribute (DepartmentId) checked as "Mandatory". A java entity object class (DepartmentsImpl.java). In this java class, create() and doDML() methods overriden :
    protected void create(AttributeList attributeList) {
        super.create(attributeList);
        AttributeDefImpl attr = this.getEntityDef().getAttributeDefImpl("DepartmentId");
        attr.setMandatory(false);
    protected void doDML(int i, TransactionEvent transactionEvent) {
        AttributeDefImpl attr = this.getEntityDef().getAttributeDefImpl("DepartmentId");
        this.setAttribute(attr.getName(), 66);
        super.doDML(i, transactionEvent);
        attr.setMandatory(true);
    }What I want is to programmaticaly disable the "mandatory business rule" for DepartmentId attribute, because this attribute's value is programmatically set just before calling doDML().
Problem : "attr.setMandatory(false);" seems to do nothing. In validation time, the mandatory business rule is working.
What AttributeDefImpl.setMandatory() method should do? Or, what should be the right way to programmatically disable a "mandatory business rule"?
Thanks.

Nirav, reading your post, I realized that "mandatory" propertie is part of attribute definition. So I have try calling setMandatory() method in EntityDefImpl. I found a method loadAttribute() that I have overriden :
    protected void loadAttribute(DefElement defElement) {
        super.loadAttribute(defElement);
        AttributeDefImpl attr = this.getAttributeDefImpl("DepartmentId");
        if(attr!=null){
            System.out.println("DepartmentId found! after super");
            attr.setMandatory(false);
    }Changing the mandatory propertie here works fine. But, it is not suitable solution for me, because the entity definition is done just once : first time a user implement the entity object.
You suggest me to do this when AM is initialized : I haven't try yet, but I think I will have same problem, because when the entity definition is done once, it will never been redo later. (That is what I understand during my tests. Maybe I'm wrong?)
Timo, I can't simply remove the mandatory flag from the attribute, because in our application, user must be abble to choose if an entity pk is auto generated or not. (and that implies that pk attribute, checked as mandatory, could be programmatically changed to false).
There is something I don't understand : calling setMandatory() in EntityImpl.create() method has no effect. But, in same maner, if I call setUpdateableFlag(), thiw will have effect. Both method are changing Entity Attribute Definition. So why setMandatory() will have effect only during the first definition of Entity, and setUpdateableFlag() will work all the time?
Thanks for your help.

Similar Messages

  • How to get rid of Business Rule in JhsModel: JHS-00128 Allowable Values req

    JHeadstart 10.1.3.2
    We are using FlexItems in our application.
    The JhsModel implementation, shipped in Jar file jhsadfrt-10.1.3.jar, contains the underlying ADF BC objects for the FlexItem functionality.
    When we try to create (or remove) a FlexItemDefinition of type Dropdown List, we are stopped by the error: JHS-00128: Allowable Values are required for this Item Display Type.
    We do not want that - we have a UID that does not allow editing of master and details on the same page. Therefore, we will never be able to successfully create a dropdown list item since we cannot in the same transaction create the allowable values as well.
    How could we disable this business rule - or remove it altogether? I suppose it is implemented somewhere in the jar file that contains the JhsModel project. What is the recommended way of disabling this constraint?
    thanks for your help
    Lucas

    Hi Lucas,
    This error is raised if the number of allowable values is zero and the allowable values query of the flexitemdefinitions entity is 'empty'. You could write a (temporary) dummy allowable values query in the flexitemdefinitions entity in order to save the master, and then once you've input the allowable values in the details page, remove or reset the value in the allowable values query attribute of the flexitemdefinitions entity.
    Hope this helps,
    Regards,
    Ibrahim

  • Validate data - business rules.

    Hi,
    We're using CDM Ruleframe to implement our business rules. As there was a need to bulk load a bunch of data, I disabled the business rules temporarily using the procedure disable_all_br.
    Is there a way to find out (afterwards) which of the records are in conflict with one or more business rules? I now that it can be checked for the static business rules via the procedure validate_all_statis_br, but what about the dynamic ones?
    Your replies are highly appreciated.
    Best regards,
    Nancy.

    Hi Vijay,
    just to make sure that I understand your scenario correctly:
    You import some business data in a table into the BRF+ (e. g. column1 = country, column2 = city ...). Now you want to process the lines of the table via a decision table namely one column (i. e. the corresponding business data) is equal to a condition column in your decision table (e. g. one condition  column = country).
    If this is the case I am afraid that there is no other option than to loop over your table with the data and evaluate the line with the decision table.
    Concerning your performance problems:
    In general there are a lot of notes that optimize the performance for the processing of decision tables, see these blogs:
    Great Performance Improvements in NW DSM/BRFplus
    Notes for Performance Optimization in BRFplus
    When you have your decision table in single match mode (so when the first matching entry is hit, the processing of the decision table stops and the result is returned) you can tune the performance be rearranging the row so that the ones that will match most propably are at the top of the decision table.
    Maybe there are combinations of data in your input that do not need to be processed in the decision table (I do not know your scenario, but theoretically that is possible) so perhaps you can reduce the amount of data that has to be processed by excluding these entries in the loop
    Hope that helps
    BR
    Christian

  • Is it mandatory to Restart all services after making Business Rule change?

    Hi,
    I know it may be a easy one but wanted to know is it mandatory to restart all the Planning and Essbase services if we make any changes in the Business rule
    in 9.3.1
    -KP

    No you shouldn't have to restart after rule change.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How do I disable a CAPI business rule?

    I have a capi business rule that requires that an order have at least one order line. The business rule is on both the order and the order line table.
    I have written a procedure which must insert a record into the order table and a record in the order line table but of course the constraints restrict me.
    I can disable the insert triggers on the two tables and that will work but I was wondering if there was another way of doing this without interfering with the TAPI.
    Does anyone have an example you could send me?
    Also, I have noticed the TAPI triggers use an indicator for the table columns which can be set to TRUE or FALSE, where can I find information on the use of the indicator parametre?
    I would appreciate any direction and help you may have to offer.
    Lise McGillis.

    I think your problem is that TAPI triggers are opening and closing RuleFrame transaction and the BR fails immediately when you insert the record in master table (orders).
    You don't have to disable TAPI triggers nor business rules!
    You just have to open the RuleFrame transaction explicitly, make the DML operations (insert, update, delete), and then close the transaction. In that way, the business rules are being checked at the end of the transaction (when you call close_transaction). TAPI triggers will know that the RuleFrame transaction is already opened and they will not try to open or close another one.
    Here's the sample code:
    begin
    qms_transaction_mgt.open_transaction( p_trans_opened_by => 'XYZ' );
    insert into orders ...
    insert into order_lines ...
    qms_transaction_mgt.close_transaction( p_trans_opened_by => 'XYZ');
    commit; -- it is important that you close the transaction before commit
    end;
    Instead of 'XYZ' put a string that will be meaningful for you. It's only important that you put the same string in open_transaction and close_transaction.
    For more information about this, you can look at Headstart User's Guide, chapter 12.
    I hope that helps!
    Dalibor

  • Disable business rules after workflow promote

    Dear All,
    I have the following case:
    in capex module, after everything finished, the user then promote the budget.
    and that makes the data form read only. but in this case, because adding new asset is done by business rules, the user could still add new asset.
    is there anyone have a solutions or experience the same thing?
    Regards,
    Feri

    Ya that will be a tricky one.
    The only general comment is to build this into your process.
    So you will give everyone a window to add To Be Hires during 1 or 2 week period. Then you block everyone and remove the ability to launch the script. Then managers review. So this becomes disconnected from "workflow" the tool inside of Planning.
    You could build something but this would be way outside the out of the box process and I wouldn't want to go there personally. You would move the calc into a maxl script and build in code to validate against the workflow tables to see if the calc will work or not. This would require all sort of validate scripting and error handling and would require bring in some experts probably. The only other scenario is to troll the forums and maybe find someone how built something like this and get them to share their code.
    In principal what you want sounds obvious and make sense to be in the tool.

  • Business Rules Engine (BRE) is this really a true business user's tool?

    The primary need for business/information/non-technical users is to be able to create, edit, delete, enable, disable rules once developed (vocabulary) & deployed by the developer. Is it possible? If possible then how &
    by using which tool or UI of Biztalk server?
    For the batch process, if each input record from flat file can be match with the 50 million records in Sql server, then what would be the performance?

    What all needed at client machine to make use of Business Rules Composer for 10 machines?
    Non-technical users is able to create, edit, delete,
    enable, disable rules using Business Rules Composer, is it possible?

  • Why not allow Business Rule Design Transformer to overwrite existing BRDDs

    Hi,
    It can be quite annoying during development to continually having to remove the BRDD Trigger and PL/SQL Definition when running the BR Design Transformer reveals missing information in the BR Analysis definition. It seems that it would be practical to have at least the option to have the Business Rule Design Transformer overwrite an existing Business Rule Design Definition.
    You could think of an additional parameter in this utilily labeled "Overwrite existing BRDD?" with allowable values Y(es) and N(o) with No as default (so that the default functionality is the same as before).
    Below you find the code that can be added to the HSU_BRTR package to realize such a functional improvement. Maybe you can consider it for a next release...?!
    best regards,
    Lucas Jellema
    AMIS Services BV
    code to add to HSU_BRTR to provide a parameter that allows the user to specify whether or not the HSU_BRTR is allowed to overwrite an existing BRDD:
    in the revision history:
    09-jan-2003 Lucas Jellema
    6.5.2.3AMIS1.1 Added new parameter and supporting code that allows user to indicate
    whether existing Business Rule Design Definitions may be/should be overwritten
    at the end of procedure install
    hsu_install.add_parameter
    ( PACKAGE_NAME -- package name
    , 40 -- sequence
    , 'Overwrite existing BRDDs?' -- prompt
    , 'N' -- default value actual
    , 'No' -- default value displayed
    , 'Y' -- mandatory
    , 'N' -- allow multi-select
    , 'N' -- include shared elements
    , '' -- element type short name
    , '' -- sql expression actual
    , '' -- sql expression displayed
    , null -- where clause
    , null -- synchronize with
    , null -- foreign key column
    , -- help text
    'Choose whether you want this utility to overwrite existing Business Rule Design Definitions.'
    hsu_install.add_allowable_value
    ( PACKAGE_NAME -- package name
    , 40 -- parameter
    , 1 -- sequence
    , 'Y' -- actual value
    , 'Yes' -- displayed value
    hsu_install.add_allowable_value
    ( PACKAGE_NAME -- package name
    , 40 -- parameter
    , 2 -- sequence
    , 'N' -- actual value
    , 'No' -- displayed value
    --------6.5.2.3AMIS1.1
    Just before procedure transform_stage2
    procedure delete_brdds
    ( p_tbl_id in ci_table_definitions.id%type
    , p_br_name in varchar2
    -- Purpose Delete existing Business Rule Design Definition
    -- Usage from run procedure
    -- Remarks Find PL/SQl Module Definition based on Business Rule Label
    is
    cursor c_brdd
    ( b_tbl_id in ci_table_definitions.id%type
    , b_br_name in varchar2
    is
    select trg.id trg_id
    , trg.name name
    , plm.id plm_id
    from ci_database_triggers trg
    , ci_plsql_modules plm
    where trg.table_definition_reference = b_tbl_id
    and trg.plsql_module_reference = plm.id
    and plm.name = b_br_name
    begin
    -- loop over journalling busrules of this application
    <<brdd>>
    for r_brdd in c_brdd(p_tbl_id, p_br_name) loop
    -- delete busrule (delete of trigger is since 6i not enough anymore, so
    -- explicitly delete PL/SQL module also)
    bllog.write
    ( 'Deleting trigger '||r_brdd.name||' and PL/SQL module '
    ||hsu_name.get_name_and_path(r_brdd.plm_id)
    ||', a new business rule design definition overwrites this old one.'
    , bllog.information
    bltrg.del(r_brdd.trg_id);
    blplm.del(r_brdd.plm_id);
    end loop brdd;
    end delete_brdds;
    inside procedure transform_stage2
    (just before the comment: -- check if BRDD with this plm_name already exists)
    if p_overwrite_br = 'Y'
         then
    delete_brdds
    ( p_tbl_id => g_trg_tbl(i).tbl_id
    , p_br_name => l_plm_name
         end if; -- find_trg and overwrite =Y
    A new parameter in procedure transform_br_fun
    procedure transform_br_fun
    , p_overwrite_br in varchar2 default 'N' -- 6.5.2.3AMIS1.1
    use the parameter p_overwrite_br in the call to transform_stage2
    transform_stage2
    ( p_fun_id => p_fun_id
    , p_fun_label => r_fun.fun_function_label
    , p_fun_short_definition => r_fun.fun_short_definition
    , p_msg_prefix => p_msg_prefix
    , p_msg_language => p_msg_language
    , p_rule_type => l_rule_type
                   , p_overwrite_br => p_overwrite_br -- 6.5.2.3AMIS1.1
    new parameter p_overwrite_br in the procedure run
    NOTE: in both PACKAGE SPECIFICATION and BODY
    , p_overwrite_br in varchar2 default'N' -- 6.5.2.3AMIS1.1
    use the parameter p_overwrite_br in all calls to transform_br_fun inside procedure run
    transform_br_fun
    ( p_fun_id => r_fun_tree.id
    , p_msg_prefix => p_msg_prefix
    , p_msg_language => p_msg_language
    , p_create_att_usages => p_create_att_usages
    , p_overwrite_br => p_overwrite_br -- 6.5.2.3AMIS1.1

    Among the alternatives not mentioned... Using a TiVo DVR, rather than the X1; a Roamio Plus or Pro would solve both the concern over the quality of the DVR, as well as providing the MoCA bridge capability the poster so desperately wanted the X1 DVR to provide. (Although the TiVo's support only MoCA 1.1.) Just get a third-party MoCA adapter for the distant location. Why the hang-up on having a device provided by Comcast? This seems especially ironic given the opinions expressed regarding payments over time to Comcast. If a MoCA 2.0 bridge was the requirement, they don't exist outside providers. So couldn't the poster have simply requested a replacement XB3 from the local office and configured it down to only providing MoCA bridging -- and perhaps as a wireless access point? Comcast would bill him the monthly rate for the extra device, but such is the state of MoCA 2.0. Much of the OP sounds like frustration over devices providing capabilities the poster *thinks* they should have.

  • Problem starting Business Rule service ver 3.5

    Hi - I installed Business Rules ver 3.5.1 on our Windows Server 2003. I noticed the hbr service was not running, so I tried running the starthbr.bat file, but I got an error message: java.lang.ClassNotFoundException: com.hyperion.br.rmi.HBRImpl_stub (no security manager: RMI class loader disabled). The lines in between the "~" is what I am launching in the starthbr.bat file. I have the Classpath variable pointing to C:\windows\java\class, where there is a java folder containing other subfolders, like rmi are.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    rem This bat file is expecting to be run from the HBR\bin directory
    set CLASSPATH=%CLASSPATH%;.
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\activation.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\APBeans.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\common.zip
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\mail.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\Repos.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\ScriptGen.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\xerces.jar
    set CLASSPATH=%CLASSPATH%;E:\Hyperion\HYPERI~1\HBR\packages\RuleServer.jar
    set CLASSPATH=E:\Hyperion\HYPERI~1\HBR\packages\hbrrmi.jar;%CLASSPATH%
    start jview /p /d:java.rmi.server.codebase=file:/E:\Hyperion\HYPERI~1\HBR\packages/hbrrmi.jar/ /d:java.security.policy=./policy com.hyperion.br.rmi.HBRImpl
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Your response is greatly appreciated. Thanks.

    I uninstalled Business Reports and reinstalled it. HBR Service appeared in Services

  • Business Rules Security based on work flow

    Hello,
    How can we enable security on Business Rules, based on the workflow,
    for example,
    we have Business rule, that is attached to one input form, which opens a window for entering run time prompts for entering
    new asset details, and after entering he saves and the planning unit is promoted to next level,
    but on the input form, the Business rule is still visible, where by he can enter the the details though the planning unit is promoted,
    Is there any way that makes the Business rule access disables/hides as the planning unit is promoted?
    Thanks,
    murali.

    There is currently no out-of-the-box integration between workflow and business rule security.
    This thread may help with some alternatives:
    Workflow Problem
    - Jake

  • Exposing Oracle Business Rule As Composite Service

    Hi Gurus,
    I have created a simple business rule and exposed it as composite service(without using any BPEL process) and deployed it into server successfully.Now i want to call that Business rule as webservice in my BPEL process, but i am facing some issues like, have to provide values of some fields like NCName,some attributes under bpelInstaces.
    When i checked the Business Rule project in EMconsole,faced the same scenario.
    Question: is it mandatory to use BPEL process at the time of exposing Business Rule?
    Any suggestion is helpful to me..
    Thanks in advance
    Sharmistha

    Hi Sai,
    Thanks for the rply.
    Yes, The "Will be Invoked as A Web Service" property is "Checked" for Business Rule Decision Function and the service name is also available.
    when i am trying to get the wsdl of the web service it shows "Error 404-Not Found". (http://<host>:<soa port>/<service name>?wsdl)
    *[e.g http://<host>:<soa port>/OracleRules_WSTest_DecisionService_1?wsdl]*
    But the ruleset is available in the SOA Composer.
    Still facing the same problem, can't invoke the Business Rule in my composite as Web-service.
    Sharmistha

  • Exposing business rules as web services in 11g

    Hi all,
    I have deployed my business rules in Enterprise Manager, but the test button is disabled and I'm getting the next message: "In Enterprise Manager only can be tested composites that are exposed as web services". Does anybody knows how can I do that?

    There are a couple of ways you can do it.
    1. Drag a Web Service Adapter in the 'Exposed Services' panel in your composite and during configuration choose the WSDL of the Decision service i.e Rules. This will expose the rules as a web service if not already.
    2. Double Click on the Reference icon on the Decision Service component (small rounded blue arrow). An Update Interface window will pop up. Check box 'Create Composite Service with soap binding' and select the appropriate port type from the available list.
    You can now invoke your rule as web services and even test them from the EM console

  • Business Rule on View Object

    I have a View Object based on an Entity Object. I am trying to add an attribute validation on the view object from "Business Rules" section of View Object. However the "New Validator" action on the context menu is disabled. I could not find documentation on this. Is this not possible or am I doing something wrong?
    Regards
    Binuraj

    User, please tell us your jdev version.
    If your VO is based on an EO you can add rules for EO attributes in the EO only. If your attribute is a transient attribute in the VO you can add rules for this attribute in the VO.
    Timo

  • Business Rules API

    I would like to update existing business rule through my own API. How can I connect to the business rule engine from java code?
    Please help!

    Ok, so is it available elsewhere then?
    Basically what I want to achieve is to be able to share *.rule files between a customized Java Application which is able to do crud stuff for rule/dictionary definitions, and the SOA composer. The Java Application will be backed by some more metadata that will drive how to define rules...
    According to the docs I've read, you're able to do that in Java. But I can't seem to find in the API a way to export an existing RuleDictionary in memory. Also, is the RuleSession API + RL the only way to insert customized rules programmatically? I've seen this example plus the one that loads a RuleDictionary and executes a DecisionPoint. But I can't seem to fill the gap between the two. ( found DecisionPointInstance.ruleSession() - the docs said it was getRuleSession() )
    Lastly, is it possible to define a RuleDictionary from scratch just using Java API?
    Apologies if this is a mouthful :)
    Edited by: Jarell on Dec 8, 2010 1:16 AM
    Edited by: Jarell on Dec 8, 2010 2:35 AM

  • How to submit the Data with Business rule auto executed with VBA in excel?

    Anyone knows how can I submit the data into planning with the business rule auto executed in planning?
    Currently, I am using HypExecuteCalcScriptEx () + HypSubmitData() in my program that auto executed the business rule prior saving the data into planning.
    However when it try to run HySubmitData(), the Business rule window pops up again and ask user to run the business rule again.
    Therefore, is there a way that I can submit the data with auto execute the business rule?
    many thanks, highly appreciate !!!!!!

    Hi Rafeek,
    One solution is to set the column width after manually or programmatically refresh the PivotTable, for example:
    Private Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)
    Dim ws As Worksheet
    Set ws = Application.ActiveWorkbook.ActiveSheet
    ws.Columns("A").ColumnWidth = 10
    End Sub
    Another option is to set the column width, then protect the columns from been updated by the user, before refreshing the PivotTable, unprotect the worksheet. For example:
    Public Sub LockColumnA()
    Dim ws As Worksheet
    Set ws = Application.ActiveWorkbook.ActiveSheet
    ws.Columns("A").ColumnWidth = 10
    ws.Columns("A").Locked = True
    ws.Protect "123"
    End Sub
    Public Sub UnprotectWorksheet()
    Dim ws As Worksheet
    Set ws = Application.ActiveWorkbook.ActiveSheet
    ws.Unprotect ("123")
    End Sub
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • STS does not work after update

    Hi. We have problem with STS after update. SAPKA70022 - ABA Support Package 22 for 7.00 SAPKA70023 - ABA Support Package 23 for 7.00 SAPKB70022 - Basis Support Package 22 for 7.00 SAPKB70023 - Basis Support Package 23 for 7.00 SAPKW70024 - BW Support

  • How to create a Service Request with Oracle SOA 11g

    Hi, I work with a company that is a Diamond level partner to Oracle. In one of our project with SOA 11.1.1.5 we are facing some random product issues.After much thought, we decided to contact oracle support and raise a service request and report the

  • IPhone 4S Photo Library and Photo Stream Dead

    Do these symptoms sound familiar to anybody: I've been taking some short video clips on my iPhone 4S of a bathroom remodeling project. From the Camera app: I can view those new videos just fine from the camera app, after hitting the ... not sure exac

  • Library backup, 5.0.4

    Usually I have complete copies of my home directory on an external hard drive, but I thought that I should learn doing backups to removable media. My library was 442 MB, so I tried a CD. iPhoto said: "Sorry Sir, 725 MB would not fit here". I guess th

  • Apple Way Back... *Off Topic*

    Hey everyone. Seeing how far Apple has come, I thought it would be fun to take a step back, and see what Apple was like years ago. Check out the website below... http://web.archive.org/web/*/http://apple.com/ I know this forum isn't suitable for this