AnsweredAssumed Answered

How can I display the Form in Boriwser

Question asked by al_lv on Nov 22, 2010
Latest reply on Nov 22, 2010 by al_lv
Hey all,

I try to start my Process programmatically, not in Activiti Explorer.
The process should start with a form: <startEvent id="theStart" activiti:formKey="resources/bookorder.form" />

What should I do, to see a form in browser.

I start and deploy a process in a servlet. This is a code:

public class ActivitiTestServlet extends HttpServlet {
   private static final long serialVersionUID = 1L;
   RepositoryService repositoryService;
   RuntimeService runtimeService;
   FormService formService;
     * @see HttpServlet#HttpServlet()
    public ActivitiTestServlet() {
        // TODO Auto-generated constructor stub

    * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
   protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      PrintWriter writer = response.getWriter();
      writer.println("<head><title>Hello World Servlet</title></head>");
      writer.println("   <h1>Hello World from a Sevlet!</h1>");
      catch (Exception e){
         System.out.println("Fehler: " + e);

    * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
   protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      // TODO Auto-generated method stub

   public void buildProcessEngine(){
      ProcessEngine processEngine = new ProcessEngineBuilder()
   public void deploy(){

      String barFileName = "D:/workspace/ActivitiTestServlet/src/barFiles/";
      ZipInputStream inputStream = null;
      try {
         inputStream = new ZipInputStream(new FileInputStream(
      } catch (FileNotFoundException e) {
   public void getServices(ProcessEngine processEngine){
      repositoryService = processEngine.getRepositoryService();      
      runtimeService = processEngine.getRuntimeService();
      formService = processEngine.getFormService();

Can I put the rendered HTML-String in the writer?
I tried to get the form with code: writer.println(formService.getRenderedStartForm("processDefId"));
Is it correct? How get I a processDefinitionId?

Best regards