cancel
Showing results for 
Search instead for 
Did you mean: 

add form in startEvent

biiyamn
Champ in-the-making
Champ in-the-making
I want to add a form in startEvent, i make a link in html home page that calls startProcessInstanceByKey to display the form but it does not appear
1 REPLY 1

chris_joelly
Champ in-the-making
Champ in-the-making
Hello Abidi,

i dont know how u integrate Activiti and what the context in your web app is, but the formKey is just a string stored with the startEvent or userTask, it is up to u to interpret that string as URI to a form u want to display.
This means, in a form where u list the tasks of an assignee u can read that formKey of an userTask and build a link to it via <a href="… formKey …">Open</a>.
If u want to display the processes in a list then u can get the formKey of the startEvent and create an <a href> as well to dispatch to the form assiciated with the startEvent.

The following is an example from an Activiti / JSF example which is available through SVN on
https://svn.camunda.com/fox/demo/activiti-cdi/activiti5-cdi-jsf-task-management, a processDefinitionList is created through a bean and it contains a list of available processes, and with #{formService.getStartFormData(v_process.id).formKey} the formKey of the startEvent is read and a link it created using the JSF tag hSmiley SurprisedutputLink, so the user can click on that link and is routed to the start form of that process.


    <h:dataTable value="#{processDefinitionList}" var="v_process">
     <h:column>
      <f:facet name="header"><hSmiley SurprisedutputText value="#{msg.processKeyLabel}" /></f:facet>
      #{v_process.key}
     </h:column>
     <h:column>
      <f:facet name="header"><hSmiley SurprisedutputText value="#{msg.processNameLabel}" /></f:facet>
      #{v_process.name}
     </h:column>
     <h:column>
      <f:facet name="header"><hSmiley SurprisedutputText value="#{msg.processVersionLabel}" /></f:facet>
      #{v_process.version}
     </h:column>
     <h:column>
      <f:facet name="header">Action</f:facet>
      <hSmiley SurprisedutputLink value="#{formService.getStartFormData(v_process.id).formKey}">
       Start
       <fSmiley Tonguearam name="processDefinitionKey" value="#{v_process.key}"></fSmiley Tonguearam>
      </hSmiley SurprisedutputLink>
     </h:column>
    </h:dataTable>

hope that helps…

Chris