Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 27, 2015
2 parents 33a9ce4 + eb2aaad commit a27e274
Show file tree
Hide file tree
Showing 22 changed files with 607 additions and 663 deletions.
24 changes: 12 additions & 12 deletions config/sql/midpoint/3.1.1/postgresql/postgresql-3.1.1.sql
Expand Up @@ -6,7 +6,7 @@ CREATE TABLE m_abstract_role (
);

CREATE TABLE m_assignment (
id INT2 NOT NULL,
id INT4 NOT NULL,
owner_oid VARCHAR(36) NOT NULL,
administrativeStatus INT4,
archiveTimestamp TIMESTAMP,
Expand Down Expand Up @@ -36,14 +36,14 @@ CREATE TABLE m_assignment (
tenantRef_relation VARCHAR(157),
tenantRef_targetOid VARCHAR(36),
tenantRef_type INT4,
extId INT2,
extId INT4,
extOid VARCHAR(36),
PRIMARY KEY (id, owner_oid)
);

CREATE TABLE m_assignment_ext_date (
eName VARCHAR(157) NOT NULL,
anyContainer_owner_id INT2 NOT NULL,
anyContainer_owner_id INT4 NOT NULL,
anyContainer_owner_owner_oid VARCHAR(36) NOT NULL,
dateValue TIMESTAMP NOT NULL,
extensionType INT4,
Expand All @@ -55,7 +55,7 @@ CREATE TABLE m_assignment_ext_date (

CREATE TABLE m_assignment_ext_long (
eName VARCHAR(157) NOT NULL,
anyContainer_owner_id INT2 NOT NULL,
anyContainer_owner_id INT4 NOT NULL,
anyContainer_owner_owner_oid VARCHAR(36) NOT NULL,
longValue INT8 NOT NULL,
extensionType INT4,
Expand All @@ -67,7 +67,7 @@ CREATE TABLE m_assignment_ext_long (

CREATE TABLE m_assignment_ext_poly (
eName VARCHAR(157) NOT NULL,
anyContainer_owner_id INT2 NOT NULL,
anyContainer_owner_id INT4 NOT NULL,
anyContainer_owner_owner_oid VARCHAR(36) NOT NULL,
orig VARCHAR(255) NOT NULL,
extensionType INT4,
Expand All @@ -80,7 +80,7 @@ CREATE TABLE m_assignment_ext_poly (

CREATE TABLE m_assignment_ext_reference (
eName VARCHAR(157) NOT NULL,
anyContainer_owner_id INT2 NOT NULL,
anyContainer_owner_id INT4 NOT NULL,
anyContainer_owner_owner_oid VARCHAR(36) NOT NULL,
targetoid VARCHAR(36) NOT NULL,
extensionType INT4,
Expand All @@ -94,7 +94,7 @@ CREATE TABLE m_assignment_ext_reference (

CREATE TABLE m_assignment_ext_string (
eName VARCHAR(157) NOT NULL,
anyContainer_owner_id INT2 NOT NULL,
anyContainer_owner_id INT4 NOT NULL,
anyContainer_owner_owner_oid VARCHAR(36) NOT NULL,
stringValue VARCHAR(255) NOT NULL,
extensionType INT4,
Expand All @@ -105,7 +105,7 @@ CREATE TABLE m_assignment_ext_string (
);

CREATE TABLE m_assignment_extension (
owner_id INT2 NOT NULL,
owner_id INT4 NOT NULL,
owner_owner_oid VARCHAR(36) NOT NULL,
datesCount INT2,
longsCount INT2,
Expand All @@ -116,7 +116,7 @@ CREATE TABLE m_assignment_extension (
);

CREATE TABLE m_assignment_reference (
owner_id INT2 NOT NULL,
owner_id INT4 NOT NULL,
owner_owner_oid VARCHAR(36) NOT NULL,
reference_type INT4 NOT NULL,
relation VARCHAR(157) NOT NULL,
Expand Down Expand Up @@ -190,7 +190,7 @@ CREATE TABLE m_connector_target_system (
);

CREATE TABLE m_exclusion (
id INT2 NOT NULL,
id INT4 NOT NULL,
owner_oid VARCHAR(36) NOT NULL,
policy INT4,
targetRef_relation VARCHAR(157),
Expand Down Expand Up @@ -230,7 +230,7 @@ CREATE TABLE m_lookup_table (
);

CREATE TABLE m_lookup_table_row (
id INT2 NOT NULL,
id INT4 NOT NULL,
owner_oid VARCHAR(36) NOT NULL,
row_key VARCHAR(255),
label_norm VARCHAR(255),
Expand Down Expand Up @@ -488,7 +488,7 @@ CREATE TABLE m_task_dependent (
);

CREATE TABLE m_trigger (
id INT2 NOT NULL,
id INT4 NOT NULL,
owner_oid VARCHAR(36) NOT NULL,
handlerUri VARCHAR(255),
timestampValue TIMESTAMP,
Expand Down
Expand Up @@ -36,3 +36,16 @@ ADD CONSTRAINT m_assignment_reference_pkey PRIMARY KEY (owner_id, owner_owner_oi
ALTER TABLE m_reference
DROP CONSTRAINT m_reference_pkey,
ADD CONSTRAINT m_reference_pkey PRIMARY KEY (owner_oid, reference_type, relation, targetOid);

ALTER TABLE m_assignment ALTER COLUMN id TYPE INT4;
ALTER TABLE m_assignment ALTER COLUMN extId TYPE INT4;
ALTER TABLE m_assignment_ext_date ALTER COLUMN anyContainer_owner_id TYPE INT4;
ALTER TABLE m_assignment_ext_long ALTER COLUMN anyContainer_owner_id TYPE INT4;
ALTER TABLE m_assignment_ext_poly ALTER COLUMN anyContainer_owner_id TYPE INT4;
ALTER TABLE m_assignment_ext_reference ALTER COLUMN anyContainer_owner_id TYPE INT4;
ALTER TABLE m_assignment_ext_string ALTER COLUMN anyContainer_owner_id TYPE INT4;
ALTER TABLE m_assignment_extension ALTER COLUMN owner_id TYPE INT4;
ALTER TABLE m_assignment_reference ALTER COLUMN owner_id TYPE INT4;
ALTER TABLE m_exclusion ALTER COLUMN id TYPE INT4;
ALTER TABLE m_lookup_table_row ALTER COLUMN id TYPE INT4;
ALTER TABLE m_trigger ALTER COLUMN id TYPE INT4;
Expand Up @@ -103,12 +103,14 @@ private ProcessInstanceDto loadProcessInstance() {
}
}
ProcessInstanceState processInstanceState = (ProcessInstanceState) processInstance.getState();
String shadowTaskOid = processInstanceState.getShadowTaskOid();
Task shadowTask = null;
try {
shadowTask = getTaskManager().getTask(shadowTaskOid, result);
} catch (ObjectNotFoundException e) {
// task is already deleted, no problem here
if (processInstanceState != null) {
String shadowTaskOid = processInstanceState.getShadowTaskOid();
try {
shadowTask = getTaskManager().getTask(shadowTaskOid, result);
} catch (ObjectNotFoundException e) {
// task is already deleted, no problem here
}
}
return new ProcessInstanceDto(processInstance, shadowTask);
} catch (Exception ex) {
Expand Down
Expand Up @@ -40,6 +40,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.WorkItemType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.List;
Expand All @@ -56,6 +57,7 @@ public class WorkflowManagerImpl implements WorkflowManager {
private PrismContext prismContext;

@Autowired
@Qualifier("cacheRepositoryService")
private com.evolveum.midpoint.repo.api.RepositoryService repositoryService;

@Autowired
Expand Down
Expand Up @@ -56,6 +56,7 @@
import org.activiti.engine.task.Task;
import org.activiti.engine.task.TaskQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.xml.bind.JAXBException;
Expand Down Expand Up @@ -93,6 +94,7 @@ public class WorkItemProvider {
private PrismContext prismContext;

@Autowired
@Qualifier("cacheRepositoryService")
private RepositoryService repositoryService;

private static final String DOT_CLASS = WorkflowManagerImpl.class.getName() + ".";
Expand Down
Expand Up @@ -56,6 +56,7 @@
import com.evolveum.midpoint.xml.ns.model.workflow.process_instance_state_3.ProcessInstanceState;
import org.apache.commons.lang.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.xml.bind.JAXBException;
Expand Down Expand Up @@ -98,6 +99,7 @@ public class JobController {
private ActivitiInterface activitiInterface;

@Autowired
@Qualifier("cacheRepositoryService")
private RepositoryService repositoryService;

@Autowired
Expand Down
Expand Up @@ -64,6 +64,7 @@

import org.apache.commons.lang.Validate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -93,6 +94,7 @@ public class WfTaskUtil {
private WfConfiguration wfConfiguration;

@Autowired
@Qualifier("cacheRepositoryService")
private RepositoryService repositoryService;

@Autowired
Expand Down
Expand Up @@ -68,8 +68,8 @@ public static MiscDataUtil getMiscDataUtil() {
return getBean(MiscDataUtil.class);
}

public static RepositoryService getRepositoryService() {
return getBean(RepositoryService.class);
public static RepositoryService getCacheRepositoryService() {
return getBean("cacheRepositoryService", RepositoryService.class);
}

public static PrismContext getPrismContext() {
Expand Down
Expand Up @@ -38,15 +38,13 @@
import com.evolveum.midpoint.wf.impl.processes.common.LightweightObjectRefImpl;
import com.evolveum.midpoint.wf.impl.processes.common.SpringApplicationContextHolder;
import com.evolveum.midpoint.wf.impl.processors.primary.PcpProcessVariableNames;
import com.evolveum.midpoint.wf.impl.processors.primary.PcpRepoAccessHelper;
import com.evolveum.midpoint.wf.impl.util.MiscDataUtil;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.apache.commons.lang.Validate;

import javax.xml.bind.JAXBException;
import javax.xml.namespace.QName;

import java.util.*;
Expand Down Expand Up @@ -201,7 +199,7 @@ private ExpressionVariables getDefaultVariablesIfNeeded(ExpressionVariables vari

private ExpressionVariables getDefaultVariables(DelegateExecution execution, OperationResult result) throws SchemaException, ObjectNotFoundException {

RepositoryService repositoryService = SpringApplicationContextHolder.getRepositoryService();
RepositoryService repositoryService = SpringApplicationContextHolder.getCacheRepositoryService();
MiscDataUtil miscDataUtil = SpringApplicationContextHolder.getMiscDataUtil();

ExpressionVariables variables = new ExpressionVariables();
Expand Down
Expand Up @@ -47,6 +47,7 @@
import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.xml.bind.JAXBException;
Expand All @@ -72,6 +73,7 @@ public class BaseAuditHelper {
private SecurityEnforcer securityEnforcer;

@Autowired
@Qualifier("cacheRepositoryService")
private RepositoryService repositoryService;

public AuditEventRecord prepareProcessInstanceAuditRecord(Map<String, Object> variables, Job job, AuditEventStage stage, OperationResult result) {
Expand Down
Expand Up @@ -36,6 +36,7 @@
import com.evolveum.prism.xml.ns._public.types_3.ObjectDeltaType;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import javax.xml.bind.JAXBException;
Expand All @@ -52,6 +53,7 @@ public class PcpRepoAccessHelper {
private static final transient Trace LOGGER = TraceManager.getTrace(PcpRepoAccessHelper.class);

@Autowired
@Qualifier("cacheRepositoryService")
private RepositoryService repositoryService;

@Autowired
Expand Down
Expand Up @@ -37,6 +37,7 @@

import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import javax.annotation.PostConstruct;
import java.util.List;
Expand All @@ -52,6 +53,7 @@ public abstract class BasePrimaryChangeAspect implements PrimaryChangeAspect, Be
private String beanName;

@Autowired
@Qualifier("cacheRepositoryService")
protected RepositoryService repositoryService;

@Autowired
Expand Down

0 comments on commit a27e274

Please sign in to comment.