2 Replies Latest reply on Mar 2, 2010 6:33 PM by gubespam

    Injecting external object into custom activity

    gubespam

      In jbpm, you can use object references to have jbpm to dynamically inject objects into custom activities, like below:

       

      {code}
      import org.jbpm.api.activity.ExternalActivityBehaviour;


      public class Custom implements ExternalActivityBehaviour


      {


          private Object externalThing;

       

          public void setExternalThing( final Object externalThing )


          {


              this.externalThing = externalThing;


          }


          // ...


      }
      {code}

       

      {code}
      <process name="sample_process">
          <start name="start">
              <transition to="custom" />
          </start>
          <custom class="Custom" name="custom">
              <property name="externalThing"><object expr="#{munchkinLand}" /></property>
          </custom>
      </process>
      {code}

       

      I remember reading somewhere (can't find it now), that jbpm will search up the context chain until it finds an object with the given name ("munchkinLand" above). My question is, how does one inject an external resourceinto jBPM so that it can find it?