I'm integrating an applet on a workflow in the Alfresco. I created a new button org/alfresco/components/form/controls/workflow/activiti-transitions.ftl
here
...
<button onclick="changePDF(); this.disabled=true; return false;"> Change </button>
<div id="pdfTexto" style="width:1000px;height:1000px"></div>
<div class="applet">
<script type="text/javascript">
deploy();
</script>
</div>
</#if>
And this button change (through the javascript of the applet) calls the functionality of the applet that is make changes in the file of the respective workflow. After this, I want to put "Approved"
like the button accept
standard does. But, I only want to make this after the changes make effect. My applet returns a "ok"
when the changes are completed (the POST request is completed), after this, I want to put "Approved"
and redirect to the same page that "accept" button redirects. In resume, after "ok", make what the accept button does.
My applet updates the content of an exiting document with:
http://localhost:8080/share/proxy/alfresco/api/upload
...
How can I make this? Any hints for a better solution then the below?
Evolution: I'm trying to make this:
var form = new FormData();
form.append("prop_wf_reviewOutcome","Approve");
form.append("prop_bpm_comment","good");
form.append("prop_transitions","Next");
var requestTask = new XMLHttpRequest();
requestTask[Alfresco.util.CSRFPolicy.getHeader()] = Alfresco.util.CSRFPolicy.getToken();
requestTask.open("POST", "http://localhost:8080/share/proxy/alfresco/api/task/"+ taskidVar+ "/formprocessor" + "?" + Alfresco.util.CSRFPolicy.getParameter() + "=" + encodeURIComponent(Alfresco.util.CSRFPolicy.getToken()));
requestTask.send(form);
But lack redirect the page as the "Approve" button.