2 Replies Latest reply on Jun 27, 2007 11:48 AM by Ricardo Marques

    process upload with tomahawk

    Ricardo Marques Novice

      Hi

      i'm try to upload a process to the jbpm engine, using file upload from tomahawk library, but i having this exception:

      
      Caused by: org.jbpm.JbpmException: process definition does not have a name
       at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:80)
       at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
       at com.pep.workflow.server.command.DeployProcessCommand.execute(DeployProcessCommand.java:30)
       at com.pep.workflow.server.beans.command.CommandService.execute(CommandService.java:64)
       ... 55 more
      
      
      


      I'm using this code to the deployment:

      public Object execute(JbpmContext jbpmContext) throws Exception {
      
       if (this.inputStream == null)
       throw new NotSetWorkflowException("required attribute not set!");
      
       ProcessDefinition pf = new ProcessDefinition();
       pf.parseParZipInputStream(this.inputStream);
      
       jbpmContext.deployProcessDefinition(pf);
      
       return pf;
       }
      
      ...
      
      InputStream zip = this.uploadedFile.getInputStream();
      
       Command cmd = new DeployProcessCommand(zip);
       Object result = execute(cmd);
      
      ...
      


      When I run the debugger I get the process definition without the properties set, after the parsing.

      Any idea?


        • 1. Re: process upload with tomahawk
          wfe wfe Newbie

          does it have a name like

          <process-definition
           xmlns="urn:jbpm.org:jpdl-3.2" name="pd-name">...</process-definition>

          "ricardomarques" wrote:
          Hi

          i'm try to upload a process to the jbpm engine, using file upload from tomahawk library, but i having this exception:

          
          Caused by: org.jbpm.JbpmException: process definition does not have a name
           at org.jbpm.db.GraphSession.deployProcessDefinition(GraphSession.java:80)
           at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
           at com.pep.workflow.server.command.DeployProcessCommand.execute(DeployProcessCommand.java:30)
           at com.pep.workflow.server.beans.command.CommandService.execute(CommandService.java:64)
           ... 55 more
          
          
          



          • 2. Re: process upload with tomahawk
            Ricardo Marques Novice

            yes it does, i forgot to paste the definition:

            
            <?xml version="1.0" encoding="UTF-8"?>
            
            <process-definition
             xmlns="urn:jbpm.org:jpdl-3.1" name="holiday-request">
             <swimlane name="initiator">
             <assignment expression="user(grover)"></assignment>
             </swimlane>
             <start-state name="enter request">
             <task name="request entry" swimlane="initiator">
             <controller>
             <variable name="start date" access="read,write,required"></variable>
             <variable name="duration" access="read,write,required"></variable>
             </controller>
             </task>
             <transition name="" to="evaluate request"></transition>
             </start-state>
             <end-state name="end"></end-state>
             <task-node name="evaluate request">
             <task name="entry evaluation" swimlane="initiator">
             <controller>
             <variable name="start date" access="read"></variable>
             <variable name="duration" access="read"></variable>
             <variable name="info" access="read"></variable>
             <variable name="decision"></variable>
             </controller>
             </task>
             <transition name="More info needed" to="give addition info"></transition>
             <transition name="approve/disapprove" to="end"></transition>
             </task-node>
             <task-node name="give addition info">
             <task name="additional info entry" swimlane="initiator">
             <controller>
             <variable name="start date" access="read"></variable>
             <variable name="duration" access="read"></variable>
             <variable name="info"></variable>
             </controller>
             </task>
             <transition name="" to="evaluate request"></transition>
             </task-node>
            </process-definition>