3 Replies Latest reply on Apr 21, 2008 8:27 AM by salaboy21

    How to attach an Action dinamically to every Node ?

    francis1970

      Hi all !
      I'd like to know if it's possible to attach at Runtime an Action (on the event Node-enter) to every Node.
      I need it for logging purpose........
      Thanks a lot
      Francesco

        • 1. Re: How to attach an Action dinamically to every Node ?
          salaboy21

          i think not necesary need to add a runtime action to every node programatically.. you can do this adding an action to the process definition level related with an event.

          if you add something like this at the process definition level you can achiva that:

          <process-definition>
          <event type='transition'>
           <action class='com.sample.MyActionHandler'>
           </action>
          </event>
          .... NODES
          
          </process-definition>
          

          And then in your MyActionHandler class you log anything you want..


          • 2. Re: How to attach an Action dinamically to every Node ?
            francis1970

            Hello!
            thanks for your answer. I didn't know about action at process definition level. Thanks it's very useful information.
            Anyway I don't have a chance to modify processDefinition.xml file because they're built by another development team.
            So I just need to attach an action at the process level dynamically.
            I'll look in the documentation if it's possible to do it.........
            thanks again
            Francesco

            • 3. Re: How to attach an Action dinamically to every Node ?
              salaboy21

              You are wellcome.. and you also try to look the APIs because you can add process definition programatically... so i think you can add your piece of action programatically and then add it at process definition level...
              Let me know if you find a good solution!