Skip to content

Commit

Permalink
[DROOLS-1353] define ExecutableRunner interface (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariofusco committed Dec 6, 2016
1 parent 6a3a265 commit ca8ee66
Show file tree
Hide file tree
Showing 210 changed files with 1,093 additions and 1,132 deletions.
Expand Up @@ -21,7 +21,7 @@
import org.jbpm.process.audit.JPAAuditLogService;
import org.jbpm.process.audit.strategy.PersistenceStrategyType;
import org.kie.api.runtime.KieSession;
import org.kie.internal.command.Context;
import org.kie.api.runtime.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
Expand Down
Expand Up @@ -15,16 +15,15 @@

package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.Context;
import org.kie.api.runtime.manager.audit.NodeInstanceLog;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.manager.audit.NodeInstanceLog;
import org.kie.internal.command.Context;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
Expand Down
Expand Up @@ -15,17 +15,15 @@

package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.Context;
import org.kie.api.runtime.manager.audit.ProcessInstanceLog;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.manager.audit.ProcessInstanceLog;
import org.kie.internal.command.Context;
import org.kie.internal.query.data.QueryData;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
Expand Down
Expand Up @@ -15,16 +15,15 @@

package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.Context;
import org.kie.api.runtime.manager.audit.VariableInstanceLog;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.manager.audit.VariableInstanceLog;
import org.kie.internal.command.Context;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
Expand Down
Expand Up @@ -15,13 +15,13 @@
*/
package org.jbpm.process.audit.command;

import org.jbpm.process.audit.AuditLogService;
import org.kie.api.runtime.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import org.jbpm.process.audit.AuditLogService;
import org.kie.internal.command.Context;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class ClearHistoryLogsCommand extends AuditCommand<Void> {
Expand Down
Expand Up @@ -15,17 +15,16 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.api.runtime.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.internal.command.Context;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
Expand Down
Expand Up @@ -15,19 +15,17 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.NodeInstanceLog;
import org.kie.api.runtime.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.JPAAuditLogService;
import org.jbpm.process.audit.NodeInstanceLog;
import org.kie.internal.command.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
Expand Down
Expand Up @@ -15,17 +15,17 @@
*/
package org.jbpm.process.audit.command;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.api.runtime.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.internal.command.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class FindProcessInstanceCommand extends AuditCommand<ProcessInstanceLog> implements ProcessInstanceIdCommand {
Expand Down
Expand Up @@ -15,17 +15,16 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.api.runtime.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.internal.command.Context;
import java.util.List;


@XmlRootElement
Expand Down
Expand Up @@ -15,18 +15,17 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.api.runtime.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.ProcessInstanceLog;
import org.kie.internal.command.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
Expand Down
Expand Up @@ -15,17 +15,16 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.VariableInstanceLog;
import org.kie.api.runtime.Context;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.VariableInstanceLog;
import org.kie.internal.command.Context;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
Expand Down
Expand Up @@ -15,18 +15,17 @@
*/
package org.jbpm.process.audit.command;

import java.util.List;
import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.VariableInstanceLog;
import org.kie.api.runtime.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;

import org.jbpm.process.audit.AuditLogService;
import org.jbpm.process.audit.VariableInstanceLog;
import org.kie.internal.command.Context;
import org.kie.internal.command.ProcessInstanceIdCommand;
import java.util.List;

@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
Expand Down
Expand Up @@ -15,22 +15,20 @@

package org.jbpm.process.audit.query;

import static org.kie.internal.query.QueryParameterIdentifiers.DATE_LIST;
import static org.kie.internal.query.QueryParameterIdentifiers.PROCESS_ID_LIST;
import static org.kie.internal.query.QueryParameterIdentifiers.PROCESS_INSTANCE_ID_LIST;

import java.sql.Timestamp;
import java.util.Date;

import org.jbpm.process.audit.JPAAuditLogService;
import org.jbpm.process.audit.command.AuditCommand;
import org.jbpm.query.jpa.builder.impl.AbstractDeleteBuilderImpl;
import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.CommandExecutor;
import org.kie.internal.command.Context;
import org.kie.api.runtime.Context;
import org.kie.internal.query.ParametrizedUpdate;
import org.kie.internal.runtime.manager.audit.query.AuditDeleteBuilder;

import java.sql.Timestamp;
import java.util.Date;

import static org.kie.internal.query.QueryParameterIdentifiers.*;

public abstract class AbstractAuditDeleteBuilderImpl<T> extends AbstractDeleteBuilderImpl<T> implements AuditDeleteBuilder<T> {

protected final CommandExecutor executor;
Expand Down
Expand Up @@ -15,25 +15,20 @@

package org.jbpm.process.audit.query;

import static org.kie.internal.query.QueryParameterIdentifiers.DATE_LIST;
import static org.kie.internal.query.QueryParameterIdentifiers.PROCESS_ID_LIST;
import static org.kie.internal.query.QueryParameterIdentifiers.PROCESS_INSTANCE_ID_LIST;

import java.util.Date;
import java.util.List;

import org.jbpm.process.audit.JPAAuditLogService;
import org.jbpm.process.audit.command.AuditCommand;
import org.jbpm.query.jpa.builder.impl.AbstractQueryBuilderImpl;
import org.jbpm.query.jpa.data.QueryWhere;
import org.kie.api.runtime.CommandExecutor;
import org.kie.internal.command.Context;
import org.kie.api.runtime.Context;
import org.kie.internal.query.ParametrizedQuery;
import org.kie.internal.query.QueryParameterIdentifiers;
import org.kie.internal.runtime.manager.audit.query.AuditLogQueryBuilder;
import org.kie.internal.runtime.manager.audit.query.NodeInstanceLogQueryBuilder;
import org.kie.internal.runtime.manager.audit.query.AuditLogQueryBuilder.OrderBy;
import org.kie.internal.runtime.manager.audit.query.ProcessIdQueryBuilder;

import java.util.Date;
import java.util.List;

import static org.kie.internal.query.QueryParameterIdentifiers.*;

@SuppressWarnings("unchecked")
public abstract class AbstractAuditQueryBuilderImpl<T,R> extends AbstractQueryBuilderImpl<T> implements AuditLogQueryBuilder<T,R> {
Expand Down
Expand Up @@ -70,11 +70,11 @@ public void setUp() throws Exception {
}

@After
public void tearDown() throws Exception {
cleanUp(context);
public void tearDown() throws Exception {
session.dispose();
session = null;
auditLogService = null;
cleanUp(context);
System.clearProperty("org.jbpm.var.log.length");
}

Expand Down
Expand Up @@ -67,10 +67,10 @@ public void setUp() throws Exception {

@After
public void tearDown() throws Exception {
cleanUp(context);
session.dispose();
session = null;
auditLogService = null;
cleanUp(context);
}

@Test
Expand Down
10 changes: 4 additions & 6 deletions jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/ActivityTest.java
Expand Up @@ -15,6 +15,7 @@

package org.jbpm.bpmn2;

import org.drools.core.command.SingleSessionCommandService;
import org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession;
import org.drools.core.command.impl.ExecutableCommand;
import org.drools.core.command.impl.RegistryContext;
Expand Down Expand Up @@ -65,7 +66,7 @@
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemManager;
import org.kie.api.runtime.process.WorkflowProcessInstance;
import org.kie.internal.command.Context;
import org.kie.api.runtime.Context;
import org.kie.internal.persistence.jpa.JPAKnowledgeService;
import org.kie.internal.runtime.StatefulKnowledgeSession;
import org.slf4j.Logger;
Expand Down Expand Up @@ -421,11 +422,8 @@ public void testRuleTaskWithFactsWithPersistence() throws Exception {
"BPMN2-RuleTask3.drl");
ksession = createKnowledgeSession(kbase);

((RegistryContext)
((CommandBasedStatefulKnowledgeSession) ksession)
.getCommandService().getContext())
.lookup( KieSession.class )
.addEventListener(new TriggerRulesEventListener(ksession));
( (SingleSessionCommandService) ( (CommandBasedStatefulKnowledgeSession) ksession ).getRunner() ).getKieSession()
.addEventListener(new TriggerRulesEventListener(ksession));
ksession.addEventListener(new DebugAgendaEventListener());
Map<String, Object> params = new HashMap<String, Object>();
params.put("x", "SomeString");
Expand Down
2 changes: 1 addition & 1 deletion jbpm-bpmn2/src/test/java/org/jbpm/bpmn2/FlowTest.java
Expand Up @@ -43,7 +43,7 @@
import org.kie.api.runtime.process.WorkItem;
import org.kie.api.runtime.process.WorkItemManager;
import org.kie.api.runtime.process.WorkflowProcessInstance;
import org.kie.internal.command.Context;
import org.kie.api.runtime.Context;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Attr;
Expand Down

0 comments on commit ca8ee66

Please sign in to comment.