• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Task类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.kie.api.task.model.Task的典型用法代码示例。如果您正苦于以下问题:Java Task类的具体用法?Java Task怎么用?Java Task使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Task类属于org.kie.api.task.model包,在下文中一共展示了Task类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getVariablesMapForTaskId

import org.kie.api.task.model.Task; //导入依赖的package包/类
@Override
public Map<String, Object> getVariablesMapForTaskId(Long taskId) throws RemoteException {
    try
    {
        Task task = AppContext.getService(RemoteWfEngine.class).getRemoteEngine().getTaskService().getTaskById(taskId);
        Content contentById = AppContext.getService(RemoteWfEngine.class).getRemoteEngine().getTaskService().getContentById(task.getTaskData().getDocumentContentId());
        if (contentById == null)
        {
            log.error("Task {} is missing content!", task.getId());
            return new HashMap<String, Object>();
        }
        JaxbContent jaxbTaskContent = (JaxbContent) contentById;
        return jaxbTaskContent.getContentMap();
    }
    catch (RuntimeException e)
    {
        throw new RemoteException("Server error", e);
    }
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:20,代码来源:LocalWfEngine.java


示例2: LocalTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
public LocalTask(Task task, boolean fetchAttachments) throws RemoteException {
    this.id = task.getId();
    this.name = task.getNames().iterator().next().getText();
    this.status = task.getTaskData().getStatus();
    if (task.getTaskData().getActualOwner() != null) {
        this.owner = task.getTaskData().getActualOwner().getId();
    } else {
        this.owner = "";
    }

    if (fetchAttachments) {
        LocalWorkflowRuntimeEngineBI wfEngine = AppContext.getService(LocalWorkflowRuntimeEngineBI.class);
        Map<String, Object> vmap = wfEngine.getVariablesMapForTaskId(task.getId());
        this.componentId = (String) vmap.get("in_component_id");
        this.componentName = (String) vmap.get("in_component_name");
        this.name = (String) vmap.get("NodeName");
        this.setInputVariables(new HashMap<String, String>());
        for (String key : vmap.keySet()) {
            this.getInputVariables().put(key, vmap.get(key).toString());
        }
    }
}
 
开发者ID:Apelon-VA,项目名称:ISAAC,代码行数:23,代码来源:LocalTask.java


示例3: UserTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
public UserTask(Task task) {

    id = task.getId();
    name = task.getName();
    description = task.getDescription();
    priority = task.getPriority();
    status = task.getTaskData().getStatus().name();

    potentialOwners = task.getPeopleAssignments().getPotentialOwners()
      .stream().map(OrganizationalEntity::getId).collect(Collectors.toList());

  }
 
开发者ID:diabolicallabs,项目名称:vertx-process-manager,代码行数:13,代码来源:UserTask.java


示例4: getTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
Task getTask(JBPMConfiguration configuration, Exchange exchange) {
    Task task = exchange.getIn().getHeader(JBPMConstants.TASK, Task.class);
    if (task == null) {
        task = configuration.getTask();
    }
    return task;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:8,代码来源:JBPMProducer.java


示例5: getContentForTasks

import org.kie.api.task.model.Task; //导入依赖的package包/类
@Test
public void getContentForTasks() {
	TaskService taskService = getRuntimeEngine().getTaskService();

	for (TaskSummary summary : taskService.getTasksAssignedAsPotentialOwner("jboss", null)) {
		Task task = taskService.getTaskById(summary.getId());
		Content c = taskService.getContentById(task.getTaskData().getDocumentContentId());
		HashMap<String, Object> d = (HashMap<String, Object>) ContentMarshallerHelper.unmarshall(c.getContent(), null);
		System.out.println(d);
	}
}
 
开发者ID:rhtconsulting,项目名称:task-dashboard-bpms-angular-app,代码行数:12,代码来源:CreateRemoteTasks.java


示例6: getTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
public Task getTask() {
    return task;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:4,代码来源:JBPMConfiguration.java


示例7: setTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
/**
 * The task instance to use with task operations
 */
public void setTask(Task task) {
    this.task = task;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:7,代码来源:JBPMConfiguration.java


示例8: execute

import org.kie.api.task.model.Task; //导入依赖的package包/类
@Override
void execute(KieSession kieSession, TaskService taskService, JBPMConfiguration configuration, Exchange exchange) {
    Task task = taskService.getTaskByWorkItemId(safe(getWorkItemId(configuration, exchange)));
    setResult(exchange, task);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:JBPMProducer.java


示例9: getTasks

import org.kie.api.task.model.Task; //导入依赖的package包/类
private void getTasks() {
	RemoteRuntimeEngine engine = remoteRestSessionFactory.newRuntimeEngine();
	// The TaskService class allows we to access the server tasks
	TaskService taskService = engine.getTaskService();
	String USER = "erics";
	List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(USER, "en-US");
	if (tasks.size() == 0) {
		System.out.printf("No tasks for user \"%s\" as owner...\n", USER);
	} else {
		System.out.printf("Tasks where user \"%s\" is a an owner...\n", USER);
		for (TaskSummary t : tasks) {
			System.out.printf("ID: %d\n", t.getId());
			System.out.printf("Name: %s\n", t.getName());
			System.out.printf("Actual Owner: %s\n", t.getActualOwner());
			System.out.printf("Created by: %s\n", t.getCreatedBy());
			System.out.printf("Created on: %s\n", t.getCreatedOn());
			System.out.printf("Status: %s\n", t.getStatus());
			System.out.printf("Description: %s\n", t.getDescription());
			// LoanApplication la = (LoanApplication)t.getClass();
			System.out.println("---------------");
			Task userTask = taskService.getTaskById(t.getId());
			TaskData taskData = userTask.getTaskData();

			Map<String, Object> m = taskService.getTaskContent(t.getId());

			StringBuilder sb = new StringBuilder();
			Iterator<Entry<String, Object>> iter = m.entrySet().iterator();
			while (iter.hasNext()) {
				Entry<String, Object> entry = iter.next();
				sb.append(entry.getKey());
				sb.append('=').append('"');
				sb.append(entry.getValue());
				sb.append('"');
				if (iter.hasNext()) {
					sb.append(',').append(' ');
				}
			}
			System.out.println(sb);
		}
	}

}
 
开发者ID:rhtconsulting,项目名称:task-dashboard-bpms-angular-app,代码行数:43,代码来源:CreateRemoteTasks.java


示例10: getTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
public Task getTask(Long taskId) {
	return userTaskService.getTask(taskId);
}
 
开发者ID:awizen,项目名称:gangehi,代码行数:4,代码来源:SimpleWFService.java


示例11: getTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
/**
  * Fetches a single task by its unique ID.
  * @param httpRequest
  * @param taskId
  * @throws Exception
  */
 @GET
 @Path("get/{taskId}")
 @Produces(MediaType.APPLICATION_XML)
 public TaskType getTask(@Context HttpServletRequest httpRequest, @PathParam("taskId") long taskId)
         throws Exception {
     assertCurrentUser(httpRequest);

     Task task = taskService.getTaskById(taskId);

     TaskType rval = new TaskType();

     List<I18NText> descriptions = task.getDescriptions();
     if (descriptions != null && !descriptions.isEmpty()) {
         rval.setDescription(descriptions.iterator().next().getText());
     }
     List<I18NText> names = task.getNames();
     if (names != null && !names.isEmpty()) {
         rval.setName(names.iterator().next().getText());
     }
     rval.setPriority(task.getPriority());
     rval.setId(String.valueOf(task.getId()));
     rval.setType(task.getTaskType());
     TaskData taskData = task.getTaskData();
     if (taskData != null) {
         User owner = taskData.getActualOwner();
         if (owner != null) {
             rval.setOwner(owner.getId());
         }
         Date expTime = taskData.getExpirationTime();
         if (expTime != null) {
             GregorianCalendar cal = new GregorianCalendar();
             cal.setTime(expTime);
             DatatypeFactory dtFactory = DatatypeFactory.newInstance();
             rval.setDueDate(dtFactory.newXMLGregorianCalendar(cal));
         }
         rval.setStatus(StatusType.fromValue(taskData.getStatus().toString()));
     }

     long docId = taskService.getTaskById(taskId).getTaskData().getDocumentContentId();

     if (docId > 0) {
      //Set the input params
      Content content = taskService.getContentById(docId);
      @SuppressWarnings("unchecked")
Map<String,Object> inputParams = (Map<String, Object>) ContentMarshallerHelper.unmarshall(content.getContent(), null);

      if (inputParams!=null && inputParams.size() > 0) {
      	if (rval.getTaskData()==null) rval.setTaskData(new TaskDataType());
      	for ( String key : inputParams.keySet()) {
      		Entry entry = new Entry();
      		entry.setKey(key);
      		entry.setValue(String.valueOf(inputParams.get(key)));
		rval.getTaskData().getEntry().add(entry);
	}
      }
     }

     return rval;
 }
 
开发者ID:Governance,项目名称:dtgov,代码行数:66,代码来源:TaskApi.java


示例12: setTask

import org.kie.api.task.model.Task; //导入依赖的package包/类
public void setTask(Task task) {
    this.task = task;
}
 
开发者ID:jsvitak,项目名称:jbpm-6-examples,代码行数:4,代码来源:TaskBean.java



注:本文中的org.kie.api.task.model.Task类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HeadingSize类代码示例发布时间:2022-05-23
下一篇:
Java BuildArtifacts类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap