Package org.kie.internal.task.api

Examples of org.kie.internal.task.api.InternalTaskService


        DeploymentInfoBean runtimeMgrMgrMock = spy(new DeploymentInfoBean());

        RuntimeEngine runtimeEngineMock = mock(RuntimeEngine.class);
        doReturn(runtimeEngineMock).when(runtimeMgrMgrMock).getRuntimeEngine(anyString(), anyLong());
        // - return mock of TaskService
        InternalTaskService runtimeTaskServiceMock = mock(InternalTaskService.class);
        // - throw exception if if you try to get a KieSession via RuntimeEngine
        doThrow(new IllegalStateException("ksession")).when(runtimeEngineMock).getKieSession();
        // - let disposeRuntimeEngine() happen.
        doNothing().when(runtimeMgrMgrMock).disposeRuntimeEngine(any(RuntimeEngine.class));

        // UserTaskService setup
        UserTaskService userTaskServiceMock = mock(UserTaskService.class);
        test.setUserTaskServiceMock(userTaskServiceMock);

        // TaskService
        InternalTaskService injectedTaskServiceMock = mock(InternalTaskService.class);

        // - set task instance
        InternalTask task = new TaskImpl();
        task.setId(TASK_ID);
        task.setTaskData(new TaskDataImpl());
View Full Code Here


        public static final BPMTaskService newTaskService(
                Environment environment,
                EntityManagerFactory entityManagerFactory,
                UserGroupCallback userGroupCallback,
                ClassLoader loader) {
            InternalTaskService internalTaskService;
            if (entityManagerFactory != null) {
                internalTaskService = (InternalTaskService)HumanTaskServiceFactory.newTaskServiceConfigurator()
                        .environment(environment)
                        .entityManagerFactory(entityManagerFactory)
                        .userGroupCallback(userGroupCallback)
                        .getTaskService();
                String deploymentId = (String)environment.get(Environments.DEPLOYMENT_ID);
                internalTaskService.addMarshallerContext(deploymentId, new ContentMarshallerContext(environment, loader));
            } else {
                internalTaskService = null;
            }
            InvocationHandler invocationHandler = new TaskServiceInvocationHandler(internalTaskService);
            return (BPMTaskService)Proxy.newProxyInstance(BPMTaskService.class.getClassLoader(), new Class[]{BPMTaskService.class}, invocationHandler);
View Full Code Here

TOP

Related Classes of org.kie.internal.task.api.InternalTaskService

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.