本文整理汇总了Java中org.activiti.engine.TaskService.saveTask方法的典型用法代码示例。如果您正苦于以下问题:Java TaskService.saveTask方法的具体用法?Java TaskService.saveTask怎么用?Java TaskService.saveTask使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.activiti.engine.TaskService
的用法示例。
在下文中一共展示了TaskService.saveTask方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTaskProperties
import org.activiti.engine.TaskService; //导入方法依赖的package包/类
/**
* Sets the properties on the task, using Activiti API.
*/
public void setTaskProperties(Task task, Map<QName, Serializable> properties)
{
if(properties==null || properties.isEmpty())
return;
TypeDefinition type = typeManager.getFullTaskDefinition(task);
Map<String, Object> variablesToSet = handlerRegistry.handleVariablesToSet(properties, type, task, Task.class);
TaskService taskService = activitiUtil.getTaskService();
// Will be set when an assignee is present in passed properties.
taskService.saveTask(task);
// Set the collected variables on the task
taskService.setVariablesLocal(task.getId(), variablesToSet);
setTaskOwner(task, properties);
}
示例2: main
import org.activiti.engine.TaskService; //导入方法依赖的package包/类
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx =
new AnnotationConfigApplicationContext();
ctx.register(SpringAnnotationConfiguration.class);
ctx.refresh();
assertNotNull(ctx.getBean(ProcessEngine.class));
assertNotNull(ctx.getBean(RuntimeService.class));
TaskService bean = ctx.getBean(TaskService.class);
assertNotNull(bean);
assertNotNull(ctx.getBean(HistoryService.class));
assertNotNull(ctx.getBean(RepositoryService.class));
assertNotNull(ctx.getBean(ManagementService.class));
assertNotNull(ctx.getBean(FormService.class));
Task task = bean.newTask();
task.setName("哈哈");
bean.saveTask(task);
}
示例3: saveEntity
import org.activiti.engine.TaskService; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected Task saveEntity(final Task savingTask) {
final TaskService taskService = lookup(TaskService.class);
final Task task = taskService.createTaskQuery().taskId(savingTask.getId()).singleResult();
task.setName(savingTask.getName());
task.setDescription(savingTask.getDescription());
task.setDueDate(savingTask.getDueDate());
task.setOwner(savingTask.getOwner());
task.setAssignee(savingTask.getAssignee());
taskService.saveTask(task);
NotificationUtil.showSuccess("Задача сохранена");
return task;
}
示例4: addTask
import org.activiti.engine.TaskService; //导入方法依赖的package包/类
protected Task addTask(String name, int priority) {
TaskService taskService = processEngine.getTaskService();
Task task = taskService.newTask();
task.setName(name);
task.setPriority(priority);
task.setAssignee("john");
task.setCategory("testCategory");
task.setDueDate(new Date());
task.setOwner("jane");
task.setDescription("testDescription");
task.setTenantId("testTenant");
taskService.saveTask(task);
return task;
}