Search in sources :

Example 11 with RuntimeService

use of org.activiti.engine.RuntimeService in project Activiti by Activiti.

the class GetVariableLocalTask method execute.

@Override
public void execute(DelegateExecution execution) throws Exception {
    RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
    runtimeService.getVariableLocal(execution.getProcessInstanceId(), "Variable-That-Does-Not-Exist");
}
Also used : RuntimeService(org.activiti.engine.RuntimeService)

Example 12 with RuntimeService

use of org.activiti.engine.RuntimeService in project Activiti by Activiti.

the class StartProcessInstanceTestDelegate method execute.

public void execute(DelegateExecution execution) throws Exception {
    RuntimeService runtimeService = execution.getEngineServices().getRuntimeService();
    runtimeService.startProcessInstanceByKey("oneTaskProcess");
}
Also used : RuntimeService(org.activiti.engine.RuntimeService)

Example 13 with RuntimeService

use of org.activiti.engine.RuntimeService in project Activiti by Activiti.

the class DeleteProcessInstanceClickListener method buttonClick.

public void buttonClick(ClickEvent event) {
    I18nManager i18nManager = ExplorerApp.get().getI18nManager();
    ViewManager viewManager = ExplorerApp.get().getViewManager();
    final ConfirmationDialogPopupWindow confirmPopup = new ConfirmationDialogPopupWindow(i18nManager.getMessage(Messages.PROCESS_INSTANCE_DELETE_POPUP_TITLE, processInstanceId), i18nManager.getMessage(Messages.PROCESS_INSTANCE_DELETE_POPUP_DESCRIPTION, processInstanceId));
    confirmPopup.addListener(new ConfirmationEventListener() {

        private static final long serialVersionUID = 1L;

        protected void confirmed(ConfirmationEvent event) {
            RuntimeService runtimeService = ProcessEngines.getDefaultProcessEngine().getRuntimeService();
            runtimeService.deleteProcessInstance(processInstanceId, null);
            processInstancePage.refreshSelectNext();
        }
    });
    viewManager.showPopupWindow(confirmPopup);
}
Also used : ConfirmationEventListener(org.activiti.explorer.ui.event.ConfirmationEventListener) ConfirmationEvent(org.activiti.explorer.ui.event.ConfirmationEvent) RuntimeService(org.activiti.engine.RuntimeService) ViewManager(org.activiti.explorer.ViewManager) ConfirmationDialogPopupWindow(org.activiti.explorer.ui.custom.ConfirmationDialogPopupWindow) I18nManager(org.activiti.explorer.I18nManager)

Example 14 with RuntimeService

use of org.activiti.engine.RuntimeService in project Activiti by Activiti.

the class ActivitiRuleJunit4Test method ruleUsageExample.

@Test
@Deployment
public void ruleUsageExample() {
    RuntimeService runtimeService = activitiRule.getRuntimeService();
    runtimeService.startProcessInstanceByKey("ruleUsage");
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("My Task", task.getName());
    taskService.complete(task.getId());
    assertEquals(0, runtimeService.createProcessInstanceQuery().count());
}
Also used : Task(org.activiti.engine.task.Task) RuntimeService(org.activiti.engine.RuntimeService) TaskService(org.activiti.engine.TaskService) Test(org.junit.Test) Deployment(org.activiti.engine.test.Deployment)

Example 15 with RuntimeService

use of org.activiti.engine.RuntimeService in project Activiti by Activiti.

the class MuleHttpBasicAuthTest method httpWithBasicAuth.

@Test
public void httpWithBasicAuth() throws Exception {
    Assert.assertTrue(muleContext.isStarted());
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    Deployment deployment = processEngine.getRepositoryService().createDeployment().addClasspathResource("org/activiti/mule/testHttpBasicAuth.bpmn20.xml").deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess");
    Assert.assertFalse(processInstance.isEnded());
    Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable");
    Assert.assertEquals(10, result);
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
    processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId());
    processEngine.getRepositoryService().deleteDeployment(deployment.getId());
    assertAndEnsureCleanDb(processEngine);
    ProcessEngines.destroy();
}
Also used : RuntimeService(org.activiti.engine.RuntimeService) Deployment(org.activiti.engine.repository.Deployment) ProcessInstance(org.activiti.engine.runtime.ProcessInstance) ProcessEngine(org.activiti.engine.ProcessEngine) Test(org.junit.Test)

Aggregations

RuntimeService (org.activiti.engine.RuntimeService)19 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)9 Test (org.junit.Test)9 ProcessEngine (org.activiti.engine.ProcessEngine)6 TaskService (org.activiti.engine.TaskService)6 Task (org.activiti.engine.task.Task)5 HashMap (java.util.HashMap)4 RepositoryService (org.activiti.engine.RepositoryService)4 Deployment (org.activiti.engine.repository.Deployment)3 ReplaySimulationRun (org.activiti.crystalball.simulator.ReplaySimulationRun)2 SimulationDebugger (org.activiti.crystalball.simulator.SimulationDebugger)2 ManagementService (org.activiti.engine.ManagementService)2 ProcessEngineImpl (org.activiti.engine.impl.ProcessEngineImpl)2 StandaloneProcessEngineConfiguration (org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration)2 NoExecutionVariableScope (org.activiti.engine.impl.el.NoExecutionVariableScope)2 Deployment (org.activiti.engine.test.Deployment)2 SearchResultList (com.evolveum.midpoint.schema.SearchResultList)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 Task (com.evolveum.midpoint.task.api.Task)1 Map (java.util.Map)1