Bug 1122827 - jbpm-forms-rest-integration doesn't accept url without "/" appended when loading task form
Summary: jbpm-forms-rest-integration doesn't accept url without "/" appended when load...
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: Form Modeler
Version: unspecified
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: DR2
: 6.1.0
Assignee: Pere Fernàndez
QA Contact: Andy Taylor
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-07-24 07:45 UTC by Jan Hrcek
Modified: 2019-02-28 22:39 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.