Dynamic rules

(1) Dynamic rule accepts only Accountand view in the left hand side. What is the intersection that it writes to?
(2) Given the syntax and other limitations ( e.g it can refer only to the same subcube) are there any benefits of using dynamic over HS.Exp exp for financial ratio computation?

Hi,
I am trying to do something similar as was stated in this post such as
-Set the background color of a cell to green if the value of another cell is >= 75.
-Set the background color of the cell to red if the value of the other cell is <= 45.
-Set the background color of the cell to yellow if the value of the other cell is > 45 or < 75.
Does anyone have any helpful suggestions?
Thanks,
Barbara

Similar Messages

  • Dynamic Rule based implementation in PL/SQL

    Hi,
    We are trying to implement a dynamic rule based application in Oracle 9i. Its simple logic where we store expressions as case statments and actions seperated by commas as follows.
    Rule: 'Age > 18 and Age <65'
    True Action: 'Status = ''Valid'' , description = ''age in range'''
    False Action: 'Status =''Invalid'', Description=''Age not in range'''
    Where Age,Status, description are all part of one table.
    One way of implementing this is fire rule for each record in the table and then based on true or false call action as update.
    i.e
    select (case when 'Age > 18 and Age <65' then 1 else 0 end) age_rule from tableX
    (above query will in in a cursor xcur)
    Then we search for
    if age_rule = 1 then
    update tablex set Status = ''Valid'' , description = ''age in range'' where id=xcur.id;
    else
    update tablex set Status =''Invalid'', Description=''Age not in range'' where id=xcur.id;
    end if;
    This method will result in very slow performance due to high i/o. We want to implement this in collection based method.
    Any ideas on how to dynamically check rules and apply actions to collection without impact on performance. (we have nearly 3million rows and 80 rules to be applied)
    Thanks in advance

    Returning to your original question, first of all, there is a small flaw in the requirements, because if you apply all the rules to the same table/cols, than the table will have results of only last rule that was processed.
    Suppose rule#1:
    Rule: 'Age > 18 and Age <65'
    True Action: 'Status = ''Valid'' , description = ''age in range'''
    False Action: 'Status =''Invalid'', Description=''Age not in range'''
    and Rule#2:
    Rule: 'Name like ''A%'''
    True Action: 'Status = 'Invalid'' , description = ''name begins with A'''
    False Action: 'Status =''Invalid'', Description=''name not begins with A'''
    Then after applying of rule#1 and rule#2, results of the rule#1 will be lost, because second rule will modify the results of the first rule.
    Regarding to using collections instead of row by row processing, I think that a better approach would be to move that evaluating cursor inside an update statement, in my tests this considerably reduced processed block count and response time.
    Regarding to the expression filter, even so, that you are not going to move to 10g, you still can test this feature and see how it is implemented, to get some ideas of how to better implement your solution. There is a nice paper http://www-db.cs.wisc.edu/cidr2003/program/p27.pdf that describes expression filter implementation.
    Here is my example of two different methods for expression evaluation that I've benchmarked, first is similar to your original example and second is with expression evaluation moved inside an update clause.
    -- fist create two tables rules and data.
    drop table rules;
    drop table data;
    create table rules( id number not null primary key, rule varchar(255), true_action varchar(255), false_action varchar(255) );
    create table data( id integer not null primary key, name varchar(255), age number, status varchar(255), description varchar(255) );
    -- populate this tables with information.
    insert into rules
    select rownum id
    , 'Age > '||least(a,b)||' and Age < '||greatest(a,b) rule
    , 'Status = ''Valid'', description = ''Age in Range''' true_action
    , 'Status = ''Invalid'', description = ''Age not in Range''' false_action
    from (
    select mod(abs(dbms_random.random),60)+10 a, mod(abs(dbms_random.random),60)+10 b
    from all_objects
    where rownum <= 2
    insert into data
    select rownum, object_name, mod(abs(dbms_random.random),60)+10 age, null, null
    from all_objects
    commit;
    -- this is method #1, evaluate rule against every record in the data and do the action
    declare
    eval number;
    id number;
    data_cursor sys_refcursor;
    begin
    execute immediate 'alter session set cursor_sharing=force';
    for rules in ( select * from rules ) loop
    open data_cursor for 'select case when '||rules.rule||' then 1 else 0 end eval, id from data';
    loop
    fetch data_cursor into eval, id;
    exit when data_cursor%notfound;
    if eval = 1 then
    execute immediate 'update data set '||rules.true_action|| ' where id = :id' using id;
    else
    execute immediate 'update data set '||rules.false_action|| ' where id = :id' using id;
    end if;
    end loop;
    end loop;
    end;
    -- this is method #2, evaluate rule against every record in the data and do the action in update, not in select
    begin
    execute immediate 'alter session set cursor_sharing=force';
    for rules in ( select * from rules ) loop
    execute immediate 'update data set '||rules.true_action|| ' where id in (
    select id
    from (
    select case when '||rules.rule||' then 1 else 0 end eval, id
    from data
    where eval = 1 )';
    execute immediate 'update data set '||rules.false_action|| ' where id in (
    select id
    from (
    select case when '||rules.rule||' then 1 else 0 end eval, id
    from data
    where eval = 0 )';
    end loop;
    end;
    Here are SQL_TRACE results for method#1:
    call count cpu elapsed disk query current rows
    Parse 37 0.01 0.04 0 0 0 0
    Execute 78862 16.60 17.50 0 187512 230896 78810
    Fetch 78884 3.84 3.94 2 82887 1 78913
    total 157783 20.46 21.49 2 270399 230897 157723
    and this is results for method#2:
    call count cpu elapsed disk query current rows
    Parse 6 0.00 0.00 0 0 0 0
    Execute 6 1.93 12.77 0 3488 170204 78806
    Fetch 1 0.00 0.00 0 7 0 2
    total 13 1.93 12.77 0 3495 170204 78808
    You can compare this two methods using SQL_TRACE.

  • Dynamic, rules based security

    My organization has an application that needs a very fine grained scurity model, that changes very often and is based upon a rules machnisem (written in PL/SQL). Is there a way to combine a rule based mechanism with the internal ACL mechanism of the iFS ?
    null

    Hi Harvey_SO,
    According to your description, you get the security ignored when using custom dynamic role-based security. Right?
    In Analysis Services, it has some role overlapping scenarios, if two roles used to secure attributes in two different dimensions, which might both apply to some users simultaneously, it can cause the user has no security applied from either role. Please
    refer to workarounds in the link below:
    The Additive Design of SSAS Role Security
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Dynamic Rule Driven Organization

    Has anyone successfully created a user member rule for a rule driven organization, and have users actually show up in the dynamic organization, as well as the static organization that every user must belong to?
    The problem is such: we group users into different job fuctions, ie organizations, with administrators controlling the organizations for delegated administration purposes. However, each user can have different job functions, hence belonging to different organizations. The rule driven organizations seem to be the solution to this problem. However, I can't seem to get any member rules to populate any users for the organization in the Accounts List. Am I mis-interpreting the usage of dynamic organizations?

    I followed the example that was provided in the documentation and was able to get users show up in different organizations in the List Accounts tab. What kind of errors are you seeing? Have you tried just a simple user member rule? Try the the following with some hard coded dn's of valid users in your idm [notice i'm making the assumption that you have LDAP as your resource, replace that with whatever recource that's in your system and correspoding user identity template]. Create an organization and select "TestMemberRule" as the user member rule. This was the first thing I did, and then I went ahead to modify the rule to query LDAP..and so forth. Hope this helps! Good luck!
    <!DOCTYPE Rule PUBLIC 'waveset.dtd' 'waveset.dtd'>
    <Rule authType="UserMembersRule" name="TestMemberRule">
    <list>
    <s>dn of a valid user in IDM:LDAP</s>
    <s>another dn of a valid user in IDM:LDAP</s>
    </list>
    <MemberObjectGroups>
    <ObjectRef id="#ID#All" name="All" type="ObjectGroup"/>
    </MemberObjectGroups>
    </Rule>

  • Customizing dynamic rules.

    Hello partners,
    I am new to BI Beans, and I have followed some samples in BI Beans documentation regarding to how create and define rules fto format crosstab cells.
    Now, I think that I need to use code to create a customized format criteria as follow:
    We have a goal column with a value, now we want to change the colors of other cells following the next criteria:
    -Put green color if the value for the other three columns is above to "goal" column.
    -Put red color if the value for the other three columns is less than the 20% of "goal" column.
    -Put yellow color if the value for the other three columns is until 20% less than "goal" column.
    Any advice or example of how to accomplish with that, will be really appreciated.
    Thanks in advance.
    Best regards!!!!
    Frank Mtz.

    Hi,
    I am trying to do something similar as was stated in this post such as
    -Set the background color of a cell to green if the value of another cell is >= 75.
    -Set the background color of the cell to red if the value of the other cell is <= 45.
    -Set the background color of the cell to yellow if the value of the other cell is > 45 or < 75.
    Does anyone have any helpful suggestions?
    Thanks,
    Barbara

  • OIM - Email notification to a specific user based on a dynamic rule

    Hello, After creation of account in a particular target resource I need to send an email to a specific user based on the location of the user (e.g area admin).
    In the notification tab of process tasks, I see only "Assignee", "Requestor", "User", "User Manager"? How can I achive the above specified requirement?
    Before posting this question, I tried to search the forum for any previous posts related to this. But I couldn't find any. May be I was not searching with right key words.
    Any help is appreciated. Thanks in advance.

    You'll need to custom code an adapter to send the email, then you can send to any user you want. Create a new task and trigger it off the completion response code. You can use the following apis:
    tcEmailNotificationUtil sendMail = new tcEmailNotificationUtil(ioDatabase);
    sendMail.setBody("Type your body here or use a string variable");
    sendMail.setSubject("Type your subject here or use a string variable");
    sendMail.setFromAddress("[email protected]");
    sendMail.sendEmail("[email protected]");
    Just populate the above pieces with the information needed.
    -Kevin

  • Modification Dynamic Rule - SAP Migration - Quality Level

    Hi Experts!!
    Could you tell me if I can have the same quality level for one material when I do a SAP Migration? For example, currently we are working in the release 4.7 and my quality level for a specific material is in the step n. 6 and our total cycle are 10 steps. My doubt is when I will be working in the new version (5.0) I can start my quality leve from step n. 6? Or is it mandatory to start from step n. 1 again?
    I don´t know if my doubt is clear but I would like to thank you for help me in this issue.
    BR
    Valdevair

    No when you transfer data from one client to other or in SAP Migration,Quality level will never be as that of the old.It will reset no doubt.
    What you can do is
    1.Create all master data like DMR with  Task list   etc
    2.Get the database of old system with current quality level with combination of Vendor-Material.
    3. Run the QDL2 with some LSMW for combination of the Vendor & material.
    4.Reset the level to desired level.
    I hope this will add some value

  • Dynamic rule

    Hello Guys,
    I assume we can define many sampling schemas and procedures and assign it to one DMR.Actually I want to maintain different sampling schemas for different inspections like tightened,normal and reduced.
    I created three different sampling schemas ss1 ss2 ss3 with three sampling procedure sp1 sp2 sp3 and tried to assign it to one DMR 999 .It is not allowing to make relationship and it throws an error..this is beacuse I maintained different severity for each inspection ?
    ANd also if it is possible...how do the DMR know which sampling schema it has to pick at the RR as it got tied up with three different schemas ?
    pls advice
    regards,
    akash
    Edited by: chidprakash on Jun 3, 2009 12:35 AM

    Hi'
    Aakash
    .It is not allowing to make relationship and it throws an error..this is beacuse I maintained different severity for each inspection ?
    There is relation between a DMR & a Sampling Prcedure(that is with sampling scheme)
    in terms of Sevierity.
    Now You have created a DMR where you have specified say seviarity 4.
    But you have created several sampling schemas ss1 ss2 ss3 with three sampling procedure sp1 sp2 sp3 which has diffrent seviarities.
    When you  maintain the relation system will only consider the DMR & sampling Scheme with same seviarity (say 4)...rest will show error.This is how SAP works.
    Regards
    Sujit S Gujar

  • Dynamic Business Rules - Where to place

    Hi,
    I am doing POC for a fortune 10 client and they have some business rules before crud actions are going to take place in DB. We have very minimal tables (less than 10) and its small application but web service (btw, this has to be webservice app) consumers are around 200 per sec.
    The requirement with respect to business rules are also minimal (like 30 rules for entire project) but these rules will change very often(like once in a month). Assume these rules are on the enterprise level and not on the application level.
    I am looking for best possible solution to achieve by developing small rules engine or putting them into another xml and apply transformation once request arrives.
    I am confused of deciding which is better like putting business rules in xslt vs java business object. XSLT is allowing me to change rules with minimum impact on the system but it is hard to maintain and adding new rules (we are not anticipating any more new rules within next two years).
    On the other hand, If I put in Java business object then it allows lot of flexibility to inject new rules and easy to maintain with cleaner code.
    So, in short my questions are below.
    1. Is it good practice to put small set of business rules in xml/xslt?
    2.are there any alternative business rules engines are available?
    Any other suggestion related to above discussions are welcome.
    Thanks.

    I believe this is what you want.
    DROOLS - drools - dynamic rules for java
    http://sourceforge.net/project/showfiles.php?group_id=37037
    http://www.onjava.com/pub/a/onjava/2005/08/03/drools.html?page=2
    good luck.

  • Creating Dynamic Routing Rules within mediators

    Hi
    When I check the (huge but apparently not enough) SOA developer's guide. I can't find any reference to dynamic rules within mediators. This feature seems available within jdev11g TP3. But the way to use it isn't straightforward.
    Do you know where I could find some explanation/samples or documentation related to this point pls ?
    ThanX
    Dominique

    Dominique,
    Unfortunately this feature is not quite complete in TP3 so I wouldn't waste too much time trying. We will try to have documentation and samples ready for it in TP4.
    Sorry,
    /Demed

  • How to reload firewall rules from command line on firewall ?

    Hi all,
    I am trying to create script that controls firewall on server. OS version is OS X Server 10.5.6.
    Part of firewall rules is created using firewall admin tools, part of Server Admin Tools. My first question is where are those rules stored permanently ? As far as I understood it should be set of ipfw rules but they are not stored in /etc/ipfilter/ipfw.conf.
    Idea of script is this:
    I have set of rules that should be controlled by Server Admin Tools.
    Also, I have some dynamic rules.
    Whenever some change occurs, I created script that does following:
    /sbin/ipfw -f flush - to flush all existing rules
    /sbin/serveradmin stop ipfilter - to stop existing firewall
    /sbin/serveradmin start ipfilter - to restart firewall and reload permanent rules
    Add my set of rules...
    After flushing all rules and issuing stop and start ipfilter none of rules set through Server Admin Tools are not reloaded. So how should I reload them ? How to save them permanently in the first place ?
    Please note that I do not have access to server (for security reasons). I am developing script on my Mac, sending to client and he tests it. So I cannot do a lot of testing.
    Thank you in advance.
    Best regards,
    Dusan

    Unix and Terminal queries are best posted to the Unix forum under OS X Technologies where those mavens frolic.

  • Dynamic participant block in Human task flow

    Hi All,
    I am working on human task flow and got stopped on below use case.
    I have two participant block let say A and B. I want to assign participant A depends on flat inside task flow parameter. If Flag is Yes, then it should assign to A and on approval of A it should complete the task flow. But if Flag is NO, then it should first assign to B, on approval from B, it should again assign to A and after that it should complete the task flow.
    I tried to use dynamic role assignment but there i am not able to define above use case. Dynamic rule is saying you can assign A or B depends on some rule(task flow parameter) but my requirement is little different.
    If Flag is Yes,
    - assign to A -> on approval -> complete the task flow.
    If Flag is No
    - Assign to B -> on approval from B -> assign to A -> on approval from A -> complete the task flow.
    I want to build this logic inside single human task flow.
    Please help.
    -Sunil

    Hi Zaloa,
    Can you pls try this.This should work.
    1. Go to Edit Task Definition page and add a Parameter of type string(default).
    2. Now come to the human task dialog( the one you get on double clicking the human task activity) and add a value to the parametr you just added(string)using the search light .This value should be the variable containing the value of the asssigne which you want to add dynamically.
    3.Now again go to the Edit Task Definition page and select the Assignment policy and select the expression path builder.
    4. You should be able to see the parameter you just added under task:payload. select this . now your assigne is dynamically added.
    Pls let me know if you need further details. Hope this helps.
    Thnks
    Message was edited by:
    soaUser

  • Rules with PL/SQL.

    Hello, I created a scheme with the following tables:
    Fileds.
    Docs. (Forms)
    Customers.
    Declarations.
    This is a database for state taxes in Ecuador, the government has defined a series of forms for each type of tax-class.
    Each form contains fields, these fields are common to most forms, but the same for each form field is validated on the basics of a different Condition, for example:
    Form 104A and 104B containing the 208 field, in the form 104A the condition is <500 and the 104B the condition is > 500.
    How to implement these conditions using PL/SQL?
    The DDL my schedule is:
    Create table Fields
    Field_id number (3) not null primary key,
    Description varchar2 (50) not null
    Create table Docs
    Doc_cod varchar2 (5),
    Field_id number (3),
    Rules varchar2 (25),
    Dosc_pk primary key constraint (doc_cod, field_id)
    Fields_fk foreign key constraint (field_id)
    References fields (field_cod) on delete restrict
    Data in the DOCS:
    DOC_COD........FILED_ID...........RULES
    104A .................208.................<500
    104B..................208................ >500
    Roberto.

    Dynamically applying rules itself needs some rules about the format of a rule. Let's keep it simple - we say that each rule must be a boolean condition, and have a single parameter. We use a single function to check a rule (it should be packaged and polymorphism used to cater for different data types).
    This can then be implemented as follows:
    SQL> create table rules( rule_id number, rule varchar2(4000) );
    Table created.
    SQL>
    SQL> insert into rules values( 1, ':0 between 0 and 1000');
    1 row created.
    SQL> insert into rules values( 2, 'length(:0) < 6' );
    1 row created.
    SQL> commit;
    Commit complete.
    SQL>
    SQL>
    SQL> create or replace function ApplyRule( ruleID number, value varchar2 ) return boolean is
    2 ruleCondition varchar2(4000);
    3 plsql varchar2(32672);
    4 boolNum integer;
    5 begin
    6 select rule into ruleCondition from rules where rule_id = ruleID;
    7
    8 plsql := 'begin
    9 if '||ruleCondition||' then
    10 :1 := 0; -- TRUE
    11 else
    12 :1 := 1; -- FALSE
    13 end if;
    14 end;';
    15
    16 execute immediate plsql using
    17 IN value,
    18 OUT boolNum;
    19
    20 return( boolNum = 0 );
    21 end;
    22 /
    Function created.
    SQL>
    SQL>
    SQL> begin
    2 -- W = dbms_output.put_line
    3 if ApplyRule(1, 50 ) then
    4 W( 'Rule 1 is TRUE using value 50' );
    5 else
    6 W( 'Rule 1 is FALSE using value 50' );
    7 end if;
    8
    9 if ApplyRule(2, 'This is a test') then
    10 W( 'Rule 2 is TRUE using "This is a test"' );
    11 else
    12 W( 'Rule 2 is FALSE using "This is a test"' );
    13 end if;
    14 end;
    15 /
    Rule 1 is TRUE using value 50
    Rule 2 is FALSE using "This is a test"
    PL/SQL procedure successfully completed.
    SQL>The complexity of this can fairly easily be increased using DBMS_SQL instead. With DBMS_SQL you can inspect the rule for bind variables and the names (or numbers) of the bind variables. The caller can supply you with a name-value list instead of a single value.
    You can now dynamically bind the bind variables using the name-values supplied.
    The rule itself can be made into a PL/SQL function body that has to return TRUE or FALSE. This allows for very complex dynamic rule definitions. The dynamic PL/SQL block constructed in this case has to look something like follows:
    declare
    function DynamicFunction return boolean is
    begin
    <<insert dynamic rule here>>
    end;
    begin
    if DynamicFunction then
    :RuleResult := 0;
    else
    :RuleResult :- 1;
    end if;
    end;Of course, it needs to be noted that not safe guarding the rules tables, can allow hackers to inject very dangerous PL/SQL code into your system. In the same vein, each dynamic rule needs to be properly and fully tested after being added to the rules table to ensure it behaves as expected.

  • Entirly dynamic IF conditions

    Hey All,
    I am doing something a little strange. Basically I have a database table with some coldfusion If statments. Things like
    "age GT 18" or
    "name eq 'frank'"
    etc. Basically it's a dynamic rule engine. Allows my users to place triggers in an app. Question is, how do I evalulate those conditions. I pull them from the database, loop over the query, but I can't actually get CF to parse the contructed IF statment. For example...
    <cfset YearsOld = 67>
    <cfquery name="GetConditions" datasource="webserver">
         Select *
         From SignUpFormAdditionalActions
         Where Active = 1
    </cfquery>
    <cfoutput>
         <cfloop query="GetConditions">
              <cfif GetConditions.Condition>
                   Met #GetConditions.Name#. #GetConditions.Content#<br />
              </cfif>
         </cfloop>
    </cfoutput>
    And here is what my database looks like
    I know this should be easy, I'm just kinda having a brain fart. Thanks!

    Ah I figured it out. Using DE and evaluate.
    <cfquery name="GetConditions" datasource="webserver">
         Select *
         From SignUpFormAdditionalActions
         Where Active = 1
    </cfquery>
    <cfoutput>
         <cfset YearsOld = 67>
         <cfloop query="GetConditions">
              <cfset result = #Evaluate(GetConditions.condition)#>
              <cfif result eq "yes">
                   Passed #GetConditions.name#<br />
                   <cfelse>
                   Failed #GetConditions.name#<br />
              </cfif>     
         </cfloop>
    </cfoutput>

  • Rule Based System

    Hi all,
    I am currently working on a project which required to Implemented 500-600 rules in the System. Some of them are global Rules and some are just module level rules.
    Is there any pattern exist for Rule Based System?
    Thanks in Advance
    Rashmikant

    Just 1 pattern?
    The short answer: No.
    The longer (though still short answer):
    A rules engine is not the easiest thing to implement, just 2 or 3 classes don't hack it if you're working with a dynamic rule base that is steered based on input/ouput and states.
    There are rules engines for sale and there also a few opensource, look on the internet, use your best best friend.

Maybe you are looking for

  • Error while deploying composite in EM console

    Error while deploying jar files directly from EM console.Please find the below error message and let us know how to deploy the composite. Deploying on partition "mooa_businessservices" of "/Farm_SOADomain/SOADomain/SOAServer" ... Deploying on "/Farm_

  • PSC 2350 Blue Screen Error

    Hi, Recently my PSC 2350 has been having a recurring error while printing.  It will print 1/4 of a page and then stop.  The printer's display screen turns blue and show an error code of 0x887929e.  I have not been able to find any references that wil

  • First https connection very slow ( 40 s ), can it be improved ??

    i am writing a client application connect to HTTPS server using JDK 1.3.1 with JSSE 1.0.3. when the first time the application calls url.openConnection() it take over 40s to finish, it is too slow. but after the first openConnection(), the other open

  • Editing RSS FEED in iweb

    Hi, I created an audio podcast on iweb 08 with my mobile me account. The podcast appears in itunes as a video podcast? Can anyone help me with that? How can i edit the rss feed in iweb in order to have better tags on my podcast? If smeone has an answ

  • 5000 hits in document overview

    Hi, When I clicked on "Document overview on" in (left side of) ME23N transaction , I am getting a pop-up saying that "You have limited selection to 005000 hits (Note that there are more hits)". Message no. MEQ010. I have more number of PO items to be