07-04-2011 12:16 PM
07-05-2011 09:00 AM
07-05-2011 09:09 AM
07-06-2011 05:43 AM
Button save;
this.addButton( save = new Button("Save) );
save.addListener(Events.Select, new Listener<ButtonEvent>() {
@Override
public void handleEvent(ButtonEvent be) {
addWorkflow();
};
}
});
public void addWorkflow() {
WorkflowService workflowService = null;
NodeRef nodeRef;
Date date = new Date();
NodeRef wfPackage = workflowService.createPackage(null);
Map<QName, Serializable> properties = new HashMap<QName, Serializable>();
properties.put(WorkflowModel.PROP_TASK_ID, 3);
properties.put(WorkflowModel.PROP_DUE_DATE, new Date());
properties.put(WorkflowModel.PROP_PRIORITY, 1); // task instance field
properties.put(WorkflowModel.PROP_PERCENT_COMPLETE, 10); // context variable
properties.put(WorkflowModel.PROP_START_DATE, date.getTime());
properties.put(WorkflowModel.PROP_WORKFLOW_DESCRIPTION, "Prova aggiunta workflow");
workflowService.createPackage(wfPackage);
WorkflowDefinition wfDefinition = workflowService.getDefinitionByName(WorkflowModelModeratedInvitation.WORKFLOW_DEFINITION_NAME);
if (wfDefinition == null) {
Object objs[] = { WorkflowModelModeratedInvitation.WORKFLOW_DEFINITION_NAME };
throw new InvitationException("invitation.error.noworkflow", objs);
}
WorkflowPath wfPath = workflowService.startWorkflow(wfDefinition.getId(), properties);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.