cancel
Showing results for 
Search instead for 
Did you mean: 

Create Task for simple workflow

kiran_428
Champ in-the-making
Champ in-the-making
Hi, I am trying create a simple work flow for moving documents from one space to another space for approval using a rule .But I am not able to show this a task in the dash board.Can any one help me?

I am able to get this by creating advanced work flow , but I just wanted to do it using a rule.
23 REPLIES 23

witho
Champ on-the-rise
Champ on-the-rise
I think I know what you mean.

If the call to the URL is a call to an action and the result is a transaction or similar you may use an AJAX call using dojo. Somethihg like this:


      var bindArgs = {            
            url: "www.myRedmine.com/myAction/attribut1=va … t2=valueee…",
            method: "post",            
            mimetype: "text/html",            
            load: function(type,data,evt) {
               //Callback script executed after the AJAX call
            }
      };      
      dojo.io.bind(bindArgs);

I hope this will help you.

tarl
Champ in-the-making
Champ in-the-making
It's exactly what I need but when I use it in a script call by the rule "execute a script", I got this error:
A system error happened during the operation: 09300013 Failed to execute script 'workspace://SpacesStore/5f401a17-af9d-448a-a13a-ef31ce3b426c': 09300012 ReferenceError: "dojo" is not defined. (workspace://SpacesStore/5f401a17-af9d-448a-a13a-ef31ce3b426c#9)


Do you have an Idea or do I need to configure something  ?

tarl
Champ in-the-making
Champ in-the-making
I add that:
Utils.writeDojoScripts(FacesContext context, ResponseWriter out);
And I got this error:
A system error happened during the operation: 09300020 Failed to execute script 'workspace://SpacesStore/5f401a17-af9d-448a-a13a-ef31ce3b426c': missing ) after argument list (workspace://SpacesStore/5f401a17-af9d-448a-a13a-ef31ce3b426c#9)

witho
Champ on-the-rise
Champ on-the-rise
Hi Tarl,

Your problem is that you have to load dojo in the JSP you are making the AJAX call. First of all you must check if you have the dojo scripts in Alfresco. You should have them in …/alfresco/scripts/ajax/dojo.

Then you must load dojo.js in your JSP adding this piece of code:


<script type="text/javascript" src="/alfresco/scripts/ajax/dojo/dojo.js"
            djConfig="parseOnLoad: true"></script>
<script type="text/javascript">
dojo.require("dojo.io.*");
</script>

tarl
Champ in-the-making
Champ in-the-making
hi witho! thx again
I 'm just editing a scipt in the alfresco Compagny Home/Data Dictionary/Scripts so I don't know where to put your javascript for "initializing" dojo…
cheers

witho
Champ on-the-rise
Champ on-the-rise
You must place it in the <head> element of the page (I think it would be JSP) from which you are going to make the AJAX call.

tarl
Champ in-the-making
Champ in-the-making
thx witho!
I did a JSP file which can execute an ajax request…that's works!
but now I need to call this file from the "execute a script" rule. is it possible?
here is an other manner to see my problem:
http://forums.alfresco.com/en/viewtopic.php?f=12&t=22732
thx

witho
Champ on-the-rise
Champ on-the-rise
I think is much easier. You don't need to create a JSP page, you just have to load the dojo in the page where the users will push the action link "start-workflow", just if you call your script from the onclick parameter of your start-workflow action.

If you are makin the AJAX request from a script executed with a rule I think you will need to find from which JSP is being your rule / script executed and add the dojo load code in the <head> element.

I'm sorry if this is not a solution to your problem, I hope this will help.

tarl
Champ in-the-making
Champ in-the-making
Thx again witho!
I think you have really well understood my problem:
If you are makin the AJAX request from a script executed with a rule I think you will need to find from which JSP is being your rule / script executed and add the dojo load code in the <head> element.
But I don't know or I can not find where are those JSP files. For instance I created a script call Transform&delete.js in alfresco but I don't find any file called like that. do you have an idea?
best!

witho
Champ on-the-rise
Champ on-the-rise
As far as I know you must have loaded dojo if you want to make a dojo.io.bind call. So I will try this in your javascript:


    //load Dojo (after the page's onload event has already occurred)
    djConfig = {afterOnLoad : true, require:['dojo.date','dojo.cookie']};
    var e = document.createElement("script");
    e.type = "text/javascript";
    e.src= "/alfresco/scripts/ajax/dojo/dojo.js";
    document.getElementsByTagName("head")[0].appendChild(e);

I hope this will fit to your problem.