cancel
Showing results for 
Search instead for 
Did you mean: 

content item independent workflow

beutleri
Champ in-the-making
Champ in-the-making
Hello,

I am new to alfresco.
Is it possible to implement a advanced workflow, which can be started independent of an content item?
So would it be possible to use alfresco only as a workflow engine? Or are the workflows always bound to a content items?
If this is possible, where can the UI to start a process be placed in alfresco?

Thank you very much!
4 REPLIES 4

granddams
Champ in-the-making
Champ in-the-making
I think you can start a workflow without document with the workflow api, it means using web service.
I never seen the possibility natively implemented in the UI.
You can make, for instance, a dashlet with a link which calls your script.

Code for starting a workflow :

var workflowDefinition = workflow.getDefinitionByName("yourworkflow");
var workflowPackage = workflow.createPackage();
var workflowParameters = [];
var workflowPath = workflowDefinition.startWorkflow(workflowPackage, workflowParameters);


var tasks = workflowPath.getTasks();
for (task in tasks){
   tasks[task].endTask(null);
}

mitpatoliya
Star Collaborator
Star Collaborator
I am not sure but i think in latest versions they have provided this feature of creating workflow without content.
In previous versions that was not possible for sure.
You can also create 0kb content which you can use as dummy content to start workflow.

bone
Champ on-the-rise
Champ on-the-rise
Hi,

I think you can start a workflow without providing a NodeRef to a specific content.
Try this:
var workflowDefinition = workflow.getDefinitionByName("activiti$activitiAdhoc");
// the workflowPackage can be left empty
var workflowPackage = workflow.createPackage();
// not necessary: workflowPackage.addNode(aDocumentNodeRef);

var workflowParameters = [];
workflowParameters["bpm:workflowDescription"] = "Hello workflow!" ;
workflowParameters["bpm:assignee"] = people.getPerson("admin");
var futureDate = new Date();
futureDate.setDate(futureDate.getDate() + 3);
workflowParameters["bpm:workflowDueDate"] = futureDate;
workflowParameters["bpm:dueDate"] = futureDate;
workflowParameters["bpm:workflowPriority"] = 1;

var workflowPath = workflowDefinition.startWorkflow(workflowPackage, workflowParameters);


The Workflow JavaScript API can be found <a href="http://wiki.alfresco.com/wiki/Workflow_JavaScript_API">here</a>.

I hope this helps you further 🙂

Oops - sorry I didn't see Grand Dams post before. But maybe double is better…

mstein
Champ in-the-making
Champ in-the-making
You could always go standalone activiti, if you don't want the overhead of alfresco.

If you are using alfresco, the OOB workflows make the workflow package mandatory, so you would need to:

1. Create a custom workflow model with bpm_package not mandatory. (or override the stock alfresco workflow model)
2. Customize your start workflow form to remove the package control.
3. Start a workflow from the share dashboard Task dashlet.

If you are going plain Activiti I recommend the Activiti in Action book.