I want to create an action which uses authority.ftl to pick a user and start a workflow.
How Can I create a simple pooled workflow and assign workflow task to this picked user?
So far, I have this code:
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) {
if (serviceRegistry.getNodeService().exists(actionedUponNodeRef) == true) {
String assocString = (String) action.getParameterValue(PARAM_MY_ASSOC);
NodeRef nodePersonUser = new NodeRef(assocString);
PersonInfo pi = serviceRegistry.getPersonService().getPerson(nodePersonUser);
String username = pi.getFirstName();
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
WorkflowService workflowService = serviceRegistry.getWorkflowService();
properties.put(WorkflowModel.ASSOC_ASSIGNEE, nodePersonUser);
Serializable wfPackage = workflowService.createPackage(actionedUponNodeRef);
properties.put(WorkflowModel.ASSOC_PACKAGE, wfPackage);
properties.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, "My action workflow");
WorkflowDefinition reviewDef = workflowService.getDefinitionByName("activiti$activitiReview");
workflowService.startWorkflow(reviewDef.getId(), properties)
}There are no errors but there are also no items in the workflow tasks.