cancel
Showing results for 
Search instead for 
Did you mean: 

start custom workflow using action execute script

himanshuk4u
Champ in-the-making
Champ in-the-making
Hi, i am new to alfresco
I want to create a rule, with the "execute a script" actions. I want to start the advanced workflow with the help of the rules.
i have created workflow using activiti and in alfresco share by default in rules execute script is showing only start pooled review and approve workflow .
how can i display my custom workflow ?
how i can create my custom action ?
where i should create javascript to perform an action so that document i attach to workflow get copied/moved to 'approved' folder i created in user homes/himanshu/approved


Thank You

Himanshu Kapoor
Dell International Services
17 REPLIES 17

himanshuk4u
Champ in-the-making
Champ in-the-making
hi all

i know this topic is already discussed but can anybody tell me where we need to put javascript
we will have to define script task in workflow definition or we need to place somewhere else.

mitpatoliya
Star Collaborator
Star Collaborator
I  think you are missing some thing over here.
Your custom workflow need not be displayed anywhere. Your steps should be as follow.

1) Create custom workflow deploy in alfresco
2) Create alfrescojavascript  file which can trigger your custom workflow.
3) Place that script file ex.triggermyworkflow.js under companyhome>scripts space in alfresco
4) Create a rule execute triggerworkflow.js script on arrival of any document.

You are good to go. Smiley Happy

Hi mitpatoliya, I find this topic fit my needs too. I have to execute my custom script on a folder to start a wf. I want to do it the smart way. The action "Execute Script" is good to go. But I need it to see the js file on the classpath, not on the repository, is it possible?

Hi,Mittal Patoliya

I have a surf dashlet in that i have created an button and i wanted to start workflow on this button click.

On this button click i have popup "hello text" which works fine,

So how can i do that, Have you any idea about it.

Thanks

Hi ‌ , now you need to create one alfresco side webscript which could start your workflow.

Then call that webscript in javascript where you are showing that "hello text" alert.

I am trying to do as you have explained.

Thank you ,

Hi, Mit

i have tried to call webscript using remote.call("url");

and using

var connector = remote.connect("alfresco");
var data = connector.get("/startCustomWorkflow");

but the webscript not called.
how can i trigger workflow.
please help me.

First test your webscript directly. If it is working correctly then try to integrate it with your alfresco share.

To call webscript in alfresco share client side javascript you can use Alfresco's Utility methods.

Check this post

 

Thank you, Mittal Patoliya

I will try