Package org.kie.api.runtime.manager

Examples of org.kie.api.runtime.manager.RuntimeEngine


        context = new ClassPathXmlApplicationContext("jbpm/local-emf/local-emf-spring.xml");

        AbstractPlatformTransactionManager aptm = (AbstractPlatformTransactionManager) context.getBean( "jbpmTxManager" );
        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get());
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();


        AuditLogService logService = (AuditLogService) context.getBean("logService");

        DefaultTransactionDefinition def = new DefaultTransactionDefinition();
View Full Code Here


     */
    @Test
    public void restRemoteApi() {
        String taskUserId = userId;
       
        RuntimeEngine engine = RemoteRuntimeEngineFactory.newRestBuilder()
                .addDeploymentId(deploymentId)
                .addUrl(deploymentUrl)
                .addUserName(userId)
                .addPassword(password)
                .build();

        // create REST request
        KieSession ksession = engine.getKieSession();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("employee", taskUserId);
        ProcessInstance processInstance = ksession.startProcess("evaluation", params);
        assertNotNull( processInstance );

        logger.debug("Started process instance: " + processInstance + " "
                + (processInstance == null ? "" : processInstance.getId()));

        TaskService taskService = engine.getTaskService();
        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
        long taskId = findTaskId(processInstance.getId(), tasks);

        logger.debug("Found task " + taskId);
        Task task = taskService.getTaskById(taskId);
View Full Code Here

    @Test
    public void jmsRemoteApiNoQueuesSupplied() {
        String taskUserId = userId;
       
        RuntimeEngine engine = RemoteRuntimeEngineFactory.newJmsBuilder()
                .addDeploymentId(deploymentId)
                .addJbossServerHostName("localhost")
                .addUserName(userId)
                .addPassword(password)
                .doNotUseSsl()
                .build();

        // create JMS request
        KieSession ksession = engine.getKieSession();
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("employee", taskUserId);
        ProcessInstance processInstance = ksession.startProcess("evaluation", params);
        assertNotNull( processInstance );

        logger.debug("Started process instance: " + processInstance + " "
                + (processInstance == null ? "" : processInstance.getId()));

        TaskService taskService = engine.getTaskService();
        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner(userId, "en-UK");
        long taskId = findTaskId(processInstance.getId(), tasks);

        logger.debug("Found task " + taskId);
        Task task = taskService.getTaskById(taskId);
View Full Code Here

            KieServices.Factory.get().getResources().newClassPathResource(
            "Evaluation.bpmn",getClass().getClassLoader()), ResourceType.BPMN2)
            .userGroupCallback(new JBossUserGroupCallbackImpl(props))
            .get();
        RuntimeManager runtimeManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);
        RuntimeEngine runtimeEngine = runtimeManager.getRuntimeEngine(EmptyContext.get());
        KieSession ksession = runtimeEngine.getKieSession();
        TaskService taskService = runtimeEngine.getTaskService();

    // start a new process instance
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("employee", "krisv");
    params.put("reason", "Yearly performance evaluation");
View Full Code Here

        return manager;
    }

    public static Object createSession(RuntimeManager manager) {
        RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
        return engine.getKieSession();
    }
View Full Code Here

        context = new ClassPathXmlApplicationContext("jbpm/jta-emf/jta-emf-spring.xml");

        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(null);
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");

        System.out.println("Process started");
View Full Code Here

        context = new ClassPathXmlApplicationContext("jbpm/jta-emf/jta-emf-spring.xml");

        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(null);
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();


        AuditLogService logService = (AuditLogService) context.getBean("logService");

        UserTransaction ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
View Full Code Here

        context = new ClassPathXmlApplicationContext("jbpm/jta-emf/tx-jta-emf-spring.xml");

        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(null);
        KieSession ksession = engine.getKieSession();
        TaskService taskService = engine.getTaskService();

        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("owner", "john");
        JtaTransactionManager jtaTxm = (JtaTransactionManager) context.getBean("jbpmTxManager");
        TransactionStatus ut = null;
View Full Code Here

public class DocumentationBuilderExamples {

    public void minimumRestBuilderExample() throws Exception {

        RuntimeEngine runtimeEngine = RemoteRuntimeEngineFactory.newRestBuilder()
                .addUserName("user")
                .addPassword("pass")
                .addUrl(new URL("http://localhost:8080/business-central"))
                .build();

        runtimeEngine.getTaskService().claim(23l, "user");

        // This will throw a MissingRequiredInfoException because the deployment id is required here
        runtimeEngine.getKieSession().startProcess("org.test.process");
    }
View Full Code Here

      UserTransaction ut = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
        ut.begin();
       
        RuntimeManager manager = (RuntimeManager) context.getBean("runtimeManager");

        RuntimeEngine engine = manager.getRuntimeEngine(null);
        KieSession ksession = engine.getKieSession();
       
        TaskService taskService = (TaskService) context.getBean("taskService");

        ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.manager.RuntimeEngine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.