15 Replies Latest reply on Jan 4, 2011 1:39 AM by Abhinav Sharma

    Get User Name from Workspace Login

    johnqdaily Level 1
      I have a process set up with a report and I would like to pull the user id and user name from the Workspace login. I am very new at LiveCycleES 8.0 and am having a tough time getting this to work. I have read a couple of different posts but need something more detailed.

      Does anyone know of some Adobe documentation that is geared to beginners in LiveCycle? What about how to pull the user id and user name?

      Thanks in advance!

      John
        • 1. Re: Get User Name from Workspace Login
          Hi John

          just use the foundation service 'Query single row' to read user's commonname from the LiveCycle database. I think that's the only way the get these information:

          i SELECT commonname FROM edcprincipalentity WHERE id = '{$ /process_data/@creator_id $}' AND status = 'CURRENT';

          The variable 'creator_id' is a process variable which is always available. The variable holds the principal id of the user who has initiated the process.

          Regards,
          Nico
          • 2. Re: Get User Name from Workspace Login
            HowardTreisman Level 1
            A very simple way is to use LookupUser DSC.
            You can find docs here:
            http://avoka.dnsalias.com/confluence/display/Public/Lookup+DSC
            and download here:
            http://www.avoka.com/apps/checkcookie?qpac=y&qpac_code=avokaESComponents&location=%2Fapps% 2Fqpacdownload

            You need to drag/drop this component into your workflow, and use the "creator_id" variable that exists in all processes as the input.
            Then assign the particular piece of data you're interested in to a variable.

            If you need more help, email info-at-avoka.com

            Howard
            http://www.avoka.com
            • 3. Re: Get User Name from Workspace Login
              kc@dafolo.dk Level 1
              Hi Nico,

              I need to get the logged in user (not the creator) just the currently logged in user.

              Will this be:

              select ID from EDCPRINCIPALENTITY where status = 'CURRENT';
              • 4. Re: Get User Name from Workspace Login
                Stephane Gervais
                Kim,

                In what context do you need the current user's identity? (i.e.: an orchestration, custom code, something else?) This will determine how you might be able to get at the user's identity.

                Meanwhile, the SELECT statement you propose will not accomplish what you hope it will; the login status of a user is not stored in the database.

                steph
                • 5. Re: Get User Name from Workspace Login
                  kc@dafolo.dk Level 1
                  Hi Stephane,

                  In my process the first user assignment should show them a letter that should be filled with their name, email, phonenumber and so on. So it is ready to be sent/printed right away.

                  Sincerely
                  Kim Christensen
                  • 6. Re: Get User Name from Workspace Login
                    kc@dafolo.dk Level 1
                    Oh, I forgot to tell that I am working in orchestration mode - I would just like to fetch the identity of the current logged in user. Is this not possible?

                    Sincerely
                    Kim Christensen
                    • 7. Re: Get User Name from Workspace Login
                      johnqdaily Level 1
                      Kim,

                      If you just want to get the identity of the logged in user that is going to using the form then you will have to use the JDBC - Query Single Row service in your process.

                      I had this same issue but have built a custom renderer for my forms that pulls in the logged in user's info from the LiveCycle database. In one other custom renderer I am pulling in user info from the LiveCycle database and an Oracle database for other user info.

                      Let me know if you need some help with this.

                      John
                      • 8. Re: Get User Name from Workspace Login
                        Abhinav Sharma Level 2

                        Hi,

                         

                        I have the same problem. I need to fetch the username (current logged in workspace) and put his name ( Or username ) to a field in PDF form programitically.

                        Did you get the solution for this problem?

                        Thanks.

                         

                        -

                        Abhinav

                        • 9. Re: Get User Name from Workspace Login
                          $Nith$ Level 4

                          The solution for your requirement is very very simple.

                           

                          If you have learnt the Action Profile basics, you could find it much easier to do.

                           

                          Quick steps:

                           

                          1. Create a Prepare Data process

                          2. You can find the TaskContext variable already created for you.

                          3. get the currently logged in UserId, Name, email or whatever from the TaskContext object and set the Email/Name/UserId on a field in PDF using XPATH.

                           

                           

                          Nith

                          • 10. Re: Get User Name from Workspace Login
                            Abhinav Sharma Level 2

                            Hi Nith, Thanks for your reply.

                             

                            As you told I tried to do the same but was unable to make it work properly. May be I am doing something wrong. I am new to LC it's lil harder to understand the things.

                             

                            The Steps I had done:

                            1. Under Manage Action Profile, I have created a Prepare Data process in my LC App. I can see the taskContext variable.

                            img_prp_data1.jpg

                             


                              2. I am unable to use this variable. Please help.

                             

                            My Process:

                             

                            myProcess.jpg

                             

                            PDF Form at each assign user:

                            Untitled.jpg

                             

                            Can you please guide me how to use that variable inside my process. It's really urgent for me.

                             

                            Thanks in advance.

                             

                            -

                            Abhinav

                            • 11. Re: Get User Name from Workspace Login
                              $Nith$ Level 4

                              You are almost there.

                               

                              Just follow the few more steps listed below to reach your goal!

                               

                               

                              1. Open your prepare data process

                              2. Add a SetValue inside of it.

                               

                              3. now set  value = expression

                               

                                  where

                                      value is something like: /process_data/xmlPrepareData/form1/page/yourTextField    (You must set the actual XPATH of your field here)

                                      expression is /process_data/taskContext/object/user/userId

                               

                               

                              You are done now.

                               

                              In the same way you can set the User Name using the following expression

                               

                              /process_data/taskContext/object/user/CommonName

                               

                               

                              I hope this may help you!

                               

                              Nith

                              • 12. Re: Get User Name from Workspace Login
                                Abhinav Sharma Level 2

                                Hi Nith,

                                 

                                I did the same but again it doesn't work.

                                 

                                • I have created prepare data process by adding on my PDF Form (by Manage Action Profiles option on xdp form).

                                 

                                • I do add a SetValue next to start point.

                                 

                                • Mapping done by, value = expression.

                                 

                                 

                                When I am running this process inside the workspace it doesn't kick off and exits with an error.

                                 

                                An error occurred creating the form (task 203, form 0). (ALC-WKS-007-040)

                                LCerr.jpg

                                 

                                What I am doing wrong?

                                 

                                Please tell me how to integrate mine process with this one.

                                Thanks.

                                 

                                -

                                Abhinav

                                • 13. Re: Get User Name from Workspace Login
                                  Han Dao Level 1

                                  Hi Abhinav,

                                   

                                  The error that you get seems like the form is not viewable. If that is the case, then you may have to check the part where you use the Render Service to render the form. It may be something in the variable:

                                   

                                  Variable > xxx.xdp (name of the variable that calls the form) > Advanced Setting > Render Service > Service Name and its Service Input & Output.

                                   

                                  Hope it help.

                                   

                                  HD

                                  • 14. Re: Get User Name from Workspace Login
                                    $Nith$ Level 4

                                    Something have gone wrong with your prepare data process.

                                     

                                    Enable Record & Playback and find out the activity which is causing this issue.

                                     

                                    Or send your LCA. I will have a look at it.

                                     

                                    Nith

                                    • 15. Re: Get User Name from Workspace Login
                                      Abhinav Sharma Level 2

                                      Hi Nith, Thanks a lot.

                                       

                                      I re-deployed the application & It worked. It was strange but working now....

                                       

                                      This issue is solved but another issue is coming (related to Prepare Data process). I will start a new thread for it [ @ http://forums.adobe.com/thread/772932?tstart=0 ]

                                       

                                      Thanks

                                       

                                      -

                                      Abhinav

                                       

                                      Message was edited by: Abhinav_Sharma