Skip to main content

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.

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


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.


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


Some documentation can be found here:

 


Less technical documentation is found here:

 


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


@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


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.


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


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.


 

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


A small warning regarding the use of ifsBpaCurrentUserId:

When I tried to use ifsBpaCurrentUserId, it unfortunately stored the user id in lowercase, for example: ‘makode’.
However, in the users tab, it appears as ‘MAKODE’ - in uppercase.

Is this a bug or intentional behavior? Version: 24r1



 


 


 

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

Was this solved in any version that you can also get the current user id when you execute from a button?

 

@KarelCZ  ​@Lahirumala de Mel 


These variables should be available even when WF triggered from button. This should work from 24R1 onwards 


These variables should be available even when WF triggered from button. This should work from 24R1 onwards 

I checked it now in version 24.1.5 and in Workflow Watch log there is only key parameter from page manually added in button definition.

 

 


This variable is only available from inside the workflow execution. it does not show up on the observations 

eg:

you can refer to it inside the workflow as ${ifsBpaCurrentUserId} or execution.setVariable(“ifsBpaCurrentUserId”)


Thanks, I will try later. But when I run WF from projection, there are these parameters in observations.


Reply