Bug 1122827

Summary: jbpm-forms-rest-integration doesn't accept url without "/" appended when loading task form
Product: [Retired] JBoss BPMS Platform 6 Reporter: Jan Hrcek <jhrcek>
Component: Form ModelerAssignee: Pere Fernàndez <pere.fernandez>
Status: CLOSED EOL QA Contact: Andy Taylor <ataylor>
Severity: medium Docs Contact:
Priority: high    
Version: unspecifiedCC: kverlaen
Target Milestone: DR2   
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:07:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Hrcek 2014-07-24 07:45:28 UTC
Description of problem:
When I try to load a task form in an external web app using the new form-modeller's javascript api, I get HTTP 404 instead of relevant error message.

The whole problem seems to be that unlike the "showStartProcessForm" function, which appends "/" to hostUrl in case it's not present, the method "showTaskForm" leaves the url as it is.

Version-Release number of selected component (if applicable):
BPMS 6.1.0 DR1

How reproducible:
Always. 

Steps to Reproduce:
1. When using the jbpm-forms-rest-integration.js api to load a task form, 
use URL of the form "http://localhost:8080/business-central"  (i.e. without "/" at the end) as hostUrl parameter of "showTaskForm" function.

Actual results:
HTTP 404 - is returned from the server

Expected results:
The response should load the form or show proper error message with stack trace even for urls without "/" (as is the case of showProcessStartForm)

Additional info:
See:
https://github.com/droolsjbpm/kie-wb-distributions/blob/master/kie-wb/kie-wb-webapp/src/main/webapp/js/jbpm-forms-rest-integration.js

To fix this you should add a line like this to showTaskForm function:
if (hostUrl.charAt(hostUrl.length -1) != "/") hostUrl += "/";

Comment 1 Pere Fernàndez 2014-07-25 10:15:11 UTC
As Jan said in the previous comment it is needed to add the "/" char at the end of the url if it is missing. 

Commit (master): https://github.com/droolsjbpm/kie-wb-distributions/commit/e6f1b3155494ed0df6466fc564ded3584411ba80

Comment 2 Jan Hrcek 2014-09-09 13:13:29 UTC
Ok, now it's working. Verified with BPMS 6.1.0 DR2