3 Replies Latest reply on Nov 8, 2006 9:02 AM by falazar

    Calling a workflow directly from another webpage link.

    falazar Novice

      From the 3.2 dev version, I am attempting to start a process directly using the link and hidden form provided on the
      participant/startnew.jsf
      page.

      The code looks something like this:

      <a href="#" onclick="clear_linkDummyForm();document.forms['linkDummyForm'].elements['linkDummyForm:_link_hidden_'].value='newExe1921';document.forms['linkDummyForm'].elements['processDefinitionId'].value='1921';if(document.forms['linkDummyForm'].onsubmit){if(document.forms['linkDummyForm'].onsubmit()) document.forms['linkDummyForm'].submit();}else{document.forms['linkDummyForm'].submit();}return false;" id="newExe1921">
      Start Process!

      <!--
      function clear_linkDummyForm() {
      var f = document.forms['linkDummyForm'];
      f.elements['linkDummyForm:_link_hidden_'].value='';
      f.elements['processDefinitionId'].value='';
      f.target='';
      }
      clear_linkDummyForm();
      //-->


      And when I click the form (from another plain HTML page, outside of the JBPM set)
      Several things happen.
      It requires you to login to get into JBPM... this is fine, and wanted behavior.

      But then, it just goes to the startnew.jsf page.

      If I do it again, it will go ahead and go to the start process form.

      and every other time it will alternate the behaviour.

      I know it is setting something somewhere, but Im not sure exactly what.

      But basically it has been asked that we be able to spread the start links around, for use directly in the area we are working with, such as HR or Mainteneance, or anything.

      James Ratcliff

        • 1. Re: Calling a workflow directly from another webpage link.
          falazar Novice

          Here is the code again

          <a href="#" onclick="clear_linkDummyForm();document.forms['linkDummyForm'].elements['linkDummyForm:_link_hidden_'].value='newExe1921';document.forms['linkDummyForm'].elements['processDefinitionId'].value='1921';if(document.forms['linkDummyForm'].onsubmit){if(document.forms['linkDummyForm'].onsubmit()) document.forms['linkDummyForm'].submit();}else{document.forms['linkDummyForm'].submit();}return false;" id="newExe1921">
           Start Process!</a>
          
          <form id="linkDummyForm" name="linkDummyForm" style="display:inline" method="post" action="http://misdev:8181/jbpm-console/participant/startnew.jsf"><input type="hidden" name="linkDummyForm:_link_hidden_" /><input type="hidden" name="processDefinitionId" /><script type="text/javascript"><!--
           function clear_linkDummyForm() {
           var f = document.forms['linkDummyForm'];
           f.elements['linkDummyForm:_link_hidden_'].value='';
           f.elements['processDefinitionId'].value='';
           f.target='';
          }
          clear_linkDummyForm();
          //--></script></form>
          


          • 2. Re: Calling a workflow directly from another webpage link.
            Ronald van Kuijk Master

            I did this once under 3.1, but extended one of the beans with a specific method for this. The it works/it doesnt behaviour could be because of jsf and the state it is in.

            • 3. Re: Calling a workflow directly from another webpage link.
              falazar Novice

              Yes, do we know what state that is, or what var its looking for.
              I poked aroudn a bit, but nothing stood out there.

              James