cancel
Showing results for 
Search instead for 
Did you mean: 

Start WorkFlow by Javascript\Rule adding Resource

7joeblack8
Champ in-the-making
Champ in-the-making
Hi there,


i'm able to start a workflow by javascript applied by a rule on a folder, but i would like to attach a resource.

I mean, i would like to add the document wich i used to start the flow, so it could appears to "OW_ATTACHMENT" in the WorkDesk "Alfresco BPM" field.

Does anyone knows the solution wich fits?

I tried lots of ways, but with no luck,

thanks!
3 REPLIES 3

yes i did.

but i stil didn't get how to proceed 'cause i got no error but still i don't get the attachment.

this is my code
 function startWorkflow(name,docNode)
{   
    var workflow = actions.create("start-workflow");
    workflow.parameters["bpm:workflowPackage"] = docNode;
    workflow.parameters.workflowName = "activiti$AdHocactivitiTimer";
    workflow.parameters["bpm:assignee"] = people.getPerson("admin");
    workflow.parameters["bpm:workflowDescription"] = "test";
    workflow.parameters["bpm:workflowPriority"] = "2";
    workflow.parameters["bpm:sendEMailNotifications"] = true;
    workflow.parameters["initiator"] = people.getPerson("admin");
    var today = new Date();
    var duedate = today.getDate() + 1;
    workflow.parameters["bpm:workflowDueDate"] = duedate;
    workflow.execute(document);
}

function main()
{   
    var docNode = search.findNode(document.nodeRef);
    var name = document.name; 
        startWorkflow(name,docNode);
}

bikshapathi
Champ in-the-making
Champ in-the-making
Hi,

I am very new to alfresco and i want to start an custom work flow in alfresco.

Please any one can share link

Thanks in Advance