We have a requirement to fetch logged in user in BPM worklist and make some fields of ADF form attached with Human task to disable.
Here is the code which might be useful :
String userId = "";
ITaskQueryService queryService;
IWorkflowServiceClient wfSvcClient;
IWorkflowContext wfContext;
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
// wfSvcClient = WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT);
wfSvcClient =
oracle.bpel.services.workflow.client.WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT);
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
logger.info("Current logged in User is " + userId);
Here is the code which might be useful :
String userId = "";
ITaskQueryService queryService;
IWorkflowServiceClient wfSvcClient;
IWorkflowContext wfContext;
String contextStr = ADFWorklistBeanUtil.getWorklistContextId();
// wfSvcClient = WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT);
wfSvcClient =
oracle.bpel.services.workflow.client.WorkflowServiceClientFactory.getWorkflowServiceClient(WorkflowServiceClientFactory.REMOTE_CLIENT);
queryService = wfSvcClient.getTaskQueryService();
wfContext = queryService.getWorkflowContext(contextStr);
userId = wfContext.getUser();
logger.info("Current logged in User is " + userId);
No comments:
Post a Comment