No attribute to indicate whether or not a process definition has a start form

Hi,

I am modeling a process using Flowable eclipse BPMN designer. In the process, I created a start form for the start event using the Built-in form rendering with a form definition (created with the form designer).

<process id="myProcess" name="My process" isExecutable="true">
<documentation>My First Course Viewer Test Process</documentation>
<startEvent id="startevent1" name="Start">
  <extensionElements>
    <activiti:formProperty id="firstname" name="firstname" type="string" required="true"></activiti:formProperty>
    <activiti:formProperty id="lastname" name="lastname" type="string" required="true"></activiti:formProperty>
    <activiti:formProperty id="age" name="age" type="long" required="true"></activiti:formProperty>
    <activiti:formProperty id="course" name="course" type="enum" required="true"></activiti:formProperty>
  </extensionElements>
</startEvent>

Using Flowable Engine API
processEngine.getRepositoryService().createProcessDefinitionQuery().listPage(0,5);

I got all the list of deployed processes. However, the object of ProcessDefinition returned contains hasStartFormKey attribute (which I would imagine that is not applicable to the form that I created). But there is no attribute that returns whether or not that processdefinition has a start form. I am guessing that the hasStartFormKey attribute isn’t applicable (to my understanding this is meant to be set for external form rendering), or am I wrong, if so what will this be set as when using Built-in form?

Using Flowable REST
http://localhost:8080/flowable-rest/service/repository/process-definitions
I got all the list of deployed processes. However, there is a “startFormDefined” attribute in the returned json but is set to false (i.e. “startFormDefined”:false).

BTW, when I was able to get the start form data when I called this API:
formService.getStartFormData(processDefinitionId)

I want to maintain using the Flowable Engine API but I don’t know how I could get list of processdefinitions that will contain a similar “startFormDefined” and that will be set to true for my defined startForm. Or, is there something am not doing right in during the design process?

No, your analysis is correct. The form properties have no influence on the flag on the process definition.
What’s your use case for going form properties? They are quite limited in what they can do. A formkey + your form properties in a json file (you could even add it to the same deployment if you want) is quite similar and more flexible.

Hi Joram,

Thanks for confirming my analysis. I have decided to create an HTML for which I added to the same process directory location and provided the formkey value. But I can’t seem to be able to retrieve this HTML form either using formService.getStartFormData(processDefinitionId) or formService.getStartFormData(processDefinitionId).getFormProperties() the result is:

{

“formKey”: “start_my_myProcess.frm”,
“deploymentId”: “2536”,
“formProperties”: [],
“processDefinition”: {
“id”: “myProcess:3:2539”,
“revision”: 1,
“originalPersistentState”: null,
“name”: “My process”,
“description”: “My First Course Viewer Test Process”,
“key”: “myProcess”,
“version”: 3,
“category”: “http://www.activiti.org/test”,
“deploymentId”: “2536”,
“resourceName”: “MyTestProcess.bpmn20.xml”,
“tenantId”: “”,
“historyLevel”: null,
“diagramResourceName”: “MyTestProcess.myProcess.png”,
“variables”: null,
“hasStartFormKey”: true,
“suspensionState”: 1,
“ioSpecification”: null,
“engineVersion”: null,
“suspended”: false,
“persistentState”: {
“suspensionState”: 1,
“category”: “http://www.activiti.org/test
},
“graphicalNotationDefined”: true
}
}

When tried another API formService.getRenderedStartForm(processDefinitionId), I am getting this error

 org.jboss.resteasy.spi.UnhandledException: org.flowable.engine.common.api.FlowableObjectNotFoundException: Form with formKey 'start_my_myProcess.frm' does not exist
    at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76)
    at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212)
    at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:168)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:411)
    at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:202)
    at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:221)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56)
    at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51)

So, could please let me know how I could get the HTML start form (and, subsequent task forms defined as part of the process)?

Here is my modeled process.
image