3 Replies Latest reply on Sep 6, 2007 10:41 AM by lmichenaud

    How to know who has started a process ?

    lmichenaud

      How can you know who has started a process instance ?
      Or, how can you can get all process instances started
      by a user ?

      The actor notion is only for tasks.

      The only way i see is to attach task on states
      with an assignment handler that uses the actor id
      in the jbpm context.


        • 1. Re: How to know who has started a process ?
          kukeltje

          1: attach a swinlane to the starttask. It will be filled with the actorid of the one who started the process.
          2: By a custom hibernate query

          • 2. Re: How to know who has started a process ?
            dleerob

            Using a swimlane on the start task does work, as Ronald mentioned. Perhaps call it "Initiator", as I've done. Make it a standard on all your processes. Eg, at the top of you processdefinition.xml there should be this:

            <swimlane name="Initiator"></swimlane>

            That swimlane will be filled with the actorId that started the process, again as Ronald mentioned.

            If you have a task on the start node, and you know what the name of that task is, you could get the task instances for the process, and find the one with the name you require, and get the actorId for that task instance.

            Whenever I create a new process, I also set a variable on the process called "sys_initiator", with the username/actorId of the currently authenticated user. This way I can always just get the "sys_initiator" variable when I want to know the username of the person who started the process.

            • 3. Re: How to know who has started a process ?
              lmichenaud

              Thanks for help.