<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence version="1.0"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/persistence">
<persistence-unit name="org.drools.persistence.jpa" transaction-type="JTA">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:comp/env/jdbc/testDS1</jta-data-source>
<mapping-file>persistenceorm.xml</mapping-file>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.BTMTransactionManagerLookup" />
</properties>
</persistence-unit>
<persistence-unit name="org.sintec.task">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>orm.xml</mapping-file>
<class>org.jbpm.task.Attachment</class>
<class>org.jbpm.task.Content</class>
<class>org.jbpm.task.BooleanExpression</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Comment</class>
<class>org.jbpm.task.Deadline</class>
<class>org.jbpm.task.Delegation</class>
<class>org.jbpm.task.Escalation</class>
<class>org.jbpm.task.Group</class>
<class>org.jbpm.task.I18NText</class>
<class>org.jbpm.task.Notification</class>
<class>org.jbpm.task.EmailNotification</class>
<class>org.jbpm.task.EmailNotificationHeader</class>
<class>org.jbpm.task.PeopleAssignments</class>
<class>org.jbpm.task.Reassignment</class>
<class>org.jbpm.task.Status</class>
<class>org.jbpm.task.Task</class>
<class>org.jbpm.task.TaskData</class>
<class>org.jbpm.task.SubTasksStrategy</class>
<class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>
<class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>
<class>org.jbpm.task.User</class>
<class>org.drools.persistence.info.SessionInfo</class>
<class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.info.WorkItemInfo</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" />
<property name="hibernate.connection.driver_class" value="oracle.jdbc.driver.OracleDriver" />
<property name="hibernate.connection.url" value="jdbc:oracle:thin:@myserver:1523:mydb" />
<property name="hibernate.connection.username" value="workflow_cust" />
<property name="hibernate.connection.password" value="workflow_cust" />
<property name="hibernate.connection.autocommit" value="false" />
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0">
<named-query name="ProcessInstancesWaitingForEvent">
<query>
select
processInstanceInfo.processInstanceId
from
ProcessInstanceInfo processInstanceInfo
where
:type in elements(processInstanceInfo.eventTypes)
</query>
</named-query>
<named-query name="TasksAssignedAsBusinessAdministrator">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity businessAdministrator
where
businessAdministrator.id = :userId and
businessAdministrator in elements ( t.peopleAssignments.businessAdministrators ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsExcludedOwner">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity excludedOwners
where
excludedOwners.id = :userId and
excludedOwners in elements ( t.peopleAssignments.excludedOwners ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsPotentialOwner">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subject.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t
left join t.taskData.createdBy
left join t.taskData.actualOwner
left join t.subjects as subject,
I18NText names,
I18NText descriptions,
OrganizationalEntity potentialOwners
where
potentialOwners.id = :userId and
potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and
names.language = :language and
names in elements( t.names) and
(
subject.language = :language
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsPotentialOwnerWithGroups">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy left join t.taskData.actualOwner,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity potentialOwners
where
( potentialOwners.id = :userId or potentialOwners.id in (:groupIds) ) and
potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsPotentialOwnerByGroup">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy left join t.taskData.actualOwner,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity potentialOwners
where
potentialOwners.id = :groupId and
potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="SubTasksAssignedAsPotentialOwner">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy left join t.taskData.actualOwner,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity potentialOwners
where
t.taskData.parentId = :parentId and
potentialOwners.id = :userId and
potentialOwners in elements ( t.peopleAssignments.potentialOwners ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="GetSubTasksByParentTaskId">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t,
I18NText names,
I18NText subjects,
I18NText descriptions
where
t.taskData.parentId = :parentId and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.status in ('Created', 'Ready', 'Reserved', 'InProgress', 'Suspended') and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsRecipient">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity recipients
where
recipients.id = :userId and
recipients in elements ( t.peopleAssignments.recipients ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsTaskInitiator">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity taskInitiator
where
taskInitiator.id = :userId and
taskInitiator = t.peopleAssignments.taskInitiator and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksAssignedAsTaskStakeholder">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions,
OrganizationalEntity taskStakeholder
where
taskStakeholder.id = :userId and
taskStakeholder in elements ( t.peopleAssignments.taskStakeholders ) and
names.language = :language and
names in elements( t.names) and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TasksOwned">
<query>
select
new org.jbpm.task.query.TaskSummary(
t.id,
t.taskData.processInstanceId,
names.text,
subjects.text,
descriptions.text,
t.taskData.status,
t.priority,
t.taskData.skipable,
t.taskData.actualOwner,
t.taskData.createdBy,
t.taskData.createdOn,
t.taskData.activationTime,
t.taskData.expirationTime)
from
Task t left join t.taskData.createdBy,
I18NText names,
I18NText subjects,
I18NText descriptions
where
t.taskData.actualOwner.id = :userId and
names in elements( t.names) and
names.language = :language and
(
subjects.language = :language and
subjects in elements( t.subjects)
or t.subjects.size = 0
) and
(
descriptions.language = :language and
descriptions in elements( t.descriptions)
or t.descriptions.size = 0
) and
t.taskData.expirationTime is null
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="UnescalatedDeadlines">
<query>
select
new org.jbpm.task.query.DeadlineSummary(
t.id,
d.id,
d.date)
from
Task t,
Deadline d
where
(d in elements( t.deadlines.startDeadlines ) or d in elements( t.deadlines.endDeadlines ) ) and
d.escalated = false
order by
d.date
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
<named-query name="TaskByWorkItemId">
<query>
select
t
from
Task t
where
t.taskData.workItemId = :workItemId
</query>
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-query>
</entity-mappings>