1

I am using filenet BPM for approval system and I want to extract the username from F_Originator so that I can send an email to originator about the status of approved Or rejected document. How can I extract the username from F_Originator in workflow (not using java code)?

3 Answers 3

1

I think I found a way to get the username although it's not making use of F_Originator. I created a string field called username & then at the launch step in Assignment tab I assigned username with userid() and it gives you the username. I think its not the best way to get the username but in my case it worked.

4
  • I was drafting my answer to use userid() good that you got it... it is the right way of getting user id. Ok, how are you getting the user email id to send email?
    – bajji
    Commented Jan 29, 2018 at 17:47
  • Because we already had a configuration setting at a Domain level for an LDAP so I thought that by getting the userid would get me an email of a user automatically but I was wrong and it's not working. Do you have any idea/suggestion how to achieve this functionality?
    – tiktok
    Commented Jan 29, 2018 at 20:14
  • check my updated answer. Also, you can capture and set user email id to the workflow when it is launched...
    – bajji
    Commented Jan 29, 2018 at 21:15
  • User wants the ability to launch the workflow manually so in our case we'll be having only one user who is going to launch the workflow but I still did not get your answer about - how should I get the email-id out of a userid? Do I need to write some code for this?
    – tiktok
    Commented Jan 29, 2018 at 21:48
1

Answer suiting to the exact requirement

  1. At launch step, assign output of userid() to a work flow data field
  2. Use OOTB option to send email (CE_Operations) and edit the OOTB templates or
  3. Have a component queue and establish a VWSession (or you can have custom login module to get VWSession)
  4. Call yourVWSession.convertIdtoUserName(int userId) to get the username
  5. then call yourVWSession.fetchUserInfo(username) it returns VWUserInfo
  6. from VWUserInfo you can use getEMailAddress() to get user email id.

Hope this helps

4
  • I'll try that one and let you know.. I am new to BPM and never wrote a java code for PE. It may take some time for me to figure out what all jars and configs are required to write java code (I'll check Redbook) Thanks for your help.
    – tiktok
    Commented Jan 29, 2018 at 22:33
  • I'm me for any help
    – bajji
    Commented Jan 29, 2018 at 23:11
  • @ Manjunatha Muniyappa: I wrote a code in other post to get the email id. Can you please check it and suggest what's wrong with it. Here is the link - URL to other post
    – tiktok
    Commented Feb 2, 2018 at 21:53
  • @PC84, I couldn't test the code but it looks ok to me. If loggers are not working assuming that you used log4j, try using Sysout's. They gets printed to app server logs. Ex: Systemout log of Websphere
    – bajji
    Commented Feb 2, 2018 at 22:42
0

I don't think there is a way to do it in workflow or at least I don't know.

I would suggest you have a component queue like ce_operations and pass the F_Originator and use vwSession.convertIdToUserName(userId)

**************updated answer************

you can use userid() method to get the user who has processed the workflow. but there is a catch here if there are more than one user involved in processing the workflow, userid() will always return the last user. In order to get the username of the user who launched the workflow try

  1. Define a data field in workflow and assign the value of userid() to it in the launch step
  2. If you are launching workflow from code, you can set the username value to the data field
1
  • If I use default email notification I am getting "Launched By" username in email but I have to use a template to send an email so I think there should be some way to achieve this functionality. I was playing with 'Convert' command but nothing worked for me. Here is the convert command that I think should work - "convert i <user_id>". F_Originator returns integer value but I don't know if it's a user Id or not.
    – tiktok
    Commented Jan 29, 2018 at 15:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.