ADF BC, how implements business rules?

Hi.
I am new in oracles technology. Please help me understand how implements business rules.
For example: I have two tables operation(id,code) and operation_item(id, operation_id, code). I create entities objects for it: OperationEntity, OperationItemEntity and association: OperationItemToOperation. Then create entity-based view object OperationById which have bind parameter id for find operation by id. I also create entity-based view object OperationItem and view link OperationItemToOperationLink.
My ApplicationModule contains OperationById and OperationItem via OperationItemToOperationLink
I want implements "clone" method at OperationById view for current row. This method create copy selected row from operation table and copy all rows from operation_item table where operation_item.operation_id = operation.id.
I add method createCurrentRowClone to OperationById:
public void createCurrentRowClone() {
OperationByIdRowImpl currentRow =
(OperationByIdRowImpl ) getCurrentRow();
OperationByIdRowImpl newRow = (OperationByIdRowImpl ) createRow();
insertRow(newRow);
newRow.setAttributes(currentRow);
//TODO create copy for all rows from OperationItem
//??? how get OperationItem instance
and I add method clone to OperationItem:
public void createClone {
// for all row from OperationItem create clone
but I don't understand how get OperationItem instance in OperationById scope. I have method getOperationItems() in OperationByIdRowImpl class which return RowIterator, and it give me instances of OperationItemRowImpl class, but not OperationItem with rows where operation_item.operation_id = operation.id
Thanks in advance

For realizations "clone" method which make copy for current row from OPERATION table and all rows from OPERATION_ITEM table where
operation_item.operation_id = operation.id I moved realisation business logic from View Object to Entity.
For it enough:
1) entities objects: OperationEntity, OperationItemEntity;
2) association for this entities: OperationItemToOperation;
3) entity-based view object: OperationById which have bind parameter "id" for find operation by ID;
4) application module: ApplicationModule;
I add method createCurrentRowClone to OperationByIdImpl class. It just call createClone method for current row:
public void createCurrentRowClone() {   
OperationByIdRowImpl currentRow = (OperationById) getCurrentRow();
currentRow.createClone();
method createClone in OperationByIdRowImpl class call createClone method from entity layer:
public void createClone() {
getOperationEntity().createClone();
method createClone in OperationEntityImpl class make new row and call createClone for all row from OperationItemEntity:
public void createClone() {
OperationEntityImpl newRow = (OperationEntityImpl) getDefinitionObject().createInstance2(
getDBTransaction(),null);
newAtm.setCode(getCode());
//create copy for all rows atm_operation
RowIterator itemIterator = getOperationItemEntities();
while ( itemIterator .hasNext() ) {
OperationItemEntity itemRow = (OperationItemEntity ) itemIterator.next();
itemRow.createClone(newRow);
and finally method createClone(OperationEntityImpl operation) in OperationItemEntityImpl class make new row in OPERATION_ITEM table
public void createClone(OperationEntityImpl operation) {
OperationItemEntityImpl newItem = (OperationItemEntityImpl) getDefinitionObject().createInstance2(
getDBTransaction(), operation);
newItem.setCode(getCode());
If you have another solution, please post it here.

Similar Messages

  • How to implement  business rules by using drolls in OSB

    Hi
    I am new to Drools,can any body tell how to implement drools concept in OSB11,provide any useful links or blogs.
    Thanks in Advance
    Mani

    Mani,
    I have implemented Drools by exposing them over web service call through Business Service of OSB.
    As you are using Java Callout, try to set proper return type for the java method called, better to use XMLObjects as the return type.
    http://www.xenta.nl/blog/2011/08/29/oracle-service-bus-java-callouts-with-xmlobjects/
    http://mazanatti.info/index.php?/archives/63-Oracle-Service-Bus-generating-XML-Objects-from-Java-Callouts.html
    http://blog.xebia.com/2009/10/11/java-callout-on-the-alsb/
    http://itnewscast.com/middleware/oracle-service-bus-java-callouts-xmlobjects
    How to retrieve the java object in a proxy service in osb -- Plz help
    Hope it helps !!
    Abhinav
    Edited by: Abhinav on Dec 12, 2012 4:21 PM

  • Business Rules with BPEL or ADF

    Hi,
    My requirement is :
    We have to migrate records from one DB table to another DB table.
    And we have to apply Business Rules on those records while they are on there journy from source DB to target DB.
    We have two choices to achieve this:-
    1) Use BPEL process and Tranform Record from Source to Destination by applying Business Rules
    Or
    2) Develop ADF application and use business rules SDK to fetch the Rules and apply them to Tranfer Data from Source DB to Traget DB.
    Can anybody suggest the better approach on this.
    Thanks & Regards,
    anvv sharma

    You may want to provide more information on your use case. The way I read this is that neither product would suite your use case. This looks more like an ETL solution, therefore ODI may be a better play.
    Is this a one off exercise?
    How big is the payload?
    what are the examples of the business rules?
    Are the business rules dynamic?
    cheers
    James

  • JHeadstart, Oracle Business Rules and BPEL Process Manager

    Dear JHeadstart Team,
    I have some questions regarding integration of JHeadstart and Oracle Business Rules and Oracle BPEL Process Manager. As a matter of fact I don't have any work expriences with these tools so my questions may not be good and precise.
    1- Using a business rule engine can dramatically increase speed of development and ease of maintenance.I had a very good exprience in using JHeadstart and Headstart in the past but I wanted to know if it is possible to use Oracle Business Rules in conjunction with the JHeadstart ? If so, What steps should be taken? Is there any known issue about this integration? Does Oracle Business Rules have any interference with JHeadstart or it is only used in model layer during insert,update,delete?
    2- Is it possible to develope a system based on oracle work flow engine (Oracle BPEL Process Manager) using JHeadstart ? If so, What steps should be taken and how the changes in the flow of work would by applyed in a system developed by JHeadstart. Is there any known issue about this integration?
    Any help,link to documents or general guidelines would be highly appreciated.
    Thanks in advance,
    Navid

    Couple of things I would like to add, are the following.
    In the context of an ADF application usage of Oracle Business Rules most likely is in the business logic layer, but mind that it does not need to be restricted to that.
    Oracle Business Rules takes so called 'facts' as input, evaluates some rules based on that and change those facts or return some result. That might be checking a business rule as defined in the JHeadstart Developers Guide. But it might also return some value that is used in a navigation rule.
    Think about a page flow where after page A normally page C is presentend, but in case of some situation (like a customer ordered something and you want to present some special offering based on that) you want page B presented in between (i.e. A -> B -> C). Oracle Rules could be used to determine this page flow. This would be an example of using it in the controller layer (probably in combination with using facts that come from the model layer).
    Another remark that I would like to make, is that in my opinion it does not make much sense to use Oracle Rules for business rules that logically more or less are part of your data model (like end date must be on or after begin date). You typically use Oracle Rules to implement business rules that are of a volatile nature, meaning that day-to-day business may require a change of the rules. One example is the navigation case that I mentioned before. Another (typical) example would be a rule that defines when a customer is a Gold customer.
    Jan Kettenis

  • Can I ReUse business rule with JHeadStart ?

    Hi All,
    I am looking for tools and methods for our development team to achieve this goal. The keyword is Re-Use as far as we can, in all application layer.
    We will have core application, and for any new customer we will only develope the things that specific to that customer and Re-use the core application.
    Will JHeadStart help us to achieve that goal ?
    Could anybody pls help me with the scenario for maximum reUse ?
    Thank you for your help,
    Krist

    Krist,
    JHeadstart does not 'help' much with your business rule implementation, but it also does not prevent it (I'll get to the bugs you mentioned later). ADF BC is an excellent framework for implementing your business rules, and if you implement these rules on Entity Objects (instead of View Objects) as much as you can, they are highly reusable. Have a look at this paper, which is from the 'before ADF' era but will still contain lots of information on how to implement various types of Business Rules in ADF BC:
    http://www.oracle.com/technology/products/jdev/htdocs/bc4j/BusinessRulesInBc4j.pdf
    The JHeadstart bugs you mention should not hinder you (much). The first should not reproduce in the latest patch version; you can create your own application module subclass as long as it (directly or indirectly) extends the JHeadstart one.
    The bug with respect to View Object extending does not mean the Java class extending of the View Object classes, but rather the situation where one View Object 'inherits' the attribute definitions of another View Object. I would not advice using this type of 'definition inheritance', and furthermore implementing business rules on View Objects should be avoided as much as possible if re-use is your goal; the Entity Objects underneath the View Objects are a much better location.
    The bug with imported Entity Object is more a restriction in how you organise your sources in JDeveloper (i.e. spreading your Business Components across multiple projects) than it is a limitation on reusing business logic.
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • Business rules and active databses

    All,
    Are there any good links where I can read about the limitations of active database features (such as constraints and triggers) and other options and alternatives to implementing business rules?
    Regards

    BPM and a rules engine are different. Both are important, but they have different uses.
    Oracle BPM Studio is used by Business Analysts and Developers to model processes, integrate underlying components (including business rules) and develop user interfaces.
    There's an Engine that executes the processes that have been modeled. It sends the work item instances to the right person or persons with the right data when the work item reaches an interactive activity in the process. Similarly the Engine has invokes the underlying components specified in the process when the work item instance reaches an automatic activity.
    There's an out of the box Workspace runtime that lets end users manage and run their work item instances as they flow throughout the processes.
    We can business rules inside the processes, but one does not replace the other.
    Dan

  • Business Rules in BC4J URGENT

    What is Oracle's recommendation for implementing business rules in BC4J?
    There are two approaches that i saw in Oracle documentation:
    1- To implement business rules in the Entity Object. Some rules are implemented in doDML(), some in validate() depending on the type of the rule.
    This approach is explained in the business rules white paper submitted early 2001.
    2- To implement business rules in the Application Module.
    This approach is depicted by the toy store sample application.
    Please direct me to which approach should i use and if there is any documentation about the matter.
    NOTES:
    1- We use JDeveloper 9.0.3.1

    Amr,
    try this paper and let me know if itt meets your requirements.
    http://otn.oracle.com/products/jdev/htdocs/bc4j/BusinessRulesInBc4j.pdf
    Frank

  • Business Rules framework?

    In ancient times I have used Headstart Ruleframe to implement the business rules.
    What is the best strategy nowadays to implement business rules in an apex web application. Preferably all the BR's would be applied to in the database through triggers and packages so that the BR's ara always validated even when trying to modify records through sql plus.
    Thanks,
    Joep

    You might want to look at Rules Manager/Expression Filters:
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e14919/exprn_intro.htm#EXPRN001
    which has it's own {forum:id=268} forum.
    As it sounds like you're looking for something that's independent of the (APEX) front-end, it's probably a good idea to take this question to other DB forums: Database General, SQL & PL/SQL etc.

  • What business rules from DataBase to BC4J

    Hi, I am new in the BC4J world. Can anyone tell me what business rules will be converted to BC4J with JDeveloper? The tuple rules, record rules, Foreign Keys and Primary keys will be put into the BC4J layer, but...... the entity rules and interentity rules? Where will they be? Can the be put into the business layer? Are the automatically generated for you?
    Thank you,
    Rene

    I'd recommend reading this whitepaper that describes a systematic method for thinking about and implementing business rules in BC4J:
    http://otn.oracle.com/products/jdev/htdocs/bc4j/BusinessRulesInBc4j.pdf
    We automatically pickup up primary key and not null constraints, and we use the foreign key constraints to reverse-engineer associations/compositions.

  • Implementaion of Business rules

    All-
    I have an interface to load data from oracle to netezza and one of the column is mapped like below:
    TargColumn2 = Column2 + #test
    Here I am taking the Column2 from source and adding it to value of the variable (#test) then mapped into the target column.
    I want to check some condition before inserting records into the table. Suppose the above scenario is returning the value 100 then I need to check the condition like > 100. I would like to insert records only when the condition is met.
    Is it possible to implement Business Rule to check some condition while inserting records through interface? Please advice?
    Thanks & Regards,
    Saravanan Rajavel

    Hi there,
    best way is indeed via the flow-control because you may implement several rules and get them executed all.
    You are thinking process instead of set manipulation probably
    If you have only one rule you may try to get a where clause applied on target
    jld

  • Expose Business rules as Web Service

    Hi,
    I'm quite new to business rules, and I haven't found any definite information about can I and how expose business rules application as Web Service? In Decision Functions I can check "Will be invoked as webservice", but how can I deploy it on server and so on?
    Thanks in advance.

    Hi PK,
    Sorry What i meant was composite service, not web service
    Used wrong wording
    In your composite if you have only businessrules as a component and if you are exposing your BR as service, and if u deploy that process it will give you a wsdl for that composite, which means for BR. Because the client is calling BR it self.
    Regards
    PavanKumar.M

  • 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

  • How to make multi-tenant business rules

    hi'
    I want to write tenant specific Business rules in multi-tenant application, please give me some tips of making multi-tenat business rule.
    I know how to write common business rule for all the tenants.
    thanks
    Yatan

    I'd suggest using Flash Media Interactive Server if you wish to make this type of application and use Flash as the interface.  I can't give you the details on exactly how to implement it, but using Remote Shared Object and FMIS would serve as the basis.  I believe that the package comes with examples of Shared Objects that can serve as a simple basis from which to proceed.  After that you might want to see if you can find an available whiteboard app that can be leveraged to do as you wish.
    I apologize in advance if using this type of solution is a non-starter, I've been using FMIS locally and have plans to eventually implement something similar to this type of drawing app as well.

  • Business rules in ADF-BC

    Hi JHS-team,
    I found an Oracle white paper on BR's in ADF dated April 2004. In it are, amongs a lot of other interesting stuff, examples on howto code business rules. These rules usually "raise" an error when it gets violated (for example a change in civil state) by calling a method addUserError(). This method is no longer part of JHeadstart 10.1.2; see the revision history in class AdfbcUtils which says: "removed addUserError methods (not applicable anymore with ADF)".
    Now for my question; why is addUserError() no longer applicable with ADF and how should an exception be raised now?
    Thanks,
    Tim

    Tim,
    You can find the answer in this post: BusinessRulesInBc4j.pdf
    Steven Davelaar,
    JHeadstart Team.

  • Business rules inside the dabase - how to avoid

    Dears,
    I have a friend who is working on our project and he is an
    Oracle DBA. The problem is that he's been very stubborn when it
    comes to the app's business rules. He insists that all of the
    business rules should be inside the database, represented by
    triggers, stored procedures and the likes.
    Even the applications's parameters should go into the database,
    according to him. "Property files ? Hell no !"
    I tried to convince him of the importance of OO design principles,
    abstraction, blah blah blah but he won't listen.
    Does any of you guys know of a link or an article available on
    the web that addresses this discussion ?
    I wanted to persuade him, instead of forcing him to accept our
    design decisions.
    I mean, I know we all have to be reasonable but I wanted to
    have something written by some of the OO gurus, it would be
    easier...
    Thanks a lot

    Finding a case study for what you speak will not be easy, and I suspect will do little to sway the opinion of your DBA. If you do find something, please post it to the list here.
    Here are the fundamental problems with his approach (feel free to use these arguments against him):
    1) Business logic is hidden / spread across multiple tiers. This is a biggie. If you are using triggers, etc you have business logic that is spread across both the actual code level and across the DB. For a developer that is going to implement a change you have effectively doubled the cost of that change. Plus your development team has to be well versed in both Java coding and in SQL / DB specific coding as well - if your DBA is doing proprietary things in Oracle... well, you get the picture.
    2) Changes to DB. If you ever change DB solutions, or even want to switch to a new set of tables, you have to replicate all of that work. There is no real reason for doing that with todays technology - you are just creating more work and making your system(s) less flexible to change and more challenging to migrate.
    3) Object / DB disconnect. When you get into the guts of things, there is a wide gap between what is considered best practices for DB design and what is considered best practices for OO design. This culminates in a lot of work going into how to map objects to DB's and vice versa. The differences between these paradigms can cause huge problems when you are implementing business logic in both tiers. Here is an example:
    Let's say that you have a universal rule that states that you must have a full 9 digit zip code for all addresses. In the object world this type of rule implementation is simple - you simply enforce this rule on your Address object and use it everywhere you need an address. But in the DB world it is a common practice to embed this type of data within other tables. For instance, you have a customer table with address fields. Same thing for employees, vendors, etc.
    Now in order to enforce that 9 digit rule you have to create a stored procedure (or a constraint, whatever) on each of the tables that contains address data. Add a new table with address data? Re-create the rule enforcement.
    4) People - As you had mentioned (or maybe someone else did), most companies follow this formula; coders > DBA's. And they do it for good reason. By making the DBA the gate keeper for all of the rule logic you are increasing your "bus" risk factor (he gets hit by a bus, your company is screwed). Plus he is certainly increasing his own job security (I call this complexity based job security - the more complex I can make my work seem, the less likely anyone is to fire me). If I were to perform a risk assessment here I would definitely want my larger group of coders handling rule logic.
    Hope this helps.
    Jonathan House

Maybe you are looking for

  • BPM S/A Bridge

    When does one use a S/A Bridge.. I am looking at SAP Help as per which, they have an example to convert a synch interface to Asynch? Do we need to use this? I have the following interfaces a) file sender adapter b) Consume webservice c) Based on the

  • IPad 3 Internet Issues

    I'm currently using an iPad 3 which is able to connect to the home network but not the internet. All other devices can connect to the network and then the internet. When I use my iPhone 4 as a hotspot, it gets picked up by the iPad no problem. So far

  • Lost the iphoto library and all the photos

    I have recently installed some updates and upgraded to Yosemite 10.10.1.  When I opened up Iphoto today there was no library and therefore no photos. I've searched the whole computer and can't find any jpegs so the library hasn't been moved. I have b

  • Webservices lookup EJB error

    This are the sever log . ejb ref resolution error for remote business interfacetest.session.Hello [Root exception is java.lang.RuntimeException: Could not invoke defineClass!]      at com.sun.ejb.EJBUtils.lookupRemote30BusinessObject(EJBUtils.java:35

  • Oracle Education site missing test data for 1Z0-046

    Brandye: Just an FYI: the exam data for Oracle Database 10g: Managing Oracle on Linux for Database Administrators is missing with the new site 'upgrade'. http://education.oracle.com/pls/web_prod-plq-dad/db_pages.getpage?page_id=41&p_org_id=1001&lang=