[EVL] Execute constraint check only once (per model)

Hi All,
I have been working with Epsilon for a few days now and I love the tool so far
I am currently working on a model validation but I cannot find an elegant way to perform a certain check only once for the entire model. The casus/Meta-Model is very simple. I have a Node that has 0..* references to itself. The idea is to have a very simple tree where nodes have a reference to their parent.
What I want to check is that there is one and only one root node, so only one node without a reference. This results in the following check: AT!ATNode.allInstances.select(n|n.Parents.size() == 0).size() = 1
I do not know where to perform this check however. If I perform it in the context of the node, it (correctly) returns an error, but does this for every node.
I also tried to have the entire model as 'context' or to apply the check in a pre-condition, but could not get any of these approaches to work. I also could not find a suitable guard to put on the constraint.
Can you help me find a more elegant solution?
Greetings,
David

Hi David,
Quote:an elegant way to perform a certain check only once for the entire model
May be you could model the "entire model" ... I mean, it's a kind of a good practice to create a ModelRoot class containing all your nodes. [A better name could be "Tree" or another appropriate name according to your domain]
Then your validation wizard, with the exactly same expression, could be set on this class, a.ka. the "entire model" ?
Furthermore, you could also ensure the root unicity by setting proper cardinalities in the metamodel, and avoid writing a check.
I even met a special case where I had to model explicitely the RootNode as a class => A tree contains one root node which itself contains nodes ...
Cheers,
--Eric

Similar Messages

  • Print a block of data (such as a check) only once per section?  How?

    I am creating a batch report for invoices where I summarize all invoiced transactions for the given period and then print a check. I am required to print no more than 20 invoice transaction records per page due to the check paper being printed on. This results in an unknown number of pages per client being invoiced during this batch process. Currently I have a check printing on each page -as a footer- but this is obviously not acceptable.
    I would imagine there is some way of creating a global variable and then using an if statement that checks to see if the current section is equal to the global variable. If it doesn't, print the check, reassign the global variable to equal the current section and move on. This would limit the check print to once per section (client).
    Any ideas on how I would do this? Any suggestions on other ways of doing it?
    Thanks in advance for the guidance!
    Message was edited by:
    BReed - adjusted title for clarity...

    Chipili,
    Here's a completely different method that you may want to consider. In all my Numbers documents that involve dates, I have (strategically located) a 2-Cell table that has a Header cell "Today" and just below it a cell with the formula: =TODAY(). It's handy on several levels. Format your today formula cell with the "1/5/2009" Date option - this format works best (and I don't know why). It doesn't matter how you have formatted the date you want to find, but what you will paste into the Find Window needs to be formatted this way.
    Now, activate the FIND panel with a COMMAND-F and it will open at the bottom of your Numbers window.
    Then to locate the current date you would select your special TODAY cell, COMMAND-C, click in the Find window, COMMAND-V. You will get at least one hit, the cell with the TODAY() expression. If the date appears anywhere else, you will get a line for this in your list of finds and clicking on it will take you there. Often I'm looking for a date a week or 10 days earlier than today's date. It's easy to create an expression for this: =TODAY()-7, for instance.
    Hope this gives you something to think about.
    Jerry

  • Display column titles only once per page

    Hello,
    I am a newbie to BIP (R12.1.3). Below is how the output data shows up in my custom template:
    Vendor type lookup : Expense
    Vendor no: A12345 Vendor Name: Test Vendor1 Vendor Category: Expense - Construction
    VENDOR SITE INVOICE# INVOICE DATE DUE DATE INVCT AMT REM AMT PAYMENT METHOD
    ======== ====== ========= ====== ====== ====== ============
    Kannapolis A#12345 03-MAR-12 15-MAR-12 1000.00 1000.00 Check
    Vendor no: B12345 Vendor Name: Test Vendor2 Vendor Category: Expense - Rents
    VENDOR SITE INVOICE# INVOICE DATE DUE DATE INVCT AMT REM AMT PAYMENT METHOD
    ======== ====== ========= ====== ====== ====== ============
    Test Site B#12345 03-MAR-12 15-MAR-12 1500.00 1500.00 EFT
    The column titles repeat for each vendor since the titles are in the for-each loop under the vendor grouping. However, is there a way to restrict the titles to show up only once per page on all the pages? I tried putting the titles outside the vendor grouping but with in the vendor type lookup grouping. It is displaying the titles only on page1.
    Thanks,
    Monkey

    Hi, could you try Inserting the code <?if:position()=1?> before the header of your template and the code <?end if?> after the header of your template.
    See the a sample code below:
    <?if:position()=1?>
    VENDOR SITE INVOICE# INVOICE DATE DUE DATE INVCT AMT REM AMT PAYMENT METHOD
    <?end if?>
    Thanks,
    mr_bip_learner

  • Print should come only once per document number

    Hi All,
    I have done a script for the WC Document,
    But now the client requires it to print it only once for a particular document number,
    How can we do. Is there any such coding to restrict the print only once per document.
    If anyone knows the solution please post it

    hi
    check the entry in nast table if you find more than 1 enrty that is repeated print .....
    select objky
             kschl
             erdat
             eruhr
             vstat from nast into table gt_date
             where objky eq gv_del_num. ---> document number
      if sy-subrc eq 0.
        sort gt_date by objky erdat descending .
        describe table gt_date lines lv_n.
        if lv_n gt 1.
          gv_repeat = lc_x.
        endif.

  • Start routine: only once per teh load but not once per data packet

    Hi,
    I would like to execute some code in start routine (in update rules) only once per the load but not once per the data packet.
    How can I implement this.
    Regards,

    I once had that same requirement, but in a datasource in R3. I'm not sure if the same solution would work in BW, though. I used a memory id to keep the variable value between packets:
    DATA: ... n_globalvar TYPE n ...
    then I added...
    IMPORT n_globalvar FROM MEMORY ID 'ZMEMID01'.
    ...at the start of the routine to retrieve to the variable the value from the memory id.
    At the end of the code, I exported the variable back to the same memory id...
    EXPORT n_globalvar to MEMORY ID 'ZMEMID01'.

  • What is the best approach for executing this code only once?

    Hi,
    What would be the best way to this using JSF/Java web architecture? I have a login page, login.jsf, that submits login credentials to another servlet and if successful, is redirected to a login success page, which I have called "main.jsf", my application's main page. What I want to do, however, is when the login success mechanism redirects to my application, I want to run a bit of Java code (which requires access to the session object) that executes only once, and then redirects to my application's main page.
    In other words, I could put this Java code on my application's main page, but then it would execute every time a user visited it.
    Any advice on the most efficient way to do this?
    Thanks, - Dave

    laredotornado wrote:
    Thanks for your reply but I have a question. If the filter is executed on every page, then, assuming the user is logged in, the code would be executed every time. How can I create this such that my code snippet is executed only once, preferably after the user is re-directed to the login success page?It is more secure. On login just put the User object as attribute of HttpSession and check in the filter if it is there.

  • Executing the webservice only once by the pdf

    Hi,
    I am using a WebService call in my pdf form but I want to call that webservice only once from the form by that particular user. How can we do that?
    I tried to do this by adding the invisible text field in the form and maintain a flag to check the webservice is executed or not. but when I close the pdf and again reopen then the webservice is executed at the first time so how can I solve this problem?
    Thanks
    Ninad

    Set the Hidden fields Binding property to 'Normal' that way the value in that field is persistent. And then always check for the flag before you execute the code for calling WSDL. Hope this helps.
    Good Luck,
    SekharN

  • Execute case structure only once

    Hi everybody.
    I want to execute a case structure inside a while loop only once. The case strucutre is controlled by a counter, so that every time the counter has a value multiple of N, the program records an acoustic signal and calculate the main peaks of the FFT. The problem I have at the moment is that, every time the case is executed, it records and analyze the sound several times until the counter jumps to the next value. I want the case to execute only once every time the counter has a value multiple of N. I atttach the vi.
    Thank you for your attention guys!!!
    Attachments:
    Pulsations2.vi ‏243 KB

    GERD is right.  You should use a feedback node to store the previous count value.  If the current count is Not Equal AND the remainder is Equal To Zero run your case.
    Since your counts are all integers, I would also recommend changing the representation to an integer type.  I32 would likely be the most appropriate.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Need help in executing EEM applet only once

    Do we have any sample script for EEM applet counter ?  We want applet to execute once after reload after matching a string . We tried couple of solutions like “ server suspend  “( customer does not like server suspend)   and event counter ( this does not allow syslog string matching ). Please let me know if there are any options.
    At the router reload, match the string , bring down the interface and run this applet only once . I have been trying multiple messages in Bootup log for this for bringing the interface down.
    The issue we are facing is that most of the bootup log messages can be triggered when the router is up as well which will result in triggering of the applet which is what we want to avoid.
    event manager applet Interface_down
    event syslog pattern "SPA removed from subslot 0/0"
    trigger delay 10
    action 1.0 cli command "enable"
    action 1.5 cli command "config t"
    action 2.0 cli command "interface gi0/0/0"
    action 2.5 cli command "shutdown"
    action 3.0 cli command "end"
    event manager applet Interface_up
    event syslog pattern "Bulk Sync succeeded"
    trigger delay 100
    action 1.0 cli command "enable"
    action 1.5 cli command "config t"
    action 2.0 cli command "interface gi0/0/0"
    action 2.5 cli command "no shutdown"
    action 3.0 cli command "end"
    end

    This is a bit dirty but you can create an applet to run at startup that creates the event detection applet. Then at the end of the detection applet, have it remove itself from the running config. This means that the  applet running at startup will always create the event detection applet but the event detection applet will only ever run once for that router boot period as it deletes itself after first run.
    The problem is that when you want to have one applet create another applet, you have issues with the inverted commas being correctly configured for the second applet which will cause it to run once, but fail after that. The way you can get around this is to write the applet to a text file on the flash and then copy the contents of the text file to the running config at boot. This preserves the structure of the applet being created and ensures that it will function correctly.
    The following example builds the event detection applet at system restart (BUILDAPPLET)  by copying the file "eventapplet.txt" to running config. The event detection applet (EVENTDETECT) detects a syslog pattern, in this case exiting global config, and runs the applet sending a puts command and outputting HELLO. The event detection applet then removes itself from the running config.
    !# configure the router
    conf t
    !# turn off file prompting to let the BUILDAPPLET run when copying
    file prompt quiet
    !# create the applet that runs at system restart and copies the flash applet to the running config
    event manager applet BUILDAPPLET
     event syslog pattern "%SYS-5-RESTART"
     action 10 cli command "en"
     action 11 cli command "copy flash:eventapplet.txt running-config"
    !# exit
    end
    !######## Create the flash file containing your run once applet ########
    ! enter the tclsh so we can write our applet to a file - put your event detection applet in here between the {} that you want to run once
    tclsh
    puts [open "flash:eventapplet.txt" w+] {
    event manager applet EVENTDETECT
     event syslog pattern "%SYS-5-CONFIG_I"
     action 1.0 puts "HELLO"
     action 2.0 cli command "en"
     action 3.0 cli command "conf t"
     action 4.0 cli command "no event manager applet EVENTDETECT"

  • 0crm_mktattr_attr - delta only once per day possible?

    Hi all,
    we want to use delta functionality for 0crm_mktattr_attr. The problem is, that only once a day the delta for a business partner is beeing transfered to the bw. If you have done another change on the same business partner, no delta is being generated (neither that day nor the next day - so this change is lost). If we change another business partner, a new delta is created (if the business partner was not changed before the first delta. Is there any other setting we have to do to transfer get each change?
    We're using CRM 7.01 SP07, BW 7.0. 0crm_mktattr_attr is already set to Delta-method AIE, changepointers (general) are activated and changepointers for message type RS0026 are also activated.
    Regards,
    Florian

    Hi Florian,
    Any solution for this problem?
    I also need to load data 0CRM_MKTATTR_ATTR and I´m not sure which change pointer I have to activate. For the INITIAL data load into SAP CRM, we deactivate the Change Pointer RS0027 as SAP oriented.
    If I set it back, will this Datasource be Delta enabled?
    Thanks
    Fábio

  • Restricting to filling out form only once per person & knowing who filled it

    Good afternoon, I have two quick questions (I am modifying the 360 feedback form for my feedback purposes):
    1) Are the users only able to fill out the form once, and if not, is there a way to make it so they only fill it out once?
    2) Is there a way to know who filled out the form? (to make sure each employee has filled out it as they are supposed to)
    Thanks for the help!
    John

    John,
    Currently there is no restriction on how many times a user can submit a form. The only workaround would be to add text to your form telling the user to only submit the form one time (basically the honor system). Also if a user does submit it multiple times you can always delete the duplicate data from the view response tab.
    The only way to know who filled out a form is to put a required field on the form to collect the user's name or email address.
    Hope that helps.
    Best,
    Randy Swineford
    FormsCentral product manager

  • [begginer] start button executing sub vi only once

    Hi, I'm very confused by, what it looks, very simple task.
    I have a piece of code and I need to plug it to "start" button which will execute it once when button is pressed, execute once again if I press the button again and so on.
    I tried with "while" loop and true/false button connected to it but, as you know, code inside the loop executes itself continously as long it's true which is incorrect, it doesn't stop when it should.
    I woul'd like it like that: Press start->code in block executes once and thats it, no more unsless I press the button again..
    Please advice.
    ps: I attached piece of vi I need to connect with button. It actually works as inteded but I fail to make it executable with button.
    Solved!
    Go to Solution.
    Attachments:
    untitled.vi ‏13 KB

    Here you go, 2009 version. note that one file is missing.
    Regards,
    Even
    Certified LabVIEW Associate Developer
    Automated Test Developer
    Topro AS
    Norway
    Attachments:
    RunButton.vi ‏14 KB

  • With a document open password - is there a way to ask only once per session?

    Here's my scenario:  User is reading a "password to open" document that contains links to other web pages, etc.  The user clicks on a link, goes to the new page, then uses the back button/back key to return to the password protected document, where they must type in the password to open again, and must do this every time they click a link then later attempt to return to the document. 
    Is there a way around the repeated retyping / reentering / rekeying the password?  (My guess is no, but I'll ask anyway).  The user did type in their password, most of the time just a minute or two earlier, before they clicked on the link in the password protected document. 
    P.S. I have a couple other questions, indirectly related (byproducts) to this general topic.  I'll post those in their appropriate forum, then edit this post with links to those posts.  FYI, the other posts are/will be:
    Is there a better way than manually adjusting each and every link in a document to use javascript and repeating that process each time the document is updated, to make links open in new windows, (when viewing a pdf from within a browser window).  [Edit:  here's that link:  http://forums.adobe.com/message/5055202#5055202 ]
    Is there a way from an html page or from something within a PDF document (at the discretion of the document's author) to open a pdf in the acrobat reader window instead of in the browser, without asking each user to change their reader settings?  [Edit:  I ended up asking this question in the same post listed above]

    Once the instance of Acrobat or Reader containing a password-protected PDF file has been closed, you can't avoid having to re-enter the password. If the links don't target a new tab or window, then the browser will unload the plugin - and aside from changing all the link targets, you can't prevent that.

  • Spry Collapsible Panels - Way to set them open only once per visit?

    I'm wondering if there is a way to set a Spry Collapsible
    Panel to be automatically open on the initial loading of the site,
    but as people navigate around the site and back and forth from the
    home page, to be able to have it closed on subsequent visits to the
    home page.
    Right now I have a collapsible panel set to OPEN by default
    when someone first hits the home page, but if they navigate around
    the site and then click to the home page again, they get the panel
    open again. Naturally, that will end up annoying people.
    Any suggestions?
    Thanks in advance!
    Sara

    Flash local shared object can help with this. Here is some info:
    http://www.bestflashanimationsite.com/tutorials/4/
    http://www.permadi.com/tutorial/flashSharedObject/index.html
    http://www.kirupa.com/developer/mx/sharedobjects.htm
    Best wishes,
    Adninjastrator

  • Execute Javascript in SCRIPT_ITEM onload, but only once

    Hi,
    if I publish my webtemplate then the javascript function (executeJS_SET_ITEM_PARAMETERS_R) inside the script item is executed. The execution is done via onload="javascript:executeJS_SET_ITEM_PARAMETERS_R".
    Within the JavaScript I create some parameters to change some settings of the webtemplate. At then end the command is executed and the template is refreshed.
    1.The problem is that the Javascript is executed recursively (always onload). How can I ensure that the JavaScript is executed only once (the template only refreshed once)?
    2.Within executeJS_SET_ITEM_PARAMETERS_R these lines are commented:
      //To extract specific values of parameters refer to the following:
      //var key = currentState.getParameter( <b>PARAM_KEY</b>).getValue();
      //alert( "Selected key: " + key );
      What is meant by PARAM_KEY? Maybe I can use this parameter to create a condition that ensures to execute the code only once. Where can I found these PARAM_KEYs?
    Thanks for the info.
    BR, Andreas

    You might try this approach, using the following workflow...
    1) *Get Specified Finder Items* -- press the "+" sign, navigate to the target folder and choose it.
    2) *Set Folder Views* -- move the icon slider to 128, etc., and check "Apply Changes to Sub-folders."
    From Automator's File menu select Save As Plug-in > Plug-in for: Folder Actions.
    The AppleScript, located in the User > Library > Scripts > Folder Action Scripts folder, can then be modified:
    on adding folder items to this_folder after receiving added_items
    tell application "Macintosh HD:Users:username:Library:Workflows:Applications:Folder Actions:Make 128.app"
    run -- 'run' replaces 'open added_items'
    end tell
    end adding folder items to
    This has worked for me consistently (so far) using Mac OS 10.4.11; not tested in Leopard. Your results may vary.
    Good luck.

Maybe you are looking for

  • 1.3 not respecting the aspect ratio set: new bug?

    I import a lot of scanned images, crop and straighten them and set a new aspect. I work with: Pentium 4, Windows, 1200x1600 monitor (portrait). I noticed with 1.3 what never happened to me with 1.2, as follows: a. select an image in Develop b. select

  • Safari flash player problem! Pls Help!

    Hi, the issue is that if i'm loading a website with a flash player my safari shows me this: "The page "Electronica / Dance - mp3spy - download mp3" has content of MIME type "application/x-shockwave-flash", but you don't have a plug-in installed for t

  • Insignia LED LCD 42 Picture Fades

    We just bought a 42" Insignia LED-LCD tv and we've noticed that the picture darkens itself and brightens again constantly as we are watching tv. We thought it may be a setting we may have turned on or something, but we cant seem to get it to stop. We

  • Stand-alone client - lookup problem

    I have a stand-alone Java client application (ContactClient) that I want to use to access an EJB called Contact. I am using J2EE, deploying with deploytool. The EJB has a JNDI name of "MyContact", and the Client reference is "ejb/TheContact". The rel

  • App store sends the wrong music

    Hi there, i bought an ep on i-tunes the tracks are not the good ones ARTIST : OCHRE EP : PETL 4 tracks ep I SHOULD GET 1 : petl 2 : bass recorder 3 : neoretro 4 : chronon I GOT 1 : chronon ?? 2 : bass recorder : ok 3 : neoretro : ok 4 : neoretro ?? s