<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<typedef class="org.jbpm.db.hibernate.StringMax" name="string_max" />
<!-- related to ProcessDefintion -->
<!-- ########################### -->
<query name="GraphSession.findLatestProcessDefinitionQuery">
<![CDATA[
select pd
from org.jbpm.graph.def.ProcessDefinition as pd
where pd.name = :name
order by pd.version desc
]]>
</query>
<query name="GraphSession.findProcessDefinitionByNameAndVersion">
<![CDATA[
select pd
from org.jbpm.graph.def.ProcessDefinition as pd
where pd.name = :name
and pd.version = :version
]]>
</query>
<query name="GraphSession.findAllProcessDefinitions">
<![CDATA[
select pd
from org.jbpm.graph.def.ProcessDefinition as pd
order by pd.name, pd.version desc
]]>
</query>
<query name="GraphSession.findAllProcessDefinitionVersions">
<![CDATA[
select pd
from org.jbpm.graph.def.ProcessDefinition as pd
where pd.name = :name
order by pd.version desC
]]>
</query>
<query name="GraphSession.findAllProcessInstancesForADefinition">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
where pi.processDefinition.id = :processDefinitionId
order by pi.start desc
]]>
</query>
<!-- related to ProcessInstance -->
<!-- ########################## -->
<query name="GraphSession.findAllRunningProcessInstancesWithProcessName">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
where pi.processDefinition.name = :processDefinitionName
and pi.end = null
order by pi.start desc
]]>
</query>
<query name="GraphSession.findAllProcessInstancesWithProcessName">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
where pi.processDefinition.name = :processDefinitionName
order by pi.start desc
]]>
</query>
<query name="GraphSession.findAllRunningProcessInstances">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
where pi.end = null
order by pi.start desc
]]>
</query>
<query name="GraphSession.findAllProcessInstances">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
order by pi.start desc
]]>
</query>
<query name="GraphSession.findSubProcessInstances">
<![CDATA[
select pi
from org.jbpm.graph.exe.ProcessInstance as pi
where pi.superProcessToken!=null
and pi.superProcessToken.processInstance = :processInstance
order by pi.start desc
]]>
</query>
<query name="GraphSession.findTokensForProcessInstance">
<![CDATA[
select token
from org.jbpm.graph.exe.Token token
where token.processInstance = :processInstance
]]>
</query>
<query name="GraphSession.findTokensForProcessInNode">
<![CDATA[
select token
from org.jbpm.graph.exe.Token token
where token.processInstance.processDefinition.name = :processDefinitionName
and node.name = :nodeName
]]>
</query>
<query name="GraphSession.findProcessInstanceByKey">
<![CDATA[
select processInstance
from org.jbpm.graph.exe.ProcessInstance processInstance
where processInstance.processDefinition = :processDefinition
and processInstance.key = :key
]]>
</query>
<query name="GraphSession.selectLogsForTokens">
<![CDATA[
select pl
from org.jbpm.logging.log.ProcessLog as pl
where pl.token in (:tokens)
]]>
</query>
<query name="GraphSession.findTaskInstanceIdsForProcessInstance">
<![CDATA[
select t
from org.jbpm.taskmgmt.exe.TaskInstance t
where t.taskMgmtInstance.processInstance = :processInstance
]]>
</query>
<query name="GraphSession.deleteTaskInstancesById">
<![CDATA[
delete
from org.jbpm.taskmgmt.exe.TaskInstance t
where t.id in (:taskInstanceIds)
]]>
</query>
<query name="GraphSession.deleteJobsForProcessInstance">
<![CDATA[
delete from org.jbpm.job.Job job
where job.processInstance = :processInstance
]]>
</query>
<query name="GraphSession.calculateAverageTimeByNode">
<![CDATA[
select
nl.node.id,
nl.node.name,
count(nl.leave),
avg(nl.duration),
min(nl.duration),
max(nl.duration)
from org.jbpm.graph.log.NodeLog nl
where nl.node.processDefinition.id = :processDefinitionId
and nl.duration > :minimumDuration
group by nl.node.id, nl.node.name
order by avg(nl.duration) desc
]]>
</query>
<query name="GraphSession.findActiveNodesByProcessInstance">
<![CDATA[
select node
from org.jbpm.graph.def.Node node,
org.jbpm.graph.exe.Token token,
org.jbpm.graph.exe.ProcessInstance processInstance
where token.processInstance = :processInstance
and token.node = node
and token.isSuspended != true
and token.parent is not null
and token.end is null
]]>
</query>
<query name="GraphSession.findAllSwimlaneNames">
<![CDATA[
select distinct swimlane.name
from org.jbpm.taskmgmt.def.Swimlane as swimlane
]]>
</query>
<!-- Logging -->
<!-- ########################### -->
<query name="LoggingSession.findLogsByToken">
<![CDATA[
select pl
from org.jbpm.logging.log.ProcessLog as pl
where pl.token = :token
order by pl.index
]]>
</query>
<!-- JobSession -->
<!-- ########################### -->
<query name="JobSession.getFirstAcquirableJob">
<![CDATA[
select job
from org.jbpm.job.Job as job
where ( (job.lockOwner is null) or (job.lockOwner = :lockOwner) )
and job.retries > 0
and job.dueDate <= :now
and job.isSuspended != true
order by job.dueDate asc
]]>
</query>
<query name="JobSession.findExclusiveJobs">
<![CDATA[
select job
from org.jbpm.job.Job as job
where ( (job.lockOwner is null) or (job.lockOwner = :lockOwner) )
and job.retries > 0
and job.dueDate <= :now
and job.processInstance = :processInstance
and job.isExclusive = true
and job.isSuspended != true
order by job.dueDate asc
]]>
</query>
<query name="JobSession.getFirstDueJob">
<![CDATA[
select job
from org.jbpm.job.Job as job
where ( (job.lockOwner is null) or (job.lockOwner = :lockOwner) )
and job.retries > 0
and job.isSuspended != true
order by job.dueDate asc
]]>
</query>
<query name="JobSession.getFirstDueJobExlcMonitoredJobs">
<![CDATA[
select job
from org.jbpm.job.Job as job
where ( (job.lockOwner is null) or (job.lockOwner = :lockOwner) )
and job.id not in ( :jobIdsToIgnore )
and job.retries > 0
and job.isSuspended != true
order by job.dueDate asc
]]>
</query>
<query name="JobSession.suspendJobs">
<![CDATA[
update org.jbpm.job.Job job
set job.isSuspended = true
where job.token = :token
]]>
</query>
<query name="JobSession.resumeJobs">
<![CDATA[
update org.jbpm.job.Job job
set job.isSuspended = false
where job.token = :token
]]>
</query>
<query name="JobSession.getTimersByName">
<![CDATA[
select timer
from org.jbpm.job.Timer timer
where timer.token = :token
and timer.name = :name
]]>
</query>
<query name="JobSession.deleteTimersForProcessInstance">
<![CDATA[
delete from org.jbpm.job.Timer timer
where timer.processInstance = :processInstance
]]>
</query>
<query name="JobSession.deleteExecuteNodeJobsForProcessInstance">
<![CDATA[
delete from org.jbpm.job.ExecuteNodeJob executeNodeJob
where executeNodeJob.processInstance = :processInstance
]]>
</query>
<!-- related to Tasks -->
<!-- ########################### -->
<query name="TaskMgmtSession.findTaskInstancesByActorId">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance as ti
where ti.actorId = :actorId
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<query name="TaskMgmtSession.findTaskInstancesByActorIds">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance as ti
where ti.actorId in ( :actorIds )
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<query name="TaskMgmtSession.findPooledTaskInstancesByActorId">
<![CDATA[
select distinct ti
from org.jbpm.taskmgmt.exe.PooledActor pooledActor
join pooledActor.taskInstances ti
where pooledActor.actorId = :swimlaneActorId
and ti.actorId is null
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<query name="TaskMgmtSession.findPooledTaskInstancesByActorIds">
<![CDATA[
select distinct ti
from org.jbpm.taskmgmt.exe.PooledActotir pooledActor
join pooledActor.taskInstances
where pooledActor.actorId in ( :actorIds )
and ti.actorId is null
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<!-- old one from camunda, I think we can sjip that, but not sure yet
<query name="TaskMgmtSession.findPooledTaskInstancesByActorId">
<![CDATA[
select distinct ti
from org.jbpm.taskmgmt.exe.PooledActor pooledActor
join pooledActor.taskInstances ti
where pooledActor.actorId = :swimlaneActorId
and ti.actorId != null
and ti.end = null
and ti.isCancelled = false
]]>
</query>
-->
<query name="TaskMgmtSession.findTaskInstancesByTokenId">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance ti
where ti.token.id = :tokenId
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<query name="TaskMgmtSession.findTaskInstancesByProcessInstance">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance ti
where ti.token.processInstance = :processInstance
and ti.isSuspended != true
and ti.isOpen = true
]]>
</query>
<query name="TaskMgmtSession.findTaskInstancesByIds">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance ti
where ti.id in ( :taskInstanceIds )
]]>
</query>
<query name="TaskMgmtSession.findOpenTasksOfProcessInstance">
<![CDATA[
select ti
from org.jbpm.taskmgmt.exe.TaskInstance ti
where ti.token.processInstance = :instance
and ti.end IS NULL
]]>
</query>
<query name="GraphSession.findAllTokensOfProcessInstance">
<![CDATA[
select token
from org.jbpm.graph.exe.Token token
where token.processInstance = :instance
]]>
</query>
<query name="TaskMgmtSession.findTaskForNode">
<![CDATA[
select distinct task
from org.jbpm.taskmgmt.def.Task task
where task.name = :taskName
and task.taskNode.id = :taskNodeId
]]>
</query>
</hibernate-mapping>
分享到:
相关推荐
在使用JBPM时,为了存储流程定义和执行过程中的数据,需要在数据库中创建一系列表。本文将详细介绍JBPM中涉及到的关键表结构及其相关约束。 #### 二、JBPM4_DEPLOYMENT 表解析 - **表结构定义:** ```sql ...
工作流jbpm4.4,建表语句,已修正错误,希望后来人能够节约时间。
在实践中,开发者需要将这些SQL语句执行到目标数据库中,以便jBPM能够正常工作。同时,还需要配置jBPM连接到这个数据库,这通常在jBPM的配置文件中完成。 **jbpm_5_leave_web** "jbpm_5_leave_web"可能是该项目的...
JBPM 4 mysql 建表 sql ,希望对某些人有用处
在SSH框架中,JBPM的API会被集成到业务服务中,用于启动流程实例、完成任务、查询流程状态等。 5. **整合过程**:SSH与JBPM的整合涉及多个步骤,包括:配置SSH框架以引入JBPM的相关库;在Spring配置文件中声明和...
jbpm.mysql.create.sql jbpm mysql建表语句
这些SQL脚本的目的是确保jbpm在多种常见的关系型数据库(MySQL、Microsoft SQL Server、Sybase、Oracle和IBM DB2)中能够正确地安装和运行。 1. **jbpm.jpdl.mysql.sql**:这是针对MySQL数据库的脚本,包含了创建...
jbpm3.2 mysql修改可用建表语句 在mysql命令行下使用:source D:1.sql
`ss.sql`文件很可能是包含了一系列CREATE TABLE语句的SQL脚本,用于在MySQL数据库中创建jbpm的支撑表。这些脚本通常会定义表的结构,包括字段名、数据类型、键约束等,以满足jbpm系统的存储需求。在实际操作中,用户...
文档"jbpm表结构说明.doc"提供了jbpm4版本中17个主要数据库表的创建语句,下面将对这些表及其作用进行详细介绍。 1. **JBPM4_DEPLOYMENT**: 这个表用于存储部署信息。每个部署对应一个流程定义或工作流应用。DBID...
从给定的文件标题“jbpm4.4中文手册”及其描述、标签和部分内容中,我们可以提炼出关于jBPM4.4的关键知识点。jBPM(Java Business Process Management)是一个开源的工作流引擎,用于执行业务流程管理。下面将详细...
以上SQL语句主要是针对JBPM在MySQL中创建表时出现的问题进行了修复。通过对这些表中的字段进行类型转换,可以解决由于字段类型不匹配导致的问题。需要注意的是,这些修改是在假设字段类型错误的情况下进行的,如果...
所有关于员工信息、请假记录、审批状态等数据都会被存储在MySQL的各个表中,通过SQL语句进行读写操作。合理的设计数据库结构和索引,可以保证系统的高效运行和数据的安全性。 在本系统中,用户可以通过Web界面提交...
开发者可以通过Hibernate的API进行数据查询和更新,而无需编写SQL语句。 在jbpm-demo的源码中,你可能会找到以下关键组件: 1. 流程定义文件(.bpmn或.xml):这些文件定义了业务流程的结构,包括活动、任务、决策...
5. **业务逻辑封装**: 在SSH中封装jbpm的API,以便在业务层调用,如创建流程实例、查询任务等。 6. **视图展示**: 设计用户界面,展示流程状态、任务列表等,用户可以通过界面完成任务操作。 **总结** jbpm4.4与...
在本项目中,JBPM与SSH的整合意味着可以在SSH驱动的业务逻辑中无缝地嵌入工作流程,实现流程自动化。 jbpm5.sql文件是JBPM5.4所需的数据库脚本,包含了初始化数据库表结构和数据。这一步骤至关重要,因为JBPM的工作...
jbpm和Hibernate是两个在Java开发中非常重要的框架,它们分别专注于业务流程管理和持久化层。jbPM(Business Process Management)是一个开源的工作流管理系统,它允许开发者设计、执行和管理业务流程,而Hibernate...
这些脚本通常包含了创建表、视图、存储过程、触发器等数据库对象的语句,以支持jbpm系统运行所需的业务逻辑和数据存储。SSH(Spring、Struts、Hibernate)是一个常见的Java企业级应用开发框架,而ExtJS则是一个用于...
在深入探讨如何使用JBPM创建数据库的过程中,我们首先需要了解JBPM是什么以及它与数据库创建之间的联系。JBPM是JBoss流程管理器(JBoss Business Process Management)的简称,这是一个开源的工作流引擎,用于自动化...
下面我们将深入探讨jbpm4.4和SSH2的集成以及项目中的关键知识点。 1. **jbpm4.4**: - jbpm4.4是jbpm的第4代版本,提供了一套完整的流程管理解决方案,包括流程设计、执行、监控和优化。 - 它支持BPMN2.0标准,...