Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8310269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:23:59+00:00 2026-06-08T19:23:59+00:00

I want to start a workflow programatically. So written a web script. Execute Script

  • 0

I want to start a workflow programatically. So written a web script.

Execute Script :

function startWorkflow()
{
   var workflow = actions.create("start-workflow");
   workflow.parameters.workflowName = "activiti$alfGroupReview";
   workflow.parameters["bpm:workflowDescription"] = "Please review ";
   workflow.parameters["bpm:groupAssignee"] = people.getGroup( "GROUP_site_collaborators");;
   var futureDate = new Date();
   futureDate.setDate(futureDate.getDate() + 7);
   workflow.parameters["bpm:workflowDueDate"] = futureDate; 
   workflow.execute(document);
   return ;
}

For the above script, I am getting error “document is not defined”. I am referring https://forums.alfresco.com/en/viewtopic.php?f=34&t=42677 and http://livinginjava.blogspot.in/2008/10/starting-alfresco-workflow-using.html links.

So I update my script to :

function startWorkflow()
{
var nodeRef = "workspace://SpacesStore/25285e6c-2995-49fe-aa50-1270cefc806a";
var docNode = search.findNode(nodeRef);
   var workflow = actions.create("start-workflow");
   workflow.parameters.workflowName = "activiti$alfGroupReview";
   workflow.parameters["bpm:workflowDescription"] = "Please review ";
   workflow.parameters["bpm:groupAssignee"] = people.getGroup( "GROUP_aloha_collaborators");;
   var futureDate = new Date();
   futureDate.setDate(futureDate.getDate() + 7);
   workflow.parameters["bpm:workflowDueDate"] = futureDate; 
   workflow.execute(docNode);
   return ;
}

Here, nodeRef : is ref of a document from document library.

Now new error is :

500 Description:    An error inside the HTTP server which prevented it from fulfilling the request.

Message:    06270056 Wrapped Exception (with status template): 06270273 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/justransform/startWF.get.js': null

Exception:  org.alfresco.scripts.ScriptException - 06270273 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/justransform/startWF.get.js': null

    org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:195)

thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T19:24:01+00:00Added an answer on June 8, 2026 at 7:24 pm

    This code runs fine if:

    • docNode is not null. You should add a check for this.
    • Your group exists. Probably worth adding a check for this.
    • The workflow exists with the ID specified. Use the workflow console to confirm this. For example, the ID your provided is not an
      out-of-the-box workflow. If it is custom, maybe you haven’t deployed
      the workflow successfully or you have the ID incorrect.

    Also, do not use a variable called “workflow”. Alfresco already defines a root-scoped object called “workflow”. Speaking of that, feel free to use the workflow JavaScript API to invoke your workflow instead of an action. Either should work, though.

    I ran your code successfully using the JavaScript console and a workflow id of “activiti$activitiParallelGroupReview” (and after changing your workflow variable to workflowAct).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a situation like this: start(); <Some code> end(); I want start() function
I want to start several threads, retrive data from net, perform some actions with
I want to start a phar script as an executable, directly by doing foo.phar
I want to start an application which will use ajax push, however the web
I want to start a new thread using a C function, not an objective-C
I want to create a workflow that will be persistent and which will consist
I have a GUI application written with python+tkinter. In my workflow, I generally start
I want to start manage application ( Settings -> Application -> manage application ->
I want to start a calculation task that will last for a couple of
I want to start an activity when the user presses the space bar. My

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.