Codota Logo
SessionFactory
Code IndexAdd Codota to your IDE (free)

How to use
SessionFactory
in
org.kie.internal.runtime.manager

Best Java code snippets using org.kie.internal.runtime.manager.SessionFactory (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: kiegroup/jbpm

@Override
public void close() {
  try {
    if (!(taskServiceFactory instanceof LocalTaskServiceFactory)) {
      // if it's CDI based (meaning single application scoped bean) we need to unregister context
      removeRuntimeFromTaskService();
    }
  } catch(Exception e) {
    // do nothing 
  }
  super.close();
  factory.close();
}
origin: kiegroup/jbpm

ksession = factory.newKieSession();
ksessionId = ksession.getIdentifier();
if (context instanceof CaseContext) {
ksession = factory.findKieSessionById(ksessionId);
origin: kiegroup/jbpm

KieSession initialKsession = factory.newKieSession();
factory.onDispose(initialKsession.getIdentifier());
initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
    List<Long> ksessionsToInit = ((JPAMapper) mapper).findKSessionToInit(this.identifier);
    for (Long id : ksessionsToInit) {
      initialKsession = factory.findKieSessionById(id);
      initialKsession.execute(new DisposeKSessionCommand(initialKsession, this));
origin: kiegroup/jbpm

public void destroyCase(CaseContext caseContext) {
  KieSession kieSession = null;
  RuntimeEngine localRuntime = findLocalRuntime(caseContext.getContextId());
  if (localRuntime != null) {
    kieSession = localRuntime.getKieSession();
  } else {
    Long ksessionId = mapper.findMapping(caseContext, this.identifier);
    if (ksessionId != null) {
      kieSession = factory.findKieSessionById(ksessionId);
    }
  }
  factory.onDispose(kieSession.getIdentifier());
  List<ExecutableCommand<?>> cmds = new ArrayList<>();
  RemoveMappingCommand removeMapping = new RemoveMappingCommand(mapper, caseContext, getIdentifier());
  cmds.add(removeMapping);
  DestroyKSessionCommand destroy = new DestroyKSessionCommand(kieSession, this);
  cmds.add(destroy);
  BatchExecutionCommand batchCmd = new BatchExecutionCommandImpl(cmds);
  kieSession.execute(batchCmd);
}
origin: kiegroup/jbpm

@Override
public void activate() {
  super.activate();

  // need to init one session to bootstrap all case - such as start timers
  KieSession initialKsession = factory.newKieSession();
  initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
  
}
origin: kiegroup/jbpm

try {
  Long ksessionId = ((RuntimeEngineImpl)runtime).getKieSessionId();
  factory.onDispose(ksessionId);
  if (canDestroy(runtime)) {
    runtime.getKieSession().destroy();
origin: kiegroup/jbpm

@Override
public void activate() {
  super.activate();
  // need to init one session to bootstrap all case - such as start timers
  KieSession initialKsession = factory.newKieSession();
  initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
}
origin: org.jbpm/jbpm-runtime-manager

public void destroyCase(CaseContext caseContext) {
  KieSession kieSession = null;
  RuntimeEngine localRuntime = findLocalRuntime(caseContext.getContextId());
  if (localRuntime != null) {
    kieSession = localRuntime.getKieSession();
  } else {
    Long ksessionId = mapper.findMapping(caseContext, this.identifier);
    if (ksessionId != null) {
      kieSession = factory.findKieSessionById(ksessionId);
    }
  }
  factory.onDispose(kieSession.getIdentifier());
  List<ExecutableCommand<?>> cmds = new ArrayList<>();
  RemoveMappingCommand removeMapping = new RemoveMappingCommand(mapper, caseContext, getIdentifier());
  cmds.add(removeMapping);
  DestroyKSessionCommand destroy = new DestroyKSessionCommand(kieSession, this);
  cmds.add(destroy);
  BatchExecutionCommand batchCmd = new BatchExecutionCommandImpl(cmds);
  kieSession.execute(batchCmd);
}
origin: kiegroup/jbpm

@Override
public void afterProcessCompleted(ProcessCompletedEvent event) {
  mapper.removeMapping(new EnvironmentAwareProcessInstanceContext(
      event.getKieRuntime().getEnvironment(),
      event.getProcessInstance().getId()), managerId);
  factory.onDispose(runtime.getKieSession().getIdentifier());
  registerDisposeCallback(runtime, 
        new DestroySessionTransactionSynchronization(runtime.getKieSession()), runtime.getKieSession().getEnvironment());            
}
origin: kiegroup/jbpm

ksessionId = mapper.findMapping(context, this.identifier);
if (ksessionId == null) {
  ksession = factory.newKieSession();
  ksessionId = ksession.getIdentifier();
  ksession = factory.findKieSessionById(ksessionId);
origin: kiegroup/jbpm

KieSession initialKsession = factory.newKieSession();
factory.onDispose(initialKsession.getIdentifier());
initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
    List<Long> ksessionsToInit = ((JPAMapper) mapper).findKSessionToInit(this.identifier);
    for (Long id : ksessionsToInit) {
      initialKsession = factory.findKieSessionById(id);
      initialKsession.execute(new DisposeKSessionCommand(initialKsession, this));
origin: kiegroup/jbpm

@Override
public KieSession initKieSession(Context<?> context, InternalRuntimeManager manager, RuntimeEngine engine) {
  RuntimeEngine inUse = local.get().get(identifier);
  if (inUse != null && ((RuntimeEngineImpl) inUse).internalGetKieSession() != null) {
    return inUse.getKieSession();
  }
  KieSession ksession = factory.newKieSession();
  ((RuntimeEngineImpl)engine).internalSetKieSession(ksession);
  registerDisposeCallback(engine, new DisposeSessionTransactionSynchronization(manager, engine), ksession.getEnvironment());
  registerDisposeCallback(engine, new DestroySessionTransactionSynchronization(ksession), ksession.getEnvironment());
  registerItems(engine);
  attachManager(engine);
  return ksession;
}
origin: kiegroup/jbpm

@Override
public void close() {
  try {
    if (!(taskServiceFactory instanceof LocalTaskServiceFactory)) {
      // if it's CDI based (meaning single application scoped bean) we need to unregister context
      removeRuntimeFromTaskService();
    }
  } catch(Exception e) {
    // do nothing 
  }
  super.close();
  factory.close();
}
origin: org.jbpm/jbpm-runtime-manager

try {
  Long ksessionId = ((RuntimeEngineImpl)runtime).getKieSessionId();
  factory.onDispose(ksessionId);
  if (canDestroy(runtime)) {
    runtime.getKieSession().destroy();
origin: kiegroup/jbpm

Long ksessionId = null;
if (contextId == null || context instanceof EmptyContext) {
  ksession = factory.newKieSession();
  ksessionId = ksession.getIdentifier();
} else {
    throw new SessionNotFoundException("No session found for context " + context.getContextId());
  ksession = factory.findKieSessionById(ksessionId);
origin: org.jbpm/jbpm-runtime-manager

KieSession initialKsession = factory.newKieSession();
factory.onDispose(initialKsession.getIdentifier());
initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
    List<Long> ksessionsToInit = ((JPAMapper) mapper).findKSessionToInit(this.identifier);
    for (Long id : ksessionsToInit) {
      initialKsession = factory.findKieSessionById(id);
      initialKsession.execute(new DisposeKSessionCommand(initialKsession, this));
origin: kiegroup/jbpm

runtime = new RuntimeEngineImpl(factory.newKieSession(), internalTaskService);
((RuntimeEngineImpl) runtime).setManager(this);
origin: kiegroup/jbpm

@Override
public void close() {
  try {
    if (!(taskServiceFactory instanceof LocalTaskServiceFactory)) {
      // if it's CDI based (meaning single application scoped bean) we need to unregister context
      removeRuntimeFromTaskService();
    }
  } catch (Exception e) {
    // do nothing 
  }
  super.close();
  factory.close();
}
origin: org.jbpm/jbpm-runtime-manager

@Override
public void afterProcessCompleted(ProcessCompletedEvent event) {
  mapper.removeMapping(new EnvironmentAwareProcessInstanceContext(
      event.getKieRuntime().getEnvironment(),
      event.getProcessInstance().getId()), managerId);
  factory.onDispose(runtime.getKieSession().getIdentifier());
  registerDisposeCallback(runtime, 
        new DestroySessionTransactionSynchronization(runtime.getKieSession()), runtime.getKieSession().getEnvironment());            
}
origin: kiegroup/jbpm

if (knownSessionId > 0) {
  try {
    this.singleton = new SynchronizedRuntimeImpl(factory.findKieSessionById(knownSessionId), internalTaskService);
  } catch (RuntimeException e) {
  this.singleton = new SynchronizedRuntimeImpl(factory.newKieSession(), internalTaskService);            
  persistSessionId(location, identifier, singleton.getKieSession().getIdentifier());
org.kie.internal.runtime.managerSessionFactory

Javadoc

Factory that produces KieSession instances.

Most used methods

  • close
  • findKieSessionById
  • newKieSession
  • onDispose

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ImageIO (javax.imageio)
  • JFrame (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now