7 Replies Latest reply on Jul 18, 2007 5:11 AM by harpritt

    Does data In(jection) occur before or after @Create

    harpritt

      my @Create annotated method uses a BUSINESS_PROCESS scoped variable, Im sure ive read that the Injected Variable should be available to the @Create method....

      ... but all i get is a null value...

      so does data In(jection) occur before or after @Create?

      Many thanks

      H

        • 1. Re: Does data In(jection) occur before or after @Create
          gavin.king

          Injected attributes are available during @Create methods, yes.

          • 2. Re: Does data In(jection) occur before or after @Create
            harpritt

            nice one Mr King..... i must be cocking somthing else up.....

            Cheers again

            H

            • 3. Re: Does data In(jection) occur before or after @Create
              harpritt

              Gavin

              Sorry to keep buggin you, but can you point me in the direction of an example showing how to bind to the BP ctx and then retrive in the @create


              Ive done everything that i can , but the damn inject values are allways null....

              @Out(scope=BUSINESS_PROCESS, required = false)
              String aString

              .... aString = "WooooHoooo"

              and then

              @Create
              doYourStuff(){
              System.out.print(aString);
              }

              ..... i cant see where im screwing up

              a pointer in the right direction or example will be ample to see me through this.

              Cheers again


              • 4. Re: Does data In(jection) occur before or after @Create
                gavin.king

                Where is @In?

                • 5. Re: Does data In(jection) occur before or after @Create
                  harpritt

                  Hi

                  I have this SFSB that handles a two page conversations, assigns a value to the crId and also kicks off a @CreateProcess when the @End on the conversation is called.

                  @Stateful
                  @Name("createChangeRequest")
                  public class CreateChangeRequestAction implements CreateChangeRequest {
                  
                   @In(required = false)
                   @Out(scope = BUSINESS_PROCESS, required = false)
                   ChangeRequest changerequest;
                  
                  
                   @Out(scope = BUSINESS_PROCESS, required = false)
                   String crId;



                  And this SFSB that takes care of the process and tries to call the crId that was added to the Business Process scope above.

                  for some reason the crID never seems to get added to the BP context.... until i restart the server.....


                  @Stateful
                  @Name("ticketSystem")
                  public class TicketSystemAction implements TicketSystem {
                  
                   @In()
                   @Out()
                   String crId;
                  
                   @In()
                   @Out()
                   ChangeRequest changerequest;
                  
                   @In(required = false)
                   RequestState requestState;
                  
                   @Create
                   public void findit(){
                   System.out.println("crId");
                   }



                  it really bugs me when i cant get somthing to work.... OCD boy right here!

                  Cheers for any help

                  • 6. Re: Does data In(jection) occur before or after @Create
                    harpritt

                    I wonder if this has to do with the fact that the BP tasks are atomic and that the business scoped modifications are only commited when a task completes..

                    this would explain why the crID is null... maybe... straws clutch clutch... SLEEEEEEEPPPPPPP

                    • 7. Re: Does data In(jection) occur before or after @Create
                      harpritt

                      I think i know what the problem is

                      im setting the value for a business scoped variable inside a method annotated with

                      @CreateProcess(definition = "changerequestprocess")

                      and trying to access it in @Create before ive entered the first task.

                      Am i on the right track.?