{"action":"created","issue":{"url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/2","repository_url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io","labels_url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/2/comments","events_url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/2/events","html_url":"https://github.com/BlowWaterWind/blowwaterwind.github.io/issues/2","id":309990867,"number":2,"title":"Activiti-1","user":{"login":"BlowWaterWind","id":37650269,"avatar_url":"https://avatars2.githubusercontent.com/u/37650269?v=4","gravatar_id":"","url":"https://api.github.com/users/BlowWaterWind","html_url":"https://github.com/BlowWaterWind","followers_url":"https://api.github.com/users/BlowWaterWind/followers","following_url":"https://api.github.com/users/BlowWaterWind/following{/other_user}","gists_url":"https://api.github.com/users/BlowWaterWind/gists{/gist_id}","starred_url":"https://api.github.com/users/BlowWaterWind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlowWaterWind/subscriptions","organizations_url":"https://api.github.com/users/BlowWaterWind/orgs","repos_url":"https://api.github.com/users/BlowWaterWind/repos","events_url":"https://api.github.com/users/BlowWaterWind/events{/privacy}","received_events_url":"https://api.github.com/users/BlowWaterWind/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-30T06:53:10Z","updated_at":"2018-04-02T09:07:34Z","closed_at":null,"author_association":"OWNER","body":"```\r\nTaskAction.java\r\n    /**\r\n     * 动作ID\r\n     */\r\n    private String id;\r\n\r\n    /**\r\n     * 动作名称\r\n     */\r\n    private String name;\r\n\r\n    /**\r\n     * 动作值：0为取消，1为完成当前动作\r\n     */\r\n    private Integer act;\r\n    \r\n    /**\r\n     * 流程的申明ID\r\n     */\r\n    private String definitionId;\r\n    /**\r\n     * 流程的执行ID\r\n     */\r\n    private String executionId;\r\n```\r\n\r\n用单元测试查看流程:\r\n ```sql\r\nSELECT * FROM ACT_HI_PROCINST --流程实例历史表\r\nSELECT * FROM ACT_HI_PROCINST WHERE BUSINESS_KEY_ = '2018040214191562073406' --PROC_INST_ID_ = 5532501 --找到PROC_INST_ID\r\nSELECT * FROM ACT_RU_EXECUTION --正在执行的执行对象表\r\n\r\n---------\r\nSELECT * FROM ACT_RU_TASK --正在执行的任务信息\r\nSELECT * FROM ACT_HI_TASKINST --已经执行完的历史任务信息\r\nSELECT * FROM ACT_HI_ACTINST --所有活动节点的历史表\r\n\r\n--------\r\nSELECT * FROM ACT_RU_VARIABLE\r\nSELECT * FROM ACT_HI_VARINST\r\n```\r\nsetVariable和setVariableLocal的区别:\r\n前者:设置流程变量名称的时候，后一次的值替换前一次的值，ACT_RU_VARIABLE的TASK_ID_字段不会存放任务ID的值\r\n后者:\r\n1. 后一个版本的同名变量不会替换前者的。TASK_ID_会放值。\r\n这个流程变量绑定了当前的任务，当流程继续执行时，下个任务获取不到这个流程变量。\r\n这个时候执行查询历史的流程变量表。\r\n\r\n **流程变量**\r\n1. RuntimeService对象可以设置流程变量和获取流程变量\r\n2. TaskService对象可以设置和获取流程变量\r\n3. 流程实例PROC_INST_ID_ 启动设置流程变量\r\n4. 任务完成的时候可以设置流程变量\r\n5. 流程变量可以以key value的方式，也可以以Map集合的方式。\r\n\r\n```java\r\n//任务完成时:\r\n Task task = activitiUtil.getCurrentTask(processDefKey, processParam.getBusinessId()); // 获取当前任务\r\n\r\n activitiUtil.completeTask(task, variables, false);\r\n// 通过taskService设置流程变量\r\npublic void completeTask(Task task, Map<String, Object> variables, boolean localScope) {     taskService.complete(task.getId(), variables, localScope); }\r\n\r\n//任务开启时设置流程变量\r\n orderActivitiHelper.startWorkflow(processParam);\r\n// 通过runtimeService设置流程变量\r\npublic ProcessInstance startWorkflow(String processDefKey, String businessKey, Map<String, Object> variables) {     return runtimeService.startProcessInstanceByKey(processDefKey, businessKey, variables); }\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/comments/377890346","html_url":"https://github.com/BlowWaterWind/blowwaterwind.github.io/issues/2#issuecomment-377890346","issue_url":"https://api.github.com/repos/BlowWaterWind/blowwaterwind.github.io/issues/2","id":377890346,"user":{"login":"BlowWaterWind","id":37650269,"avatar_url":"https://avatars2.githubusercontent.com/u/37650269?v=4","gravatar_id":"","url":"https://api.github.com/users/BlowWaterWind","html_url":"https://github.com/BlowWaterWind","followers_url":"https://api.github.com/users/BlowWaterWind/followers","following_url":"https://api.github.com/users/BlowWaterWind/following{/other_user}","gists_url":"https://api.github.com/users/BlowWaterWind/gists{/gist_id}","starred_url":"https://api.github.com/users/BlowWaterWind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BlowWaterWind/subscriptions","organizations_url":"https://api.github.com/users/BlowWaterWind/orgs","repos_url":"https://api.github.com/users/BlowWaterWind/repos","events_url":"https://api.github.com/users/BlowWaterWind/events{/privacy}","received_events_url":"https://api.github.com/users/BlowWaterWind/received_events","type":"User","site_admin":false},"created_at":"2018-04-02T09:07:34Z","updated_at":"2018-04-02T09:07:34Z","author_association":"OWNER","body":"以为定时任务等五分钟就可以看到任务超时的日志\r\n```xml\r\n<!--activiti.cfg.xml 要将任务的执行打开-->\r\n<property name=\"jobExecutorActivate\" value=\"true\"/>\r\n```"}}
{"actor":{"display_login":"BlowWaterWind"}}