Dear community,
I use the code (in WorkflowProcess) below to write a value on the workflow instance.
if (!filePath.isBlank()) {
workItem.getWorkflowData().getMetaDataMap().put("filePath", filePath);
}
It seems that the permission of previous participant matters here.
If I use admin on previous participant step, the code works, but not for other custom users.
I've tried adding "jcr:write", "rep:write" permissions on the custom user, but they don't work in this case.
Could anyone told me what's the right permission to set, or I should includ the custom user into certain group?
Thanks!
Solved! Go to Solution.
Views
Replies
Total Likes
@YuSheng We facing similar issue in one of the project. It was resolved by getting the user session from below code and also making sure that the user access to the payload path
String payloadPath = workItem.getWorkflowData().getPayload().toString();
ResourceResolver resolver = wfsession.adaptTo(ResourceResolver.class);
Resource res = resolver.getResource(payloadPath);
Session session = resolver.adaptTo(Session.class);
And also make sure that he is part the workflow users group
Views
Replies
Total Likes
Do you mean providing write permission to the user I created?
Yes I did try adding "jcr:write" permission on it.
The workflow process is like
1. dialog participant step (upload file and set the path to payload)
2. process step (fetch the path in payload and write it on instance metadata)
If I set participant user in first step to administrator, the process step can successfully write(put) the property on wf instance, but if the participant user is not in administrator group, the second step doesn't work.
Since it's not possible to set the user as administrator, I suppose I need the right permission for the custom user to make it work.
Views
Replies
Total Likes
@YuSheng We facing similar issue in one of the project. It was resolved by getting the user session from below code and also making sure that the user access to the payload path
String payloadPath = workItem.getWorkflowData().getPayload().toString();
ResourceResolver resolver = wfsession.adaptTo(ResourceResolver.class);
Resource res = resolver.getResource(payloadPath);
Session session = resolver.adaptTo(Session.class);
And also make sure that he is part the workflow users group
Views
Replies
Total Likes
I found the problem, the custom user doesn't actually successfully write the property onto payload. So the second step surely get nothing from payload.
It is about the right permission to set content/proj... (payload), not the instance.
Sorry for the misleading information I provided, and big thanks to @Jagadeesh_Prakash @Shashi_Mulugu for the help.
Will mark @Jagadeesh_Prakash 's answer as correct reply.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies