JbpmContext学习

java 代码
  1. JbpmContext   
  2. is used to surround persistent operations to processes.   
  3.   
  4. Obtain JbpmContext's via {@link org.jbpm.JbpmConfiguration#createJbpmContext()}   
  5. and put it in a try-finally block like this:   
  6. JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();   
  7.  * try {   
  8.  *   TaskInstance taskInstance = ...   
  9.  *      
  10.  *   ...do your process operations...   
  11.  *      
  12.  *   // in case you update a process object that was not fetched   
  13.  *   // with a ...ForUpdate method, you have to save it.   
  14.  *   jbpmContext.save(processInstance);   
  15.  * finally {   
  16.  *   jbpmContext.close();   
  17.  * }   
  18.   
  19.  A JbpmContext separates jBPM from a sprecific environment.   
  20.  For each service that jBPM uses, there is an interface specified in the jBPM codebase.   
  21.  jBPM also includes implementations that implement these services by using services in a   
  22.  specific environment.  e.g. a hibernate session, a JMS asynchronous messaging system, ...   
  23.   
  24. A JbpmContext can demarcate a transaction.  When a PersistenceService is fetched from    
  25. the JbpmContext, the default implementation for the persistence service will create    
  26. a hibernate session and start a transaction.  So that transactions can be configured   
  27. in the hibernate configuration.     
  28.   
  29. A JbpmContext allows the user to overwrite (or make complete) the configuration    
  30. by injecting objects programmatically.  like e.g. a hibernate session factory or    
  31. a hibernate session or any other resource that can be fetched or created from the    
  32. configuration.    
  33.   
  34. Last but not least, JbpmContext provides convenient access to the most common    
  35. operations such as {@link #getTaskList(String)}, {@link #newProcessInstance(String)}   
  36. {@link #loadTaskInstanceForUpdate(long)} and {@link #save(ProcessInstance)}   
  37.   
  38. All the ...ForUpdate(...) methods will automatically save the loaded    
  39. objects at jbpmContext.close();   
  40.   
  41. main method:   
  42. =======>getTaskList()   
  43. =======>getCurrentJbpmContext()   
  44. =======>getTaskList(String actorId)   
  45. =======>getGroupTaskList(List actorIds)   
  46. =======>getTaskInstance(long taskInstanceId)    
  47. =======>getToken(long tokenId)   
  48. =======>getProcessInstance(long processInstanceId)   
  49. =======>newProcessInstance(String processDefinitionName)   
  50. =======> save(ProcessInstance processInstance)   
  51. =======>save(Token token)    
  52. =======>save(TaskInstance taskInstance)   
  53. =======>getTaskMgmtSession()   
  54. =======>getActorId()    
  55. =======>getContextSession()   
  56. =======>getLoggingSession()   
  57. =======>getJobSession()   
  58. =======>getGraphSession()   
  59. =======>getTaskMgmtSession()  
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值