Solved

Context substitution variable in workflow/BPA


Userlevel 2
Badge +2

Hello,

I am trying to update a custom field on a custom page on IFS Cloud using workflow/BPA.

The value needs to be set to the current user Id.

Is there a way to get the current user Id by using a context substitute variable(#USER_ID#) in the value field?

I am using  - IFS Aurena client version: 21.2.1.20211105061905.0

Thanks in advance,

Asheer.

icon

Best answer by ChamariJ 5 August 2022, 06:17

View original

11 replies

Badge +4

Hi Asheer,

I had a same requirement to get the current logged in User-Id for a validation. I was able to read user id using a IFS Projection like below. Variable “Identity” returns the current User-Id.

 

Hope this will help you 😊

Cheers!
Chamari

Userlevel 2
Badge +2

Hi @ChamariJ , 
Thank you for your response. 
However, I am unable to use the variable Identity returned by the read IFS Projection. 
The following error is generated.


You will find below my workflow design.

Is there a way to use the variable in the value field? 
Also, how did you know that the projection to use is Usersetting and the entity set name should be SingletonUser? Is there any Documentation to know where to get these values? 
Do you know if any supporting document/training is available concerning BPA Workflows? 
I have already covered the training session available on IFS Academy. However, it just gives a basic idea about workflows.
Thanks in advance,
Asheer.

Badge +4

Hi Asheer,

Unfortunately I don’t have any idea about your E-Tag error 😥. Did you try to remove it and see? and please try to update with key in Customer LU.


Regarding the UserSettingProjection, I just searched for a projection call which returns the current logged in user and I found SingletonUser is having a where function to retrieve what I want.
 

I also followed the training sessions but could not find any ifs-technical documentation for this. I am using ifs cloud 21R2 and there are some interface changes rather than Aurena in BPA.

Thanks!
Chamari

Userlevel 7
Badge +21

Some documentation can be found here:

 

Userlevel 7
Badge +21

Less technical documentation is found here:

 

Userlevel 3
Badge +6

Hi @ChamariJ ,

 

As discussed internally with @Asheer  the Etag error was actually a bug on our environment (21R1).
Upgrading to 22R1 solved the issue. We tested your solution and it works great. Thank you 🙂

 


Regards,

Trishen

Badge +4

@BawTrishM ,

Thank you for confirming this. Since BPA is new to all of us Please share if you guys find new things in community 😊.

Cheers,

Chamari

Userlevel 7
Badge +21

With the projection set to Read UserSettings, in the above the SingletonUser is used as Entity Set Name, but one can also use Entity Set Name: CurrentPerson. This will return PersonId containing the Identity that one is looking for.

I think I'm too late to solve the issue of @Asheer, but might be useful somewhere in the future.

Userlevel 7
Badge +24

https://docs.ifs.com/techdocs/23r2/040_tailoring/500_business_process_automation/050_business_process_modeling/030_ifs_rest_call/#internal_input_variables

 

see ifsBpaExecutionUserId

Userlevel 4
Badge +7

Note that ifsBpaExecutionUserId internal input variable is deprecated in 24R1 and will be obsoleted in 24R2.

 

From 24R1 it is recommended to use following 2 new internal input variables.

  • ifsBpaCurrentUserDirectoryId - Holds the current directory ID.
    In some cases like SSO, the ifsBpaCurrentUserDirectoryId and the ifsBpaCurrentUserId are non-identical.

  • ifsBpaCurrentUserId - Holds the current user ID.

Badge +1

 

Works only when triggered from Projection. If you trigger WF from button, there are not these variables.

Reply