Discussions
Categories
- 17.9K All Categories
- 3.4K Industry Applications
- 3.3K Intelligent Advisor
- 63 Insurance
- 535.7K On-Premises Infrastructure
- 138.1K Analytics Software
- 38.6K Application Development Software
- 5.6K Cloud Platform
- 109.3K Database Software
- 17.5K Enterprise Manager
- 8.8K Hardware
- 71K Infrastructure Software
- 105.2K Integration
- 41.5K Security Software
BPM getTaskDisplayURL workflow version issue

Hi,
I'm using JDev 11.1.1.9
I prepared custom worklist for webcenter portal and I'm getting tasks of user with bpm api.
For a bpm application, I deployed 2 different version to soa server. They have different URI for their UI project, like following URI:
/workflow/v0.2b/PersonelBPM_ADF/faces/adf.task-flow?_id=PersonelHT_TaskFlow&_document=WEB-INF/PersonelHT_TaskFlow.xml
/workflow/v0.1b/PersonelBPM_ADF/faces/adf.task-flow?_id=PersonelHT_TaskFlow&_document=WEB-INF/PersonelHT_TaskFlow.xml
Also I'm showing task to user in a inline popup using modal-dialog-task-flow. For show task to user, I'm getting display url following code,
Map parameters = new HashMap();
parameters.put(Constants.BPM_WORKLIST_TASK_ID,
task.getSystemAttributes().getTaskId());
parameters.put(Constants.BPM_WORKLIST_CONTEXT,
getWfCtx().getToken());
parameters.put(Constants. BPM_PARENT_URL,
ProjectUtils.getSOAUrl() + "/worklist");
//--
//---------------------------------
String taskURL =
WorklistUtil.getTaskDisplayURL(getWfSvcClient(),
getWfCtx(), task, null,
"worklist", parameters);
This code is giving to me task url; but it's not giving right task url for different version of applications.
Example, I started the process separately. 1 process in 0.1 version, 1 process in 0.2 version.
When I get tasks url, they are same workflow URI for all process in this application; but I'm expecting like following urls:
For 0.1b version:
http://<hostname>:<port>/workflow/v0.1b/PersonelBPM_ADF/faces/adf.task-flow?_id=PersonelHT_TaskFlow&_document=WEB-INF/PersonelHT_TaskFlow.xml/...............................
For 0.2b version:
http://<hostname>:<port>/workflow/v0.2b/PersonelBPM_ADF/faces/adf.task-flow?_id=PersonelHT_TaskFlow&_document=WEB-INF/PersonelHT_TaskFlow.xml/...............................
Also I checked URI of soa composite in Enterprise Manager, they have different URI.
Thanks,
Jack.
Best Answer
-
Hi Jack,
I had a same problem. I solved like this,
String taskDefID = task.getSystemAttributes().getTaskDefinitionId();
String getBPMProjectNameFromTaskDefID(String taskDefID) {
try {
//Example Def ID
//soa_partition/ProjectName!CompositeVersion/UI_ProjectName
//default/BPMProject!0.1/BPMProjectUI
String projectNameWithVersion =
taskDefID.substring(taskDefID.indexOf("/") + 1,
taskDefID.lastIndexOf("/"));
String version =
projectNameWithVersion.substring(0, projectNameWithVersion.indexOf("!"));
return version;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
private String getTaskURIFromTaskDisplayURL(String taskDisplayURL) {
try {
String workflowSubString =
taskDisplayURL.substring(taskDisplayURL.lastIndexOf("workflow"));
String[] splittedworkflowSubString =
workflowSubString.split("/", 3);
String taskURI = splittedworkflowSubString[2];
System.out.println("Task URI : " + taskURI);
return taskURI;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
private String reGenerateTaskDisplayURLByCompositeVersion(String taskURI,
String compositeVersion) {
try {
String workflowURL = ProjectUtils.getWorkflowUrl();
String reGeneratedWorkflowURLWithCompositeVersion =
workflowURL + "/" + "v" + compositeVersion + "/" + taskURI;
return reGeneratedWorkflowURLWithCompositeVersion;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
I solved like this; because task.getSca().getCompositeVersion(), retuned null everytime.
But for use these functions,
All your bpm project URI have to like /workflow/v.1.1/.....
Thanks.
Answers
-
Hi,
Is there any advice?
Is this a bug or my mistake?
Doesn't anybody knows?
Thanks,
Jack.
-
Hi Jack,
I had a same problem. I solved like this,
String taskDefID = task.getSystemAttributes().getTaskDefinitionId();
String getBPMProjectNameFromTaskDefID(String taskDefID) {
try {
//Example Def ID
//soa_partition/ProjectName!CompositeVersion/UI_ProjectName
//default/BPMProject!0.1/BPMProjectUI
String projectNameWithVersion =
taskDefID.substring(taskDefID.indexOf("/") + 1,
taskDefID.lastIndexOf("/"));
String version =
projectNameWithVersion.substring(0, projectNameWithVersion.indexOf("!"));
return version;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
private String getTaskURIFromTaskDisplayURL(String taskDisplayURL) {
try {
String workflowSubString =
taskDisplayURL.substring(taskDisplayURL.lastIndexOf("workflow"));
String[] splittedworkflowSubString =
workflowSubString.split("/", 3);
String taskURI = splittedworkflowSubString[2];
System.out.println("Task URI : " + taskURI);
return taskURI;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
private String reGenerateTaskDisplayURLByCompositeVersion(String taskURI,
String compositeVersion) {
try {
String workflowURL = ProjectUtils.getWorkflowUrl();
String reGeneratedWorkflowURLWithCompositeVersion =
workflowURL + "/" + "v" + compositeVersion + "/" + taskURI;
return reGeneratedWorkflowURLWithCompositeVersion;
} catch (Exception ex) {
ex.printStackTrace();
return "";
}
}
I solved like this; because task.getSca().getCompositeVersion(), retuned null everytime.
But for use these functions,
All your bpm project URI have to like /workflow/v.1.1/.....
Thanks.
-
Hi @BSRT
Thanks for your answer.
Yes, I did all uri as you say and I used your functions.
it's working fine now.
Thanks much.
Jack.