Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

How to get username in createdBy property of contentfragment/folder when workflow is started by that user?

Avatar

Level 4

Hi All,

I have business requirement where I'm creating folders & content fragment using the workflow.

So, for this I created one custom process step where I'm getting ResourceResolver after execute method as below:

try(ResourceResolver rr = workflowSession.adaptTo(ResourceResolver.class)){
    Resource cfModel = rr.getReource(cfmpath);
    FragmentTemplate ft = cfModel.adaptTo(FragmentTemplate.class);
    ContentFragment cf = ft.createFragment(folder, cfName, cfTitle);
}

This is working fine, but when I check CF's property jcr:createdBy="admin" is coming.

Instead, I want the user/account name who has triggered this workflow.

 

Could anyone please advise me as to how I get the desired result?

 

Many Thanks,

sesmic 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

0 Replies