Recursion with Return instruction without parameter

Please I have a doubt about following code:
public void solveTowers( int disks, int sourcePeg, int destinationPeg,
int tempPeg )
if ( disks == 1 )
System.out.printf( "\n%d --> %d", sourcePeg, destinationPeg );
return;
solveTowers( disks - 1, sourcePeg, tempPeg, destinationPeg );
System.out.printf( "\n%d --> %d", sourcePeg, destinationPeg );
If I enter witch amount variable DISK = 3
I'd like to known: Why ouput after perform the code is
1--->3
2--->3
1--->3 ?
I didn't get it about the mechanism logical of RETURN instruction !!!
Please, some could me help and explain about with mechanism
OBS: An draw or design it will be helpfull for me understant
A lot of thanks
Gmourad

You didn't mention other parameters of your recursive method, so I am not guessing but here is an easier example.
public class Test{
     public void resursive(int num) {
          if (num == 1) {
               System.out.println(num);
               return;
          resursive(--num);
          System.out.println(num);
    public static void main(String[] args) {
          int num = 3;
          Test myTest = new Test();
          a.resursive(num);
1
1
2
recursive(3) -> recursive(2)                                          // print 2
                recursive(2) -> recursive(1)              // print 1
                                recursive(1) -> // print 1It would print the last one first because the upper one would call itself first before print out the value.

Similar Messages

  • Return statement without parameter

    What the return statemet return?
    package examples;
    import nsga2.MultiObjectiveProblem;
    /*  Test problem BNH
    # of real variables = 2
    # of bin variables = 0
    # of objectives = 2
    # of constraints = 2
    public class bnh extends MultiObjectiveProblem{
         public void test_problem (double []xreal, double []xbin, int [][]gene, double []obj, double []constr)
             obj[0] = 4.0*(xreal[0]*xreal[0] + xreal[1]*xreal[1]);
             obj[1] = Math.pow((xreal[0]-5.0),2.0) + Math.pow((xreal[1]-5.0),2.0);
             constr[0] = 1.0 - (Math.pow((xreal[0]-5.0),2.0) + xreal[1]*xreal[1])/25.0;
             constr[1] = (Math.pow((xreal[0]-8.0),2.0) + Math.pow((xreal[1]+3.0),2.0))/7.7 - 1.0;
             return;
    }

    return does two things: It causes the method to end immediately (returns flow of control to the caller), and it specifies what value will be passed back to the caller (returns the method result to the caller). However, when no value is provided, it does only the first--causes the method to end immediately.

  • Sales return with warranty and without!

    Hi,
    I have a scenario like sales return,
    2 cases, with warranty and without warranty
    I need your guidance on controls,
    1st case with warranty,
    Stock has been taken in to the plant with respect to sale return order.
    I generate service order SM01 (Non revenue generated)
    Maintain operations and material
    goods issue and operation confirmation
    technical completion.
    Now I run DP90 for resource related billing. And need to control that service order cost does not go to billing document. But I don't want to bill the customer.
    Please correct me, I only settle my service order and leave it. How should I go about it. Please help me.
    2nd case, when there is no warranty,
    I create a service order SM02 (revenue posting allowed)
    Maintain operations and material
    Then run DP80 to generate quotation and confirm quotation.
    goods issue and operation confirmation
    technical completion.
    Run DP90 for billing the customer.
    Could you please suggest me if I need to make any changes to this. If so, which part of it (SPRO) i need to configure.
    And as per my understanding if service contract exist then it will help to determine fixed price in with out warranty case.

    Hi,
    Yes I could able to run DP90 though I don't declare the order as revenue based. Infact the if refurbishement order (SM03) has to trigger automatically from sales order RA. Infact if it is revenue based we canot even generate it from sale order.
    You can even refer to this following link which states that cycle.
    [http://help.sap.com/saphelp_46c/helpdata/en/e6/4a8df09e0311d189b70000e829fbbd/frameset.htm]
    I have only doubt during this process billing is based on DIP profile. But how does pricing procedure is coming in to picture. And how and where to link Pricing procedure. Please guide me. And from one of my collegue came to know that accounting Indicator can be used to get discount condition in pricing procedure so, that when we run for Warranty cycle we can bring that condition to get 100% discount through KBM1 condition type.
    Regards,
    N,Nagaraju

  • Recursive WITH (Recursive Subquery Factoring) Never Returns

    11.2.0.2 database on Windows, SQL Developer Version 3.2.20.09, build MAIN-09.87 (Database and SQL Developer are on the same machine. I have also tried connecting to a Linux 11.2 database and have the same results.)
    I've been doing some simple testing with recursive WITH (Recursive Subquery Factoring) and when I run this following statement in SQL*Plus it returns instantly. However when running in SQL Developer it never returns, I've let it run for quite a long time (172 seconds) and gotten nothing, I finally kill the statement. Once I ran it and even killing the job didn't come back. I can get an explain plan but if I try to run it, run as script or autotrace it never returns. I have only one plan in the plan_table for this test, and it's only 4 lines long. No errors, no messages.
    WITH get_plan (query_plan, id, planlevel) as
    select ' '||operation||' '||options||' '||object_name query_plan, id, 1 planlevel
    from plan_table
    where id = 0
    union all
    select lpad(' ',2*planlevel)||p.operation||' '||p.options||' '||p.object_name query_plan, p.id, planlevel+1
    from get_plan g, plan_table p
    where g.id = p.parent_id
    SELECT QUERY_PLAN FROM GET_PLAN ORDER BY PLANLEVEL;

    Hi Jeff, using either give the same results. The query is "running", as is the little graphic with the bouncing gray bar is moving back and forth saying either "Query Results" or "Scriptrunner Task" as appropriate.
    OK this is odd. I run a count(*) on plan_table in SQL*Plus and get 4, in SQL Developer I get 487. Hun? That makes no sense I'm connect as the same user in each. Where are all these other entries coming from and why can't I see them in SQL Plus? Does SQL Developer have it's own PLAN_TABLE?
    **EDIT --- Yes that seems to be the case. The PLAN_ID I see in SQL Plus doesn't even exist in the SQL Deveropler version of the table. OK that's good to know. I assume the plan_table for SQL Developer is local to it somehow? It's not in the database as best I can see.
    Edited by: Ric Van Dyke on Feb 7, 2013 5:19 PM

  • Error while calling EJB with a heavyweight Object Parameter

    Hi Everybody,
    I am getting the following Error when i call a EJB with a heavyweight Object Parameter in Sun ONE Application Server 7.0.0_04.
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr: org.omg.CORBA.BAD_PARAM: java.util.PropertyResourceBundle vmcid: OMG minor code: 6 completed: Maybe
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.util.Utility.throwNotSerializableForCorba(Utility.java:1018)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:691)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:39] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.TCUtility.marshalIn(TCUtility.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.corba.AnyImpl.write_value(AnyImpl.java:599)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_any(CDROutputStream_1_0.java:538)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_any(CDROutputStream.java:233)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.ShutdownUtilDelegate.writeAny(ShutdownUtilDelegate.java:196)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.writeAny(Util.java:78)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.write_Array(ValueHandlerImpl.java:446)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:134)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:916)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.OutputStreamHook.defaultWriteObject(OutputStreamHook.java:129)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at java.util.Vector.writeObject(Vector.java:1017)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObject(Native Method)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.invokeObjectWriter(IIOPOutputStream.java:560)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:523)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1062)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:651)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:263)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.writeObjectField(IIOPOutputStream.java:685)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputClassFields(IIOPOutputStream.java:745)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.defaultWriteObjectDelegate(IIOPOutputStream.java:167)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.outputObject(IIOPOutputStream.java:526)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.IIOPOutputStream.simpleWriteObject(IIOPOutputStream.java:123)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValueInternal(ValueHandlerImpl.java:136)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.se.internal.io.ValueHandlerImpl.writeValue(ValueHandlerImpl.java:116)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream_1_0.write_value(CDROutputStream_1_0.java:1082)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.iiop.CDROutputStream.write_value(CDROutputStream.java:259)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.copyObjects(Util.java:440)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.copyObjects(Util.java:296)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:40] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr: java.rmi.UnexpectedException: java.io.IOException: Serializable readObject method failed internally
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.sun.corba.ee.internal.javax.rmi.CORBA.Util.wrapException(Util.java:370)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.rmi.CORBA.Util.wrapException(Util.java:277)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.hrsystem.ejb._HRSystem_Stub.get(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitAddressChange(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.transaction.AddressType.submitToSAP(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.mydata.servlet.MyDataConfirmationServlet.processServlet(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.mot.hris.core.servlet.EnetBaseHttpServlet.service(Unknown Source)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:720)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:278)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at java.security.AccessController.doPrivileged(Native Method)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:274)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:203)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:505)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:158)
    [03/Jun/2005:13:40:41] WARNING ( 2484): CORE3283: stderr:      at com.iplanet.ias.web.WebContainer.service(WebContainer.java:598)
    Can someone please help to solve this.
    Regards,
    Sunil

    Unfortunately there's not really enough information for anyone to help you much. I can tell you've hit an EOF Exception, but that's about it.
    What exactly do you mean by a heavyweight object parameter? Do you mean a large (in memory size) object?
    Without any knowledge of your application, I'd probably start by changing your ejb method to do nothing. That should tell you at least whether it's the serialization of the parameter that's the issue or not. Narrow it down from there.
    If you need more help, printing the entire stack trace of the EOFException and posting it here would be helpful.
    -- Rob

  • A question about a method with generic bounded type parameter

    Hello everybody,
    Sorry, if I ask a question which seems basic, but
    I'm new to generic types. My problem is about a method
    with a bounded type parameter. Consider the following
    situation:
    abstract class A{     }
    class B extends A{     }
    abstract class C
         public abstract <T extends A>  T  someMethod();
    public class Test extends C
         public <T extends A>  T  someMethod()
              return new B();
    }What I want to do inside the method someMethod in the class Test, is to
    return an instance of the class B.
    Normally, I'm supposed to be able to do that, because an instance of
    B is also an instance of A (because B extends A).
    However I cannot compile this program, and here is the error message:
    Test.java:16: incompatible types
    found   : B
    required: T
                    return new B();
                           ^
    1 errorany idea?
    many thanks,

    Hello again,
    First of all, thank you very much for all the answers. After I posted the comment, I worked on the program
    and I understood that in fact, as spoon_ says the only returned value can be null.
    I'm agree that I asked you a very strange (and a bit stupid) question. Actually, during recent months,
    I have been working with cryptography API Core in Java. I understood that there are classes and
    interfaces for defining keys and key factories specification, such as KeySpec (interface) and
    KeyFactorySpi (abstract class). I wanted to have some experience with these classes in order to
    understand them better. So I created a class implementing the interface KeySpec, following by a
    corresponding Key subclass (with some XOR algorithm that I defined myself) and everything was
    compiled (JDK 1.6) and worked perfectly. Except that, when I wanted to implement a factory spi
    for my classes, I saw for the first time this strange method header:
    protected abstract <T extends KeySpec> T engineGetKeySpec
    (Key key, Class<T> keySpec) throws InvalidKeySpecExceptionThat's why yesterday, I gave you a similar example with the classes A, B, ...
    in order to not to open a complicated security discussion but just to explain the ambiguous
    part for me, that is, the use of T generic parameter.
    The abstract class KeyFactorySpi was defined by Sun Microsystem, in order to give to security
    providers, the possibility to implement cryptography services and algorithms according to a given
    RFC (or whatever technical document). The methods in this class are invoked inside the
    KeyFactory class (If you have installed the JDK sources provided by Sun, You can
    verify this, by looking the source code of the KeyFactory class.) So here the T parameter is a
    key specification, that is, a class that implements the interface KeySpec and this class is often
    defined by the provider and not Sun.
    stefan.schulz wrote:
    >
    If you define the method to return some bound T that extends A, you cannot
    return a B, because T would be declared externally at invocation time.
    The definition of T as is does not make sense at all.>
    He is absolutely right about that, but the problem is, as I said, here we are
    talking about the implementation and not the invocation. The implementation is done
    by the provider whereas the invocation is done by Sun in the class KeyFactory.
    So there are completely separated.
    Therefore I wonder, how a provider can finally impelment this method??
    Besides, dannyyates wrote
    >
    Find whoever wrote the signature and shoot them. Then rewrite their code.
    Actually, before you shoot them, ask them what they were trying to achieve that
    is different from my first suggestion!
    >
    As I said, I didn't choose this method header and I'm completely agree
    with your suggestion, the following method header will do the job very well
    protected abstract KeySpec engineGetKeySpec (Key key, KeySpec key_spec)
    throws InvalidKeySpecException and personally I don't see any interest in using a generic bounded parameter T
    in this method header definition.
    Once agin, thanks a lot for the answers.

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • [Error during Export] R3load exited with return code 11

    Hi guys,
    While performing and Unicode Migration, during Export Phase, Migration Monitor returned the following error while exporting a package
    ERROR: 2014-06-01 10:57:44 com.sap.inst.migmon.LoadTask run
    Unloading of 'REGUC' export package is interrupted with R3load error.
    Process '/usr/sap/ECP/DVEBMGS00/exe/R3load -e REGUC.cmd -datacodepage 4102 -l REGUC.log -stop_on_error' exited with return code 11.
    For mode details see 'REGUC.log' file.
    Standard error output:
    sapparam: sapargv(argc, argv) has not been called!
    sapparam(1c): No Profile used.
    sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline
    REGUC.log details:
    (As you see, it does not provide reasons of this error, all messages are informative and alike all other Packages logs)
    /usr/sap/ECP/DVEBMGS00/exe/R3load: START OF LOG: 20140601105052
    /usr/sap/ECP/DVEBMGS00/exe/R3load: sccsid @(#) $Id: //bas/740_REL/src/R3ld/R3load/R3ldmain.c#4 $ SAP
    /usr/sap/ECP/DVEBMGS00/exe/R3load: version R7.40/V1.8
    Compiled Jul 23 2013 21:30:53
    /usr/sap/ECP/DVEBMGS00/exe/R3load -e REGUC.cmd -datacodepage 4102 -l REGUC.log -stop_on_error
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): US7ASCII
    (EXP) INFO: check NameTab widths: Ok.
    (DB) INFO: Export without hintfile
    (RSCP) INFO: UMGCOMCHAR read check, OK.
    (RSCP) INFO: environment variable "I18N_POOL_WIDTH" is not set. Checks are active.
    (RSCP) INFO: I18N_NAMETAB_TIMESTAMPS not in env: checks are ON (Note 738858)
    (RSCP) INFO: UMGSETTINGS nametab creation: ok.
    (RSCP) INFO: Global fallback code page = 1160
    (RSCP) INFO: Common character set is  not  7-bit-ASCII
    (RSCP) INFO: Collision resolution method is 'fine'
    (RSCP) INFO: R3trans code pages = Normal
    (RSCP) INFO: EXPORT TO ... code pages = Normal
    (RSCP) INFO: Check for invalid language keys: activated
    (RSCP) INFO: I18N_NAMETAB_NORM_ALLOW = 999999999
    (RSCP) INFO: I18N_NAMETAB_NORM_LOG   = 1000000002
    (RSCP) INFO: I18N_NAMETAB_ALT_ALLOW  = 10000
    (RSCP) INFO: I18N_NAMETAB_ALT_LOG    = 10003
    (RSCP) INFO: I18N_NAMETAB_OLD_ALLOW  = 0
    (RSCP) INFO: I18N_NAMETAB_OLD_LOG    = 500
    (RSCP) INFO: init SUMG interface (3#$Revision: #1 $); package name: "REGUC".
    (RSCP) INFO: "REGUC001.xml" created.
    (GSI) INFO: dbname   = "ECP20030615080638
    (GSI) INFO: vname    = "ORACLE "
    (GSI) INFO: hostname = "ecp "
    (GSI) INFO: sysname  = "SunOS"
    (GSI) INFO: nodename = "ecp"
    (GSI) INFO: release  = "5.10"
    (GSI) INFO: version  = "Generic_142900-13"
    (GSI) INFO: machine  = "sun4u"
    Tried to find what does R3load Return Code 11 means, but I couldnt find further information on this.
    Any hint of what is causing this error?
    (Please disregard any Filesystem issues since all of them have available space)
    Best!

    After using latest R3load patch, it provides furher information on the log file.
    -------------------- Start of patch information ------------------------
    patchinfo (patches.h): (0.070) R3ldctl: fix CDS views creation in upgrade export mode (note 2
    017805)
    DBSL patchinfo (patches.h): (0.022) Smaller corrections in release 7.40 (th, dp, vmc, dpmon)
    (note 1821404)
    --------------------- End of patch information -------------------------
    process id 27326
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): US7ASCII
    (EXP) INFO: check NameTab widths: Ok.
    (DB) INFO: Export without hintfile
    (RSCP) INFO: UMGCOMCHAR read check, OK.
    (RSCP) INFO: environment variable "I18N_POOL_WIDTH" is not set. Checks are active.
    (RSCP) INFO: I18N_NAMETAB_TIMESTAMPS not in env: checks are ON (Note 738858)
    (RSCP) INFO: UMGSETTINGS nametab creation: ok.
    (RSCP) INFO: Global fallback code page = 1160
    (RSCP) INFO: Common character set is  not  7-bit-ASCII
    (RSCP) INFO: Collision resolution method is 'fine'
    (RSCP) INFO: R3trans code pages = Normal
    (RSCP) INFO: EXPORT TO ... code pages = Normal
    (RSCP) INFO: Check for invalid language keys: activated
    (RSCP) INFO: I18N_NAMETAB_NORM_ALLOW = 999999999
    (RSCP) INFO: I18N_NAMETAB_NORM_LOG   = 1000000002
    (RSCP) INFO: I18N_NAMETAB_ALT_ALLOW  = 10000
    (RSCP) INFO: I18N_NAMETAB_ALT_LOG    = 10003
    (RSCP) INFO: I18N_NAMETAB_OLD_ALLOW  = 0
    (RSCP) INFO: I18N_NAMETAB_OLD_LOG    = 500
    (RSCP) INFO: init SUMG interface (3#$Revision: #1 $); package name: "REGUC".
    (RSCP) INFO: "REGUC003.xml" created.
    (GSI) INFO: dbname   = "ECP20030615080638
    (GSI) INFO: vname    = "ORACLE                          "
    (GSI) INFO: hostname = "ecp                                                             "
    (GSI) INFO: sysname  = "SunOS"
    (GSI) INFO: nodename = "ecp"
    (GSI) INFO: release  = "5.10"
    (GSI) INFO: version  = "Generic_142900-13"
    (GSI) INFO: machine  = "sun4u"
    (GSI) INFO: instno   = "6120023288"
    (RTF) ########## WARNING ###########
            Without ORDER BY PRIMARY KEY the exported data may be unusable for some databases
    (RDI) WARNING: /respaldo/ECP_Export/ABAP/DATA/REGUC.STR: cannot find version token "ver:" at line 1
    (RDI) WARNING: /respaldo/ECP_Export/ABAP/DATA/REGUC.STR: unknown file format, assuming version 2
    (EXP) INFO: table REGUC will be exported with sorting (task modifier)
    ------------------ C-STACK ----------------------
    [0] t_splay ( 0x1020df850, 0xb3, 0x4386, 0x100a02078, 0x0, 0x1020df870 ), at 0xffffffff7b9629
    94
    [1] t_delete ( 0x1020df850, 0x4348, 0x1d9870, 0x1000d0408, 0xffffffff7bb3c000, 0x0 ), at 0xff
    ffffff7b9627e4
    [2] realfree ( 0x101ee7590, 0x1f82b1, 0x1d9cd0, 0x1f82b0, 0xffffffff7bb3c000, 0x101ee7590 ),
    at 0xffffffff7b9623b0
    [3] _malloc_unlocked ( 0x7d40, 0x200000, 0x101edf840, 0x0, 0x101ee7580, 0x0 ), at 0xffffffff7
    b961eb4
    [4] malloc ( 0x7d39, 0x2388, 0x1da428, 0x10038fe84, 0xffffffff7bb3c000, 0x2000 ), at 0xffffff
    ff7b961c28
    [5] rstg_get ( 0x2, 0x0, 0x2, 0x7d10, 0x0, 0x10077d8c0 ), at 0x10038ff4c
    [6] c3_uc_new_cache ( 0x100a02078, 0x284db0, 0x284c00, 0x10077d8c0, 0x100a02108, 0xb3 ), at 0
    x1000d1ce8
    [7] c3_uc_seek_cache ( 0xb3, 0xff79, 0xffffffff7ffcae3e, 0x100a02078, 0x10189fa48, 0x10077d8c
    0 ), at 0x1000d188c
    [8] c3_uc_new_tabcache ( 0x0, 0xb3, 0x4386, 0x100a02078, 0xb3, 0x10077d8c0 ), at 0x1000d13fc
    [9] c3_uc_insert_record_in_cache ( 0xffffffff7ffcb04e, 0x10189fa48, 0x100a02078, 0x100a024c8,
    0xb3, 0x1058c8f84 ), at 0x1000d0408
    [10] c3_uc_insert ( 0x0, 0x100a02078, 0x0, 0x0, 0x10077d8c0, 0xffffffff7ffcb04e ), at 0x1000c
    f944
    [11] c3_uc_convert_table_entry ( 0x1015c61f8, 0x0, 0x100a02078, 0x0, 0x10189f408, 0x31a000 ),
    at 0x1000ce314
    [12] c3_uc_convert_logic_table ( 0x1015c61f8, 0x100a02078, 0x0, 0x4a, 0x100638dc0, 0x10077d8c
    0 ), at 0x1000cdb18
    [13] c3_uc_convert_cluster_data ( 0x100a02078, 0xffffffff7ffcbc50, 0x1015c6428, 0x1015c61f8,
    0x10077d8c0, 0x0 ), at 0x1000cd10c
    [14] c3_uc_convert_cluster_item ( 0xffffffff7ffcbc78, 0xffffffff7ffcbc50, 0x100954770, 0x1038
    6f6e0, 0xffffffff7ffcbb8c, 0x100a02812 ), at 0x1000be1d4
    [15] process_task ( 0xffffffff7ffcbc78, 0xffffffff7ffcbc50, 0x100954770, 0x100a02810, 0x10063
    32e0, 0x10077d8c0 ), at 0x1000b2f58
    [16] CnvCluster ( 0x1014642d0, 0x100954670, 0x100aa9610, 0x2849b8, 0x284800, 0x6cb978 ), at 0
    x1000b1f8c
    [17] cnv_clust2 ( 0x100aa9580, 0xffffffff7ffcc258, 0x100954770, 0xfc0, 0x107d00, 0x100954670
    ), at 0x100062714
    [18] cnv_cp ( 0x100aa9580, 0xffffffff7ffcc258, 0x100aa95e0, 0x0, 0x10077d8c0, 0x1d6c00 ), at
    0x100064644
    [19] process_buffer ( 0x100aa9580, 0xffffffff7ffcc258, 0xfff00, 0x100a97bd0, 0x10, 0x100aa95b
    0 ), at 0x10007162c
    [20] execute_table_unload ( 0xffffffff7ffed610, 0xffffffff7ffdc4b0, 0x0, 0x100aa9580, 0xfffff
    fff7ffcc258, 0x10077d8c0 ), at 0x10006c488
    [21] export_table_task ( 0xffffffff7ffed610, 0x0, 0xffffffff7ffdc368, 0xffffffff7ffcc330, 0xf
    fffffff7ffeedb8, 0xffffffff7ffeec60 ), at 0x10006c934
    [22] db_unload ( 0x100a97b0d, 0xffffffff7ffed610, 0x0, 0x10077d8c0, 0xffffffff7ffeec60, 0xfff
    fffff7bb47540 ), at 0x10006d148
    [23] main_r3ldmain ( 0x72ec00, 0xffffffff7ffff448, 0xffffffff7ffff228, 0xffffffff7bb47540, 0x
    1005fc290, 0x0 ), at 0x1000514e0

  • Tp finished with return code: 208

    Hi Basis Gurus,
    I have received transport data and cofiles from system XYZ. I have copied data and cofiles in /usr/sap/trans/data and /usr/sap/trans/cofiles respectively.
    Now I have change my directory to /usr/sap/trans/bin
    I want to see the Object List before I import the transport request to my test system TST. I have added the transport request XYZK92????? to buffer with tp addtobuffer command and it is successful. Now when I am trying to see the Object list with command tp GETOBJLIST it is giving error message
    This is tp version 340.16.12 (release 640)
    System XYZ is not defined in TPPARAM
    ERROR: System XYZ is not defined in TPPARAM
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 0
    ERRORS: Highest tp internal error was: 0208
    tp finished with return code: 208
    meaning:
      error in transportprofil (param missing, unknown,...)
    XYZ system is the system from where I got the transport request and it is not defined in my STMS domain. I guess we can import transport request from any other SAP system.
    How to resolve this issue ? is any one aware of this.
    Thanks
    Best Regards,
    CK

    I have created the TPPARAM with the above entry. Now getting different error:
    ~
    This is tp version 340.16.12 (release 640)
    Warning: Parameter DBHOST is no longer used.
    Warning: Parameter DBLIBPATH is no longer used.
    Warning: Parameter DBNAME is no longer used.
    Warning: Parameter DBSWPATH is no longer used.
    This is R3trans version 6.13 (release 640 - 12.12.05 - 14:24:42).
    1AETW065 check-sum error in datafile after "1972" bytes.
    2EETW000 Please contact the SAP support.
    exiting ...
    R3trans finished (0016).
    tp returncode summary:
    TOOLS: Highest return code of single steps was: 16
    WARNS: Highest tp internal warning was: 0101
    tp finished with return code: 16
    meaning:
      A tool used by tp broke down

  • Test call of transport control program (tp) ended with return code 0249

    Hi,
    When i release a TR i get the following error
    Pls let me know of what can be the reason for the same
    I did a kernel upgrade 2 days back
    Test call of transport control program (tp) ended with return code 0249
    Message no. TK094
    Diagnosis
    Your transport request could not be exported, since all requirements were not fulfilled.
    Calling the transport control program tp
       "tp EXPCHK BWDK900308 pf=
    WDBSSAPBWD01\sapmnt\trans\bin\TP_DOMAIN_BWD.PFL -Dtransdi"
    which checks the export requirements, returned the following information:
    Return code from tp: 0249
    Error text from tp: ERROR: No connect due to DbSl Load Lib Failure
    System Response
    Further processing is terminated.
    Procedure
    Check the following points:
    u2022     Feasibility of the transport control program tp
    u2022     Parameter settings in the transport profile
    u2022     Availability of the transport directory and the subdirectories (cofiles, data, log, sapnames, bin)
    u2022     Write authorization for the subdirectories
    u2022     Write authorization for the files of the subdirectories cofiles, data, log, sapnames
    Release the request again when the error has been removed

    Hi Balaji,
    End of your question contains the areas to be varified.
    Your SAP seems to be installed in windows environment
    Check transport profile paramater and file permissions.
    Try to browse the directory
    WDBSSAPBWD01\sapmnt\trans\bin\ from start->run
    Check with tp connecting to DB  with tp connect <SID>
    chceck file permission to datafile and cofiles (in case of OS UNIX)
    Regards,
    Ganesh

  • I bought Adobe Photoshop Elements 13 from wal mart today, and when i go to type in my redemption code to get my serial number it says my redemption code is invalid? and yes i have done it with caps and without caps, ive tried everything and I dont know wh

    I bought Adobe Photoshop Elements 13 from wal mart today, and when i go to type in my redemption code to get my serial number it says my redemption code is invalid? and yes i have done it with caps and without caps, ive tried everything and I dont know what to do anymore. I know its non returnable once opened and the package wasnt tampered with when I bought it. im at a loss on what to do

    Redemption Code http://helpx.adobe.com/x-productkb/global/redemption-code-help.html
    -and https://forums.adobe.com/thread/1572504
    Lost serial # http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • Return Sony without the Box?

    Hello,
    I bought a Sony hdr-as100v.
    It works as it should.
    Yet truthfully, I want to exchange it for the Go Pro Hero3 Black.
    Can I return this Sony cam without the original box?
    I have all the accessories, documentation, original recipt, with me.
    Yet I do not have the box the camera came in with.
    Any idea what I can do?

    Hey sonyCamUser,
    Good question! You can absolutely return products without the original packaging as long as you're still within the 15-day return period. Just be aware that a small deduction may apply for any missing documentation or accessories when processing the return. The return period is also extended to 30 days for My Best Buy Elite members and to 45 days for Elite Plus members. Full details can be found here:
    BestBuy.com > Help Center > Return & Exchange Policy
    http://bbyurl.us/RTE
    I hope this helps.
    Aaron|Social Media Specialist | Best Buy® Corporate
     Private Message

  • Return Delivery without reference

    Hi all,
    i have one specific query.
    i have matl in my stock ( customer returns). i know the vendor code but i don't know the reference doc no of GR posted for that purchase order. I want to send this matl back to vendor without any reference.
    I can find out this from ME2L but my requirment is that return delivery without reference. i don't want any reference but return delivery should happen.
    plz help as it is very urgent.

    There are types of Returns here:
    1.Vendor returns against original purchase order
    2.Vendor returns through returns purchase order.
    For your requirement you can use the second option:
    1.If the original purchase order reference is not known, then Purchase Department will prepare a u201CReturn Purchase Orderu201D using T. Code ME21N.  Creation of a Return Purchase Order in the system is similar to that of a regular Purchase Order except that the u201CReturns Indicatoru201D has to be ticked for each line item in the PO.
    2.Next a goods receipt will have to be done with reference to the Returns PO. Such Goods receipt and Invoice receipt has an exactly reverse effect than that of a Regular PO.  Goods Movement Type 161 (T. Code MIGO) is used which reduces the material stock from the Inventory & creates Material and Accounting document
    3.If the material is excisable, then Excise Department will create an outgoing Excise Invoice with reference to material document.
    4.Next, Invoice Verification is done for a Return PO which creates a reverse liability in the system and the amount appears as u201Crecoverableu201D from the Vendor.  FI Team will create a Credit Note through MIRO.
    5.If the vendor sends back a substitute delivery after we have returned goods, we can reference the return delivery when we post the goods receipt for substitute items.

  • Function with return type boolean

    I have created a function with return type boolean as:
    CREATE OR REPLACE FUNCTION fn RETURN BOOLEAN
    AS
    exp EXCEPTION;
    BEGIN
    return TRUE;
    EXCEPTION
    when OTHERS then RAISE exp;
    END;
    FUNCTION fn compiledThen I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'Can someone please help me understand, why this happened?
    Is this because of boolean return type?

    952040 wrote:
    I have created a function with return type boolean as:
    Then I was trying to call this function into dbms_output.put_line procedure, I got this error:
    EXECUTE DBMS_OUTPUT.PUT_LINE(fn);
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'PUT_LINE'
    What is the parameter signature for DBMS_OUTPUT.put_line() ?
    Is is string - as detailed in Oracle® Database PL/SQL Packages and Types Reference guide.
    So how can you pass a boolean data type as parameter value, when the parameter's data type is string?
    PL/SQL supports implicit data conversion. So you can for example pass a number or date value to DBMS_OUTPUT.put_line() - and the PL/SQL engine automatically (and implicitly) converts that (using the TO_CHAR() functions) to a string.
    However, the TO_CHAR() parameter signature supports number and date - not boolean. It cannot convert a boolean value into a string.
    So passing a boolean value means the implicit conversion fails - and results in the above error.
    To make it work, you need to perform an explicit conversion. As as a data type conversion function from boolean to string is not available, you need to write a user defined function. E.g.
    SQL> create or replace function BoolToChar( b boolean ) return varchar2 is
      2  begin
      3    case
      4       when b then return( 'TRUE' );
      5       when not b then return( 'FALSE' );
      6    else
      7      return( null );
      8    end case;
      9  end;
    10  /
    Function created.
    SQL>
    SQL> exec DBMS_OUTPUT.put_line( 'Flag is '||BoolToChar(true) );
    Flag is TRUE
    PL/SQL procedure successfully completed

  • LOV with a query Bind Parameter

    Hello,
    I am following the JHeadStart PDF tutorial over the HR Schema. On the page 45 this tutorial shows how to make a Dynamic Lookup with a Query Bind Parameter to choose the employees of a department with the expresion "p_dpt_id=#{bindings.DepartmentsDepartmentId.inputValue}".
    After that I tried to make the same using a LOV instead of a Lookup but on the popup window opened with the LOV table the "#{bindings.DepartmentsDepartmentId.inputValue}" value is null and I can´t access to this information. If on the LOV definition I write for example "p_dpt_id=30" this work ok and filters the query for the employees of the departen 30, but not with "p_dpt_id=#{bindings.DepartmentsDepartmentId.inputValue}"
    There is another way to do that?
    Thank you very much

    I have done this task using the aid of the JHeadstart manual and these two previously posted threads,
    Group Used as LOV does not return records
    Query Bind Parameters and LOV's [JHS 10.1.3.1]
    The actual process to do it feels rather unintuitive and complicated, but I've tested it and thus far is works flawlessly.
    I whipped up a demo of this using the HR schema and JHeadstart, maybe I will post it on here.

Maybe you are looking for