There is My code
NodeRef workflowNodeRef = workflowService.createPackage(null);
nodeService.addChild(workflowNodeRef, node, ContentModel.ASSOC_CONTAINS, QNAME_FOLDER );
workflowService =serviceRegistry.getWorkflowService();
List<WorkflowDefinition> workflows = workflowService.getAllDefinitionsByName("jbpm$wf:review");
WorkflowDefinition workflow = workflows.get(0);
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(WorkflowModel.ASSOC_PACKAGE, workflowNodeRef);
properties.put(WorkflowModel.ASPECT_WORKFLOW_PACKAGE,workflowNodeRef);
properties.put(WorkflowModel.ASSOC_ASSIGNEE,personService.getPerson("admin"));
properties.put(WorkflowModel.PROP_DESCRIPTION,"Review");
properties.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION,"validation des documents");
properties.put(WorkflowModel.PROP_SEND_EMAIL_NOTIFICATIONS,true );
properties.put(WorkflowModel.PROP_PRIORITY,2 );
WorkflowPath path = workflowService.startWorkflow(workflow.id, properties);
I'm wondering if i had to add something else because when using javascript i did
var workflow = actions.create("start-workflow");
workflow.parameters["bpm:workflowPackage"] = docNode;//
workflow.parameters.workflowName = "jbpm$wf:review";//
workflow.parameters["bpm:workflowPriority"] = "2";//
workflow.parameters["bpm:sendEMailNotifications"] = true;//
workflow.execute(document);
}
and it works so i'm wondering if there is something like workflow.execute for java backed webscript