Refering to entity instances from a more specific entity context

I have the global entity and two non-singleton entities; the obligation and the invoice. There are multiple obligations, and each obligation has multiple invoices, so it is a classic hierarchical entity structure.
When I write a rule in the context of 'the invoice', I can't seem to be able to refer to the parent 'obligation' that owns the invoice, but I understand that I should be able to because there is no ambiguity as to which obligation I am referring to.
Is this different now in version 10 of OPA? Does it require For()? Does anyone have an example of such a reference?

Hi Michael,
Had another look at this after we chatted. You need to use the 'For' function and the reverse text of the relationship between obligations and invoices.
I have an example with the following entities:
Global -- one-to-many --> the cat (Relationship text: the cats)
the cat -- one-to-many --> the cat's toys (Relationship text: the cat's toys; Reverse relationship text: the toy of the cat)
Here's an example rule which infers something about the cat's toy from something about the cat:
the cat's toy is happy if
…..For(the toy of the cat, the cat is happy)This compiles and runs fine in the debugger. Looks like we can't add attachments to posts on the external forum, but I can email the example to you separately.
Cheers,
Jasmine

Similar Messages

  • Refering to object instances from a jsp

    How can i call object instances within class instances in my application -- from a jsp?
    In other words, i want to reference to an pre-existing application instance of a class.
    I do not want "use:bean" -- which will use a class (not the specific instance i am looking for in the application).
    I also do not want a binding to a variable only ( #{class.variable} ).
    Thank You!
    eric

    That's a good reminder of how to positively access class2, stevejluke. Thanks.
    However, i have found by trying to access a simple String in Class1 that the class1 instantiated by the jsf page (this comes up first in the application and has components which require Class1) is not the same instantiation that being accessed by the jsp page (which is navigated to by a button from the jsf page).
    I put:
    <jsp:useBean id="myBean" class="com.mycompany.expense.EntryHandler" scope="session"/>
    at the top of both the jsf and the jsp page.
    faces-config.xml has:
    <managed-bean>
    <description>
    Glue bean for entry related events and the current entry data
    </description>
    <managed-bean-name>entryHandler</managed-bean-name>
    <managed-bean-class>
    com.mycompany.expense.EntryHandler
    </managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property> ((about 4)) <managed-property>
    <managed-bean>
    I tried setting <managed-bean-name> equal to the id in the jsp:useBean tag but drew the an error indicating the the <jsp:useBean ...> tag had instantiated the class before the faces-config.xml file had -- hence the managed property could not be found.
    I also tried putting name="entryHandler" in the <jsp:useBean > tag, but this is not allowed.
    Hmm, how to get the <managed-bean> and <jsp:useBean> to match?
    Maybe i have to put in code to the effect "get context " "get instantiation" etc,
    I'll have to try looking it up . . .

  • Does iCloud save voicemail messages from my iphone 5 when I back up? More specifically I am trying to access messages that were in my deleted folder at the time I last saved, that have since been cleared.

    Does iCloud save voicemail messages from my iphone 5 when I back up? More specifically, I am trying to access messages from my now deceased father that were in my deleted voicemail folder at the time I last saved, that have since been cleared.

    The iCloud backup includes visual voicemail messages.  I'm not sure if it includes the deleted ones or not, but I would assume it does.

  • To more specific class: all return error after upgrade from LV2011 to 2012

    I have working projects/executables built in labview 2011. When loading the exact same project in 2012 EVERY 'to more specific class' returns an error.
    For example, making a generic control reference into a 'numeric'.
    Redoing the exact same action makes no difference. What has changed in LV2012?

    Can you post an example VI containing such code? Please post the original 2011 code.
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Is there anyway to share an application on an Adobe Muse web page? More specifically an applet exported from the Processing interface?

    Is there anyway to share an application on an Adobe Muse web page? More specifically an applet exported from the Processing interface?

    Hi,
    You can add your app to the Muse page using the Insert HTML feature in Muse. However, it depends on your hosting server whether or not the app will work. For example, if your app is in php and your server is configured for php, the app should work.
    Regards,
    Aish

  • Check if there is an instance from specific class

    suppose i have i class with name FrmColor
    and i want to write a program that show this Frame by clicking on a button like this
    import FrmColor;
    import java.awt.Button;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.awt.Frame;
    public class Test extends Frame
         private Button b;
         public static void main(String args[])
              new Test();
         public Test()
              super("Test");
              b = new Button("Show Color");
              b.addActionListener(new ActionListener(){
                   public void actionPerformed(ActionEvent evt){
                        b_aciotnPerformed(evt);
         private void b_actionPerformed(ActionEvent evt)
              if there is an instance of FrmColor then
                   bring FrmColor to Front
              else
                   create an instance from this class
    pleaze Help Me.

    hi,
    what you want is a static int variable called count which is incremented everytime the constructor is called:
    public static int count = 0;In the constructor, have:
    count++;and a static method to return this variable:
    public static int getCount() {
        return count;
    }You can then get this count:
    FrmColor.getCount();This would be implemented in your code as follows:
    private void b_actionPerformed(ActionEvent evt)
    if(FrmColor.getCount() != 0)
        bring FrmColor to Front
    else
        create an instance from this class

  • Why is the static method in the superclass more specific?

    Why is the static method in the superclass more specific than the static method in the subclass? After all, int is a subtype of long, but Base is not a subtype of Sub.
    class Base {
        static void m(int i){ System.out.println("Base"); }
    class Sub extends Base {
        static void m(long l){ System.out.println("Sub"); }
    class Test {
        public static void main(String[] args) {
            int i = 10;
            Sub sub = new Sub();
            sub.m(i);
    }The first example compiles without error.
    Output: Base
    class Base {
        void m(int i){ System.out.println("Base"); }
    class Sub extends Base {
        void m(long l){ System.out.println("Sub"); }
    class Test {
        public static void main(String[] args) {
            int i = 10;
            Sub sub = new Sub();
            sub.m(i);
    }In the second example, both instance methods are applicable and accessible (JLS 15.12.2.1), but neither is more specific (JLS 12.2.2), so we get a compiler error as expected.
    : reference to m is ambiguous,
    both method m(int) in Base and method m(long) in Sub match
    sub.m(i);
    ^
    1 error
    Why don�t we get a compiler error for the static methods?

    Thank you for your ideas.
    ====
    OUNOS:
    I don't get Sylvia's response. This is about static methods, what are instances are needed for??Yes, the question is about static methods. I included the example with non-static methods for a comparison. According to JLS 15.12.2, both examples should cause a compiler error.
    And why you create a Sub object to call the method, and dont just call "Sub.m(..)"Yes, it would make more sense to call Sub.m(i). Let�s change it. Now, I ask the same question. Why is there no compiler error?
    ====
    DANPERKINS:
    The error in your logic stems from calling static methods on instances, as ounos pointed out. Solution: don't. You won't see any more ambiguities.A static member of a class may also be accessed via a reference to an object of that class. It is not an error. (The value of the reference can even be null.)
    Originally I was looking only at the case with non-static methods. Therefore, I used sub.m(i). Once I understood that case, I added the static modifiers. When posting my question, I wish I had also changed sub.m to Sub.m. Either way, according to JLS 15.12.2, a compiler error should occur due to ambiguous method invocation.
    ====
    SILVIAE:
    The question was not about finding an alternative approach that doesn't throw up an ambiguity. The question related to why, in the particular situations described, the ambiguity arises in only one of them.
    Yes.
    Proposing an alternative approach doesn't address the question.
    Yes.
    ====
    If anyone is really interested, here is some background to the question. Some people studying for a Sun Java certificate were investigating some subtleties of method invocations:
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=019182
    I remember seeing the non-static case discussed in this forum once before in a more practical context. jschell probably knows the link.

  • SSDT: Creation of localDB instances from project file - Sql Server Unit testing purposes

    I have a SqlServer Database Project in my solution (VS2013 Professional) which has a corresponding test project with some stored procedure unit tests. Currently I am using a LocalDB and as far as I understand a local database instance is created in C:\Users\[User]\AppData\Local\Microsoft\Microsoft
    SQL Server Local DB\Instances\Projects and the specific .mdf file referenced in the SQL Server Object Explorer is in C:\Users\[User]\AppData\Local\Microsoft\VisualStudio\SSDT\[ProjectName]. The unit tests run fine on my local machine which I have developed
    the project on.
    My issue is we have a box which is configured to check out the project file from our version control, build the project using ms build commands and then run the unit tests using VSTest.Console. Usually with C# Test projects we reference the test project
    dll and the unit tests run fine. I have referenced the dll for the test project with the stored procedure unit tests in. 
    With the Stored Procedure unit tests however we get this exception: 
    Initialization method [project].[spTest].TestInitialize threw exception. System.Data.SqlClient.SqlException: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 50 - Local Database Runtime error occurred. The specified LocalDB instance does not exist.
    After some digging I have realised that the localdb instance seems to be created when the project itself is created in VS not when it is built. Specifically when the localdb is first used and if you look into the appData folder of the test machine there
    is no corresponding mdf file for the project.  
    The question is is there a way to set up a localDB instance on the new machine if all you have the project file? The only purpose of the project on the test machine is to run the unit tests, no other development purposes. VS2013 Professional is installed
    on the test machine but a solution only using config file changes or MSBuild/VSTest commands would be preferable.
    I realise you could change the connection string to an actual test database and run the unit tests of that but we quite like the localdb approach for the testing. I also realise that you could potentially transfer the mdf file (haven't tested this solution)
    as well, though I would prefer if there is a solution to my initial question. 
    http://technet.microsoft.com/en-us/library/hh234692.aspx
    http://msdn.microsoft.com/en-us/library/hh309441(v=vs.110).aspx
    I have been reading up on LocalDB and I assume a automatic LocalDB is created when you create a sql server database project (ie on localdb first use). I have tried adding the database creation to the test project config file but do not really know where
    to go from there. The second link does not really specify when the named localdb will be created if you add the config items and I am not even sure if that is an actual solution.  Here's my test project config file for reference
    <configSections>
    <section name="system.data.localdb" type="System.Data.LocalDBConfigurationSection,System.Data,Version=4.0.0.0,Culture=neutral,PublicKeyToken=[PublicKeyToken]"/>
    <section name="SqlUnitTesting_VS2013" type="Microsoft.Data.Tools.Schema.Sql.UnitTesting.Configuration.SqlUnitTestingSection, Microsoft.Data.Tools.Schema.Sql.UnitTesting, Version=12.0.0.0, Culture=neutral, PublicKeyToken=[PublicKeyToken]" />
    </configSections>
    <system.data.localdb>
    <localdbinstances>
    <add name="SimpleUnitTestingDB" version="11.0" />
    </localdbinstances>
    </system.data.localdb>
    <SqlUnitTesting_VS2013>
    <DatabaseDeployment DatabaseProjectFileName="..\..\..\SimpleUnitTestDB\SimpleUnitTestDB.sqlproj"
    Configuration="Release" />
    <DataGeneration ClearDatabase="true" />
    <ExecutionContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    <PrivilegedContext Provider="System.Data.SqlClient" ConnectionString="Data Source=(localdb)\Projects;Initial Catalog=SimpleUnitTestDB;Integrated Security=True;Pooling=False;Connect Timeout=30"
    CommandTimeout="30" />
    </SqlUnitTesting_VS2013>
    Thanks in advance for any response. Sorry if there is any misunderstanding, while I have been using VS to develop from the start, this is the first time I have used a Sql Server Database Project. 
    Regards,
    Christopher. 

    Yes, you can create a LocalDB instance manually. You use the SqlLocalDb utility, see here:
    http://technet.microsoft.com/en-us/library/hh212961.aspx
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Is there a way to access ABAP OO instances from a batch job report

    Hello,
    I am looking for a way to access ABAP OO instances from a batch job report. My circumstances are the following:
    I have got some ABAP OO coding that identifies other objects (class instances) that have to be processed (they have a DoIt method that does some calculation). As this processing is time consuming and performace relevant I have to parallelize this in batch jobs. This batch jobs however can only be "simple" ABAP reports according to SM36. The problem is now that I dont really know how to tell the batch job report what objects to process. Somehow I have to access theses instances from  that batch job report.
    Does anybody have an idea?
    Greetings
    Matthias

    Hi David,
    thanks a lot for your help. After a lot of searching on the net this seems to be the only way to cope with it. However I am not sure about the locking mechanisms and if its suitable for mass data processing. In the help page you suggested the following is stated which I do not fully understand::
    "The current lock logic does not enable you to set specific locks for the following requirements:
    ·        Many parallel read and write accesses
    ·        Frequent write accesses
    ·        Division into changeable and non-changeable areas
    Although the lock logic makes the first two points technically possible, they are not practical because most accesses would be rejected."
    Does this mean
    a) if I dont want to set "specific locks" for frequent write accessess I am fine
    or
    b) I am discouraged from use shared memory technics for frequent write accessess?
    In the latter case I will have a problem...
    What do you think?
    Greets
    Matthias

  • Jump link works in IE not Firefox - more specific

    To be more specific than in my previous question:
    I am using Dreamweaver CS4. I have a spry collapsible panel on the page; each panel is labeled with the name of a paper. At the top of the page, I provide some context for the papers (papers are in the spry drop-down content). I created links from the names of the papers at the top of the page to the names of the papers in the spry labels. When I preview the page, the links work in IE but not in Firefox, version 3.5.2. When I right click on the link in Firfox and choose "open in a new window," a new window opens; jump doesn't work. If I choose "open link in new tab" a new tab is created; duplicate page; no jump.
    Please someone help me to understand why the jump link doesn't work in Firefox. Could it be because the links are to tabs on the collapsible panel? Is there another way to create the jump from the top of the page to a particular panel?
    Thanks.

    Please post a URL to your test page.  There's no way to help you without seeing your page & code.
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

  • To More Specific Class & Plugin Architecture

    Hello there,
    I have a plugin architecture and I want to load a particular class on demand, when a user clicks a button etc.
    I can do this using 'Get LV Class Default Value.vi' knowing the path of the .lvclass file, and I can then use the 'To More Specific Class' vi to cast it from type LV Object to the specific class I know it to be.
    However if I have 30 different classes with this method I would have to have 30 different class constants in a case structure so I can cast to the right one.  This works but it means all the classes are loaded into memory when the program is run, even though the user may never want to use most of them, which is a waste of time/memory.
    Is there a better way of doing this please?
    Thanks,
    Martin

    I wonder if minute 4:00 in Michael's video will help you. It avoids the constants, as long as all the classes are descendants of a common class:
    http://vishots.com/005-visv-labview-class-factory-pattern/

  • Switch instance from EE mode to SE

    Is there any way to switch Oracle instance from enterprise edition to standard?
    For example I have Oracle EE with mounted DB.
    Can I set some parameter so that after restarting instance will crashes if DB has bitmap indexes (only EE option)?
    And is there any way to disable (without restarting instance) all EE features for query processing such as bitmap index conversion or parallel query processing?
    Thanks

    The only way to properly convert from an Enterprise Edition database to a Standard Edition database is through an Export/Import operation. The Export/Import operation does not introduce data dictionary objects specific to the Enterprise Edition, because the SYS schema objects are not exported. Oracle recommends using the Standard Edition Export utility to export the data. After the Import in the Standard Edition database, you are only required to drop all user schemas related to Enterprise Edition features, such as the MDSYS account used with Oracle Spatial.
    Below are the basic steps you need to follow to migrate your database(s).
    1.Install Oracle Standard Edition in different ORACLE_HOME.
    2.Backup your databases. Recommended either COLD backup or Oracle Export. If database is critical and getting downtime for consistent backup is not possible, then perform HOT backup before switching database to Oracle Standard Edition.
    3.Shutdown database using 'shutdown immediate' or 'shutdown normal'
    4.Set your new ORACLE_HOME and other Oracle variables appropriately. Make sure that below environment variables are pointing to new ORACLE HOME.
    export ORACLE_HOME
    export LIBPATH
    export LD_LIBRARY_PATH
    export SHLIB_PATH
    export TNS_ADMIN
    5.If you are using any of the below parameters, turn them off before starting database.
    SYSTEMTRIG_ENABLED
    JOB_QUEUE_PROCESS
    6.Start database under new Oracle Home.
    At this point, your database is running in Oracle Standard Edition but all the Oracle dictionary tables/packages are still in Enterprise Edition. You, also, need to migrate these objects to Standard Edition. To do that, execute following scripts after connecting to Oracle as INTERNAL or SYSDBA
    $>sqlplus /nolog
    SQL>connect internalOR
    SQL>connect /as sysdba
    SQL>@?/rdbms/admin/cataproc.sql
    SQL>@?/rdbms/admin/catlog.sql
    Above scripts will recreate all the SYSTEM objects used by Oracle.
    If you are using Oracle RMAN Catalog in your database then you also need to upgrade RMAN Catalog. To do that, connect to RMAN and execute upgrade catalog
    $rman
    RMAN>connect target
    RMAN>upgrade catalog;
    7.Shutdown database and restart it.
    8.Post Migration Steps: If you are performing any backups using RMAN or any database maintenance jobs such rebuild indexes, make sure to update your scripts appropriately.
    §Oracle Standard Edition supports only one RMAN channel. Make sure to update your backup/restore scripts with one channel allocation.
    §Oracle Standard Edition supports only 2GB memory allocation, make sure to adjust your memory allocation accordingly.
    §Oracle Standard Edition doesn’t support index rebuild ONLINE
    Regards,
    Dinesh

  • How to refer to enclosing instance from within the member class?

    Hi
    How to refer to the enclosing instance from within the member class?
    I have the following code :
    import java.awt.*;
    import java.awt.event.*;
    public class MyDialog extends Dialog
         public MyDialog(Frame fr,boolean modal)
              super(fr,modal);
              addWindowListener(new MyWindowAdapter());
         public void paint(Graphics g)
              g.drawString("Modal Dialogs are sometimes needed...",10,10);
         class MyWindowAdapter extends WindowAdapter
              public void windowClosing(WindowEvent evt)
                   //MyDialog.close(); // is this right?
    In the above code, how can I call the "close()" method of the "Dialog" class (which is the enclosing class) from the inner class?
    Thanks in advance.
    Senthil.

    Hi Senthil,
    You can directly call the outer class method. Otherwise use the following way MyDialog.this.close(); (But there is no close() method in Dialog!!)
    If this is not you expected, give me more details about problem.
    (Siva E.)

  • How to refer to an IB controller instance from code???

    Hi all. I know this must be simple but I have just never run into this before.
    When you drag an array controller from IB's palette into your top-level window, it instantiates it, right? All well and good - it's controlling my array and updating the tableView that is bound to its arrangedObjects just fine.
    Now I want to refer to it (the instance of the controller) from code. I have its class files, VoteeController.h and .m, but since I didn't make the instance, I don't know how to reference the instance. What I want to do is get the selection of the controller. That's all!
    I cannot code mySelection = [VoteeController selectedObjects], because that is a class object.
    How do I refer to the instance of this controller that IB instantiated when I dragged it onto the main window??
    I have the model object, playersArray, which has the data but doesn't have the selection since it is not a controller. I need to get the selected objects of the array controller that I made in IB.
    Thanks for any help!!

    Yes, I found a way to do it. So I am glad I can help. I will paste in the notes I took for myself.
    Ask any questions if the notes are not clear or do not work for you.
    NOTES:
    Settings for IB:
    TextModel NSObject:
    Class: TextModel (same as @interface)
    TextViewController Object Controller:
    Connections: content to TextModel
    Class: NSObjectController
    Bindings: none
    Content: control-dragged to TextModel.
    Keys: testString
    NOTE: Also works with no connection but setting in Bindings of Bind To Controller: TextModel, "blank" Controller Key and Key Path of self. ("TextModel.self") as Controller Content Content Object.
    NSTextView:
    Controller: TextViewController
    Connections: none
    Bindings:
    Controller: TextViewController
    Controller Key:selection
    Key Path: testString
    SUMMARY:
    1) Model Object - no connection needed. No keys needed. Just enter the Class name in the ID field (the Class name is the name of the Class whose instance contains the getters and setters for the object you want this Model Object to represent).
    2) Controller Object -
    A. Leave Class alone unless it makes new objects.
    B. No connections.
    C. Use Attributes panel to enter keys for the objects in the Model that you want.
    D. Bindings: bind to the Object Model. Leave the Controller Key blank and enter "self" in the Model Key Path.
    3) View Object -
    A. Leave Class alone (NSTextView)
    B. Turn off all RTF options if plain text.
    C. No connections.
    D. Bindings: bind to the View Controller. Set the Controller Key to Selection and the Model Key Path to the model key (e.g., testString).
    Now I've screwed up my Array->Two Array Controllers -> Two Table Views so they don't work any more. I had them working but with what I considered kludges (my goal in this project is to learn the BEST way to use Cocoa Bindings so as to have the absolute minimum glue code - I am aiming for the learning process, not a result necessarily - I already have a completely functional app in AppleScript Studio so I am under no "deadline."
    I had it working using your solution and setting some connections (control-drag) also, but I wanted to redesign it and not have to use connections (notice the TextView rules I posted above use no connections at all - only bindings).
    So if anyone reading this knows how to connect a single array as the Model to two NSArrayControllers as the Controllers, and the Controllers to two TableViews as the Views, chime in. I thought I had it down but it just doesn't load the array into the tableView. As usual, the array has its 7 elements in the debugger and in the NSLogs that I do.
    The part that keeps confusing me is that you have to set a class name for each IB element, and I don't want to have a bajillion Class files. I want one or two general Classes that can contain both an array and some strings and booleans and so forth - and I still cannot find the way to access an IB instance from code except the IBOutlet solution you provided. If that's the only way, fine; but I wanted to see if there is another way using Bindings. SURELY people who declare arrays need to obtain the selection for the arrays, and that exists ONLY in the Controller. So are we supposed to interact with the Controllers or not? How to get a controller's selection and use it on your Model array so you can manipulate with it? The controller instance doesn't even have a name.
    Anybody know anything about FIle's Owner? Several of the examples say to connect something to File's Owner but never say why. If File's Owner has access to all properties of the whole project, that would explain why it is used so often. But I do not think that is the case.

  • AddOn: Prevent from loading more than once

    Good Afternoon
    Experts:
    I appreciate you patience as I resurrect this topic since it has become an
    increasing concern here.  We need a way to restrict our AddOn from "being in"
    Task.mgr more than once.  We are working with Terminal Services.  A couple ways we have found more than one instance in TM is the User just opening another session or opening another session after a "problem/Issue/Crash". 
    I have this code which restricts the AddOn from starting more than once here on my local machine:
    Public Sub Main()
            Try
                Dim x As Integer = 0
                Dim Ctr As Integer = 0
                Dim som() As System.Diagnostics.Process
                som = System.Diagnostics.Process.GetProcesses
                Dim Name As String
                For x = 0 To som.Length - 1
                    Name = som(x).ProcessName.ToUpper
                    If som(x).ProcessName = "Test.Enhance" Then
                        Ctr += 1
                    End If
                Next x
                If Ctr > 0 Then
                    MsgBox("LBSI.Enhance AddOn is already started...Exiting application.", MsgBoxStyle.Critical)
                    Exit Try
                Else
                    ReInitializeAddOn()
                    Application.Run()
                End If
            Catch ex As Exception
                HandleException("Main", ex, True)
            End Try
        End Sub
    Is there a better more elegant way to do this? How about for Terminal Services?
    Thanks in advance for your insight,
    EJD

    Not answered...so I will close.

Maybe you are looking for