13 Replies Latest reply on Jan 16, 2014 4:25 AM by jocelyn.duc

    404 when submitting a taskform

    jocelyn.duc

      Hello

       

      Now, I can perform a task using KIE, but I get a 404 when submitting the form. I created the form with the markup editor and I am not sure what to put in the action filed of the form. Here is my sample form:

       

      <form action="complete" method="POST" enctype="multipart/form-data">

        <input type="hidden" name="taskId" value="${task.id}"/>

        <div class=""><label for="txt">Your name:</label><input type="text" name="name" id="name"/></div>

        <div class=""><label for="txt">Your email address:</label><input type="text" name="email" id="email"/></div>

        <div class=""><label for="txt">Your birthdate:</label><input type="text" name="birthdate" id="birthdate"/></div>

        <div class=""><input name="Submit" type="submit" value="Continue" id="sb" /></div>

      <div class=""><input name="Cancel" type="button" value="Cancel" id="cb" /></div>

      </form>

       

      Thanks you for your help

       

      Jo

        • 1. Re: 404 when submitting a taskform
          swiderski.maciej

          there is no need for form tags any more, simply use input fields for gathering data and kie workbench will ensure to move the data into proper server component.

           

          HTH

          • 2. Re: 404 when submitting a taskform
            jocelyn.duc

            Hello,

             

            Thank you for your help.

             

            I removed the form tag. When I submit the taskform, I am redirected on the KIE homepage. In the task list, the visited task is still "Ready" and I have no idea how to get in the next user task. It looks like the first task wasn't completed.

             

            My simple BPM:

            Start -----> User Task: Input -----> User Task: Output -----> End

             

            Input: asking for name, email, and birthdate

            Output: display given name, email, birthdate and a "confirm" button

            • 3. Re: 404 when submitting a taskform
              jocelyn.duc

              In fact, I can claim, save and complete the first task, then the second task is ready to claim, but when i claim it, the form isn't here. I just have:

              144 - Output

               

              no input, no button...

               

              On the second task, I want the same form as the first with pre-filled values (given in first task)

              • 4. Re: 404 when submitting a taskform
                swiderski.maciej

                I think you need to start the task (play button on task list) to see the buttons. And there are different tabs on the task form view and you should be looking at work

                 

                HTH

                • 5. Re: 404 when submitting a taskform
                  jocelyn.duc

                  No Play button on the task list. I have:

                   

                  Claim/Release button (lock)

                  Complete button (checkmark)

                  Details button (magnifying glass)

                   

                  If I claim and click the complete button, the form as only his header but no fields and no submit button. I suspect an error in the completion of the fields with the values given in the first task, using ${name}, ${email}  and ${birthday}.

                  • 6. Re: 404 when submitting a taskform
                    swiderski.maciej

                    does your task have these three variables you reference in the form?

                     

                    Could you please check server log if there is any error? If you could attach how does the screen look like it could be useful.

                     

                    Another thing you could try out is to remove all forms you created and allow engine to provide default forms to see if they will be presented and available.

                     

                    HTH

                    • 7. Re: 404 when submitting a taskform
                      jocelyn.duc

                      The default form is displayed and available.

                       

                      I think the problem is in my DataInputSet, DataOutputSet and Assignements. In fact I don't know how to correctly set them

                       

                      3 variables: name, email, birthdate
                      3 fields with id: name, email, birthdate

                       

                      Input task:

                      • Assignements: ?
                      • DataInputSet: -
                      • DataOutputSet: out_name:String,out_email:String,out_birthdate:String

                      Output task:

                      • Assignements: ?
                      • DataInputSet: in_name:String,in_email:String,in_birthdate:String
                      • DataOutputSet: -

                       

                       

                       

                      kie.png

                      bpm.png

                      • 8. Re: 404 when submitting a taskform
                        swiderski.maciej

                        alright, then the problem is actually with the data input/output and mapping of them to process variables.

                         

                        To be able to successfully transfer values from one task to another you need to use process variables. So first of all you need to define variables on the process level: name, email, birthdate all of type String.

                        Then on Input task you don's have data inputs and only data outputs as you expect user to provide this values. So as you have define outputs for them. Then in the associations you need to define which data output is mapped to what process variable:

                        out_name -> name,

                        out_email->email,

                        out_birthdate->birthdate

                         

                        that way the outcome of the Input task will be saved into process variables that later on can be referenced by other tasks. So with knowing that, you need to define data inputs on the Output task (as you have already done) and then associations that will map process variables into data inputs:

                        name -> in_name

                        email -> in_email

                        birthdate -> in_birthdate

                         

                        and then you will have all data available in the form.

                         

                        HTH

                        • 9. Re: Re: 404 when submitting a taskform
                          jocelyn.duc

                          So,

                           

                          Process properties:

                          Globals: name:String,email:String,birthdate:String

                           

                          Input task properties:

                          Assignements: out_name->name,out_email->email,out_birthdate->birthdate

                          DataInputSet: GroupId:Object,Comment:Object

                          DataOutputSet: out_name:String,out_email:String,out_birthdate:String

                           

                          Output task properties:

                          Assignements: name->in_name,email->in_email,birthdate->in_birthdate

                          DataInputSet: GroupId:Object,Comment:Object,in_name:String,in_email:String,in_birthdate:String

                          DataOutputSet: nothing

                           

                          Input task form:

                          <html>
                              <head>
                                  <meta name="viewport" content="width=device-width, initial-scale=1">
                                  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.css" />
                                  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
                                  <script src="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.js"></script>
                              </head>
                              <body>
                                  <div data-role="page">
                                      <div data-role="content">
                                          <input type="hidden" name="taskId" value="${task.id}"/>
                                          <div class=""><label for="txt">Your name:</label><input type="text" name="out_name" id="out_name"/></div>
                                          <div class=""><label for="txt">Your email address:</label><input type="text" name="out_email" id="out_email"/></div>
                                          <div class=""><label for="txt">Your birthdate:</label><input type="text" name="out_birthdate" id="out_birthdate"/></div>
                                      </div>
                                  </div>
                              </body>
                          </html>
                          

                           

                          Output task form:

                          <html>
                              <head>
                                  <meta name="viewport" content="width=device-width, initial-scale=1">
                                  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.css" />
                                  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>      
                                  <script src="http://code.jquery.com/mobile/1.2.0-alpha.1/jquery.mobile-1.2.0-alpha.1.min.js"></script>
                              </head>
                              <body>
                                  <div data-role="page">
                                      <div data-role="content">
                                          <input type="hidden" name="taskId" value="${task.id}"/>
                                          <div class=""><label for="txt">Your name:</label><input type="text" name="in_name" id="in_name" value="${name}" /></div>
                                          <div class=""><label for="txt">Your email address:</label><input type="text" name="in_email" id="in_email" value="${email}" /></div>
                                          <div class=""><label for="txt">Your birthdate:</label><input type="text" name="in_birthdate" id="in_birthdate" value="${birthdate}" /></div>
                                      </div>
                                  </div>
                              </body>
                          </html>
                          

                           

                          I think the problem comes from the output form. Name? Id? ${...}?

                          • 10. Re: 404 when submitting a taskform
                            swiderski.maciej

                            the process properties should be declared as variables and not globals.

                             

                            HTH

                            • 11. Re: 404 when submitting a taskform
                              jocelyn.duc

                              Hello,

                               

                              Variable Definitions:

                              name:String,email:String,birthdate:String

                               

                              So this is not the problem... Are you sure my forms are correct ? id, name and value attributes ?

                              • 12. Re: 404 when submitting a taskform
                                swiderski.maciej

                                you should use names of the data inputs in the forms as that are the names that task service and the task with know. As you do the mapping from process variable (name) into data input of the task (in_name). So that means you need to use ${in_name} on task form.

                                 

                                HTH

                                • 13. Re: 404 when submitting a taskform
                                  jocelyn.duc

                                  I don't know where is the bug...

                                   

                                  Even I write a simple hello world in the task form, the form remains empty during the execution of the process...