public MigrationReportInstanceList migrateProcessInstances(String containerId, List<Long> processInstancesId, String targetContainerId, String targetProcessId, String payload, String marshallingType) { Map<String, String> nodeMapping = Collections.emptyMap(); if (payload != null) { logger.debug("About to unmarshal node mapping from payload: '{}' using container {} marshaller", payload, containerId); nodeMapping = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class); } logger.debug("About to migrate process instances with ids {} from container '{}' to container '{}' and process id '{}' with node mapping {}", processInstancesId, containerId, targetContainerId, targetProcessId, nodeMapping); List<MigrationReport> reports = processInstanceMigrationService.migrate(containerId, convert(processInstancesId), targetContainerId, targetProcessId, nodeMapping); logger.debug("Migration of process instances {} finished with reports {}", processInstancesId, reports); return convertMigrationReports(reports); }
public MigrationReportInstance migrateProcessInstance(String containerId, Number processInstanceId, String targetContainerId, String targetProcessId, String payload, String marshallingType) { Map<String, String> nodeMapping = Collections.emptyMap(); if (payload != null) { logger.debug("About to unmarshal node mapping from payload: '{}' using container {} marshaller", payload, containerId); nodeMapping = marshallerHelper.unmarshal(containerId, payload, marshallingType, Map.class); } logger.debug("About to migrate process instance with id {} from container '{}' to container '{}' and process id '{}' with node mapping {}", processInstanceId, containerId, targetContainerId, targetProcessId, nodeMapping); MigrationReport report = processInstanceMigrationService.migrate(containerId, processInstanceId.longValue(), targetContainerId, targetProcessId, nodeMapping); logger.debug("Migration of process instance {} finished with report {}", processInstanceId, report); return convertMigrationReport(report); }
protected ProcessNodeList convertProcessNodes(Collection<ProcessNode> processNodes) { if (processNodes == null) { return new ProcessNodeList(); } org.kie.server.api.model.admin.ProcessNode[] processNodesConverted = new org.kie.server.api.model.admin.ProcessNode[processNodes.size()]; int index = 0; for (ProcessNode processNode : processNodes) { org.kie.server.api.model.admin.ProcessNode instance = convertProcessNode(processNode); processNodesConverted[index] = instance; index++; } return new ProcessNodeList(processNodesConverted); }
@Override protected void configureServices(KieServerImpl kieServer, KieServerRegistry registry) { // all services are injected from JBPMAutoConfigure this.kieContainerCommandService = new JBPMKieContainerCommandServiceImpl(context, deploymentService, new DefinitionServiceBase(definitionService, context), new ProcessServiceBase(processService, definitionService, runtimeDataService, context), new UserTaskServiceBase(userTaskService, context), new RuntimeDataServiceBase(runtimeDataService, context), new ExecutorServiceBase(executorService, context), new QueryDataServiceBase(queryService, context), new DocumentServiceBase(context), new ProcessAdminServiceBase(processInstanceMigrationService, processInstanceAdminService, context), new UserTaskAdminServiceBase(userTaskAdminService, context)); }
public ProcessNodeList getProcessNodes(String containerId, Number processInstanceId) { logger.debug("About to get process nodes for process instance {} in container {}", processInstanceId, containerId); Collection<ProcessNode> processNodes = processInstanceAdminService.getProcessNodes(processInstanceId.longValue()); logger.debug("Found process nodes {} for process instance {}", processNodes, processInstanceId); ProcessNodeList processNodeList = convertProcessNodes(processNodes); return processNodeList; }
public TimerInstanceList getTimerInstances(String containerId, Number processInstanceId) { logger.debug("About to get timers for process instance {} in container {}", processInstanceId, containerId); Collection<TimerInstance> timerInstances = processInstanceAdminService.getTimerInstances(processInstanceId.longValue()); logger.debug("Found timers {} in process instance {}", timerInstances, processInstanceId); TimerInstanceList timerInstanceList = convertTimerInstances(timerInstances); return timerInstanceList; }
protected TimerInstanceList convertTimerInstances(Collection<TimerInstance> timerInstances) { if (timerInstances == null) { return new TimerInstanceList(); } org.kie.server.api.model.admin.TimerInstance[] timerInstancesConverted = new org.kie.server.api.model.admin.TimerInstance[timerInstances.size()]; int index = 0; for (TimerInstance timerInstance : timerInstances) { org.kie.server.api.model.admin.TimerInstance instance = convertTimerInstance(timerInstance); timerInstancesConverted[index] = instance; index++; } return new TimerInstanceList(timerInstancesConverted); }
protected MigrationReportInstance convertMigrationReport(MigrationReport report) { if (report == null) { return null; } MigrationReportInstance reportInstance = MigrationReportInstance.builder() .successful(report.isSuccessful()) .startDate(report.getStartDate()) .endDate(report.getEndDate()) .logs(convertLogs(report.getEntries())) .processInstanceId(report.getProcessInstanceId()) .build(); return reportInstance; }
new ProcessServiceBase(processService, definitionService, runtimeDataService, context), new UserTaskServiceBase(userTaskService, context), new RuntimeDataServiceBase(runtimeDataService, context), new ExecutorServiceBase(executorService, context), new QueryDataServiceBase(queryService, context), new DocumentServiceBase(context), new ProcessAdminServiceBase(processInstanceMigrationService, processInstanceAdminService, context), new UserTaskAdminServiceBase(userTaskAdminService, context));
protected MigrationReportInstanceList convertMigrationReports(List<MigrationReport> reports) { if (reports == null) { return new MigrationReportInstanceList(); } MigrationReportInstance[] reportInstances = new MigrationReportInstance[reports.size()]; int index = 0; for (MigrationReport report : reports) { MigrationReportInstance instance = convertMigrationReport(report); reportInstances[index] = instance; index++; } return new MigrationReportInstanceList(reportInstances); }