Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix @kie-tools/form-generation-tool: Problems generating forms for schemas that have # in the filename. #528

Closed
pefernan opened this issue Aug 30, 2023 · 2 comments · Fixed by apache/incubator-kie-tools#1978
Assignees
Labels
area:form-generation-tool area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly

Comments

@pefernan
Copy link

pefernan commented Aug 30, 2023

The form-generation-tool fails when generating forms for schemas that contain the # character in the name.

Generating form "demo#orderItems"
Cannot generate form "demo#orderItems":  ',' expected. (3:17)
  1 | import React, { useCallback, useEffect, useState }  from "react";
  2 |     import { TextInput, FormGroup, Card, CardBody, Checkbox } from "@patternfly/react-core";
> 3 | const Form__demo#orderItems: React.FC<any> = ( props:any ) => {
    |                 ^
  4 |   const [formApi, setFormApi] = useState<any>();
  5 |   const [ item, set__item ] = useState<string>("");
  6 | const [ order__orderNumber, set__order__orderNumber ] = useState<string>("");

Kogito codegen creates the file using the BPMN processId as the schema name. If the processId contains the . character It is replaced by the # (eg: if the processId is demo.orderItems the generated schema is demo#orderItems.json).

We must make the form-generation-tool shouldn't fail when dealing with # in the schema name and should generate clean id's to be used inside of the generated Forms.

For simplicity, I think the generated form should use the . in the file name, since the form-matching mechanism is done by comparing the form name with the id provided by the runtime, and the runtime will always use the ..

Steps to reproduce:

  1. Generate Patternfly forms using form-generation-tool for any BPM Quarkus project in kogito-examples (for example process-usertasks-quarkus-with-console)
@pefernan
Copy link
Author

Related to #556

@kbowers-ibm
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:form-generation-tool area:tools Issues affecting Apache KIE tooling projects type:bug Something is behaving unexpectedly
Projects
None yet
3 participants