conflict_resolution
stringlengths
27
16k
<<<<<<< import org.bonitasoft.engine.bpm.process.ProcessInstance; import org.bonitasoft.engine.bpm.flownode.HumanTaskInstance; import org.bonitasoft.engine.bpm.flownode.TimerEventTriggerInstanceNotFoundException; ======= >>>>>>> <<<<<<< @Test public void searchFailedProcessInstances_should_return_failed_process_instances() throws Exception { // Given final SearchOptions searchOptions = new SearchOptionsBuilder(0, 20).done(); final long numberOfFailedProcessInstances = 2L; final List<ProcessInstance> failedProcessInstances = Arrays.asList((ProcessInstance) new ProcessInstanceImpl("name")); final long processDefinitionId = 9L; final List<SProcessInstance> sFailedProcessInstances = Arrays.asList((SProcessInstance) new SProcessInstanceImpl("name", processDefinitionId)); doReturn(numberOfFailedProcessInstances).when(processInstanceService).getNumberOfFailedProcessInstances(any(QueryOptions.class)); doReturn(sFailedProcessInstances).when(processInstanceService).searchFailedProcessInstances(any(QueryOptions.class)); doReturn(mock(SProcessDefinition.class)).when(processDefinitionService).getProcessDefinition(processDefinitionId); // When final SearchResult<ProcessInstance> searchFailedProcessInstances = processAPI.searchFailedProcessInstances(searchOptions); // Then assertEquals(numberOfFailedProcessInstances, searchFailedProcessInstances.getCount()); assertEquals(failedProcessInstances, searchFailedProcessInstances.getResult()); } @Test(expected = SearchException.class) public void searchFailedProcessInstances_should_throw_exception_when_transaction_content_failed() throws Exception { // Given final SearchOptions searchOptions = new SearchOptionsBuilder(0, 20).done(); doThrow(new SBonitaReadException(new Exception("plop"))).when(processInstanceService).getNumberOfFailedProcessInstances(any(QueryOptions.class)); // When processAPI.searchFailedProcessInstances(searchOptions); } @Test(expected = IllegalArgumentException.class) public void deleteArchivedProcessInstances_by_ids_should_throw_exception_when_list_is_empty() throws Exception { processAPI.deleteArchivedProcessInstancesInAllStates(Collections.<Long> emptyList()); } @Test public void getPendingHumanTaskInstances_should_return_user_tasks_of_enabled_and_disabled_processes() throws Exception { final Set<Long> actorIds = new HashSet<Long>(); actorIds.add(454545L); final long userId = 1983L; final List<Long> processDefinitionIds = new ArrayList<Long>(); processDefinitionIds.add(7897987L); when(processDefinitionService.getProcessDefinitionIds(0, Integer.MAX_VALUE)).thenReturn(processDefinitionIds); final List<SActor> actors = new ArrayList<SActor>(); final SActor actor = mock(SActor.class); actors.add(actor); when(actor.getId()).thenReturn(454545L); when(actorMappingService.getActors(new HashSet<Long>(processDefinitionIds), userId)).thenReturn(actors); final OrderAndField orderAndField = OrderAndFields.getOrderAndFieldForActivityInstance(ActivityInstanceCriterion.NAME_DESC); processAPI.getPendingHumanTaskInstances(userId, 0, 100, ActivityInstanceCriterion.NAME_DESC); verify(processDefinitionService).getProcessDefinitionIds(0, Integer.MAX_VALUE); verify(actorMappingService).getActors(anySet(), eq(userId)); verify(activityInstanceService).getPendingTasks(eq(userId), anySet(), eq(0), eq(100), eq(orderAndField.getField()), eq(orderAndField.getOrder())); } @Test(expected = RetrieveException.class) public void getConnectorsImplementations_should_throw__exception() throws Exception { //given final SConnectorException sConnectorException = new SConnectorException("message"); doThrow(sConnectorException).when(connectorService).getConnectorImplementations(anyLong(), anyLong(), anyInt(), anyInt(), anyString(), any(OrderByType.class)); //when then exception processAPI.getConnectorImplementations(PROCESS_DEFINITION_ID, START_INDEX, MAX_RESULT, CONNECTOR_CRITERION_DEFINITION_ID_ASC); } @Test(expected = RetrieveException.class) public void getNumberOfConnectorImplementations_should_throw__exception() throws Exception { //given final SConnectorException sConnectorException = new SConnectorException("message"); doThrow(sConnectorException).when(connectorService).getNumberOfConnectorImplementations(anyLong(), anyLong()); //when then exception processAPI.getNumberOfConnectorImplementations(PROCESS_DEFINITION_ID); } ======= >>>>>>>
<<<<<<< private final BusinessDataModelRepository businessDataModelRepository; ======= private final SchemaUpdater schemaUpdater; >>>>>>> private final BusinessDataModelRepository businessDataModelRepository; <<<<<<< private EntityManager getEntityManager() { ======= protected boolean isDBMDeployed() throws SBusinessDataRepositoryException { final byte[] dependency = getDeployedBDMDependency(); return dependency != null && dependency.length > 0; } @Override public byte[] getDeployedBDMDependency() throws SBusinessDataRepositoryException { final FilterOption filterOption = new FilterOption(SDependency.class, "name", BDR); final List<FilterOption> filters = new ArrayList<FilterOption>(); filters.add(filterOption); final QueryOptions queryOptions = new QueryOptions(filters, null); List<SDependency> dependencies; try { dependencies = dependencyService.getDependencies(queryOptions); } catch (SDependencyException e) { throw new SBusinessDataRepositoryException(e); } if (dependencies.isEmpty()) { return null; } return dependencies.get(0).getValue(); } protected EntityManager getEntityManager() { >>>>>>> protected EntityManager getEntityManager() {
<<<<<<< private FormMappingService formMappingService; ======= private BusinessDataRepository businessDataRespository; private RefBusinessDataService refBusinessDataService; private BusinessDataModelRepository businessDataModelRespository; private BusinessDataService businessDataService; >>>>>>> private FormMappingService formMappingService; private BusinessDataRepository businessDataRespository; private RefBusinessDataService refBusinessDataService; private BusinessDataModelRepository businessDataModelRespository; private BusinessDataService businessDataService; <<<<<<< @Override public FormMappingService getFormMappingService() { if (formMappingService == null) { formMappingService = beanAccessor.getService(FormMappingService.class); } return formMappingService; } ======= @Override public BusinessDataRepository getBusinessDataRepository() { if (businessDataRespository == null) { businessDataRespository = beanAccessor.getService(BusinessDataRepository.class); } return businessDataRespository; } @Override public BusinessDataModelRepository getBusinessDataModelRepository() { if (businessDataModelRespository == null) { businessDataModelRespository = beanAccessor.getService(BusinessDataModelRepository.class); } return businessDataModelRespository; } @Override public RefBusinessDataService getRefBusinessDataService() { if (refBusinessDataService == null) { refBusinessDataService = beanAccessor.getService(RefBusinessDataService.class); } return refBusinessDataService; } @Override public BusinessDataService getBusinessDataService() { if (businessDataService == null) { businessDataService = beanAccessor.getService(BusinessDataService.class); } return businessDataService; } >>>>>>> @Override public BusinessDataRepository getBusinessDataRepository() { if (businessDataRespository == null) { businessDataRespository = beanAccessor.getService(BusinessDataRepository.class); } return businessDataRespository; } @Override public BusinessDataModelRepository getBusinessDataModelRepository() { if (businessDataModelRespository == null) { businessDataModelRespository = beanAccessor.getService(BusinessDataModelRepository.class); } return businessDataModelRespository; } @Override public RefBusinessDataService getRefBusinessDataService() { if (refBusinessDataService == null) { refBusinessDataService = beanAccessor.getService(RefBusinessDataService.class); } return refBusinessDataService; } @Override public BusinessDataService getBusinessDataService() { if (businessDataService == null) { businessDataService = beanAccessor.getService(BusinessDataService.class); } return businessDataService; } @Override public FormMappingService getFormMappingService() { if (formMappingService == null) { formMappingService = beanAccessor.getService(FormMappingService.class); } return formMappingService; }
<<<<<<< import java.lang.management.ManagementFactory; ======= import java.io.IOException; >>>>>>> import java.lang.management.ManagementFactory; import java.io.IOException; <<<<<<< final File tempDir = new File(IOUtil.TMP_DIRECTORY, "BonitaClassLoaderTest_JVM_" + ManagementFactory.getRuntimeMXBean().getName()); // given assertThat(tempDir).as("tempDir:%s should not exists before bonitaClassLoader init", tempDir.getAbsolutePath()).doesNotExist(); ======= final File tempDir = new File(IOUtil.TMP_DIRECTORY, "BonitaClassLoaderTest"); if (tempDir.exists()) { FileUtils.deleteDirectory(tempDir); } >>>>>>> final File tempDir = new File(IOUtil.TMP_DIRECTORY, "BonitaClassLoaderTest_JVM_" + ManagementFactory.getRuntimeMXBean().getName()); if (tempDir.exists()) { FileUtils.deleteDirectory(tempDir); }
<<<<<<< apiTestSPUtil.createPlatformStructure(); apiTestSPUtil.initializeAndStartPlatformWithDefaultTenant(true); ======= APITestSPUtil.createPlatformStructure(); SPBPMTestUtil.createEnvironmentWithDefaultTenant(); >>>>>>> apiTestSPUtil.createPlatformStructure(); SPBPMTestUtil.createEnvironmentWithDefaultTenant(); <<<<<<< apiTestSPUtil.stopAndCleanPlatformAndTenant(true); apiTestSPUtil.deletePlatformStructure(); ======= SPBPMTestUtil.destroyEnvironmentWithoutTenant(); APITestSPUtil.deletePlatformStructure(); >>>>>>> SPBPMTestUtil.destroyEnvironmentWithoutTenant(); apiTestSPUtil.deletePlatformStructure();
<<<<<<< import com.bonitasoft.engine.api.TenantManagementAPI; ======= import com.bonitasoft.engine.api.ThemeAPI; >>>>>>> import com.bonitasoft.engine.api.TenantManagementAPI; import com.bonitasoft.engine.api.ThemeAPI; <<<<<<< private TenantManagementAPI tenantManagementAPI; @Override public PlatformLoginAPI getPlatformLoginAPI() throws BonitaException { return PlatformAPIAccessor.getPlatformLoginAPI(); } @Override protected PlatformAPI getPlatformAPI(final PlatformSession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return PlatformAPIAccessor.getPlatformAPI(session); } @Override protected LoginAPI getLoginAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getLoginAPI(); } ======= private ThemeAPI themeAPI; >>>>>>> private TenantManagementAPI tenantManagementAPI; private ThemeAPI themeAPI; @Override public PlatformLoginAPI getPlatformLoginAPI() throws BonitaException { return PlatformAPIAccessor.getPlatformLoginAPI(); } @Override protected PlatformAPI getPlatformAPI(final PlatformSession session) throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return PlatformAPIAccessor.getPlatformAPI(session); } @Override protected LoginAPI getLoginAPI() throws BonitaHomeNotSetException, ServerAPIException, UnknownAPITypeException { return TenantAPIAccessor.getLoginAPI(); } <<<<<<< public TenantManagementAPI getTenantManagementAPI() { return tenantManagementAPI; } public void setTenantManagementAPI(final TenantManagementAPI tenantManagementAPI) { this.tenantManagementAPI = tenantManagementAPI; } ======= public LogAPI getLogAPI() { return logAPI; } >>>>>>> public TenantManagementAPI getTenantManagementAPI() { return tenantManagementAPI; } public LogAPI getLogAPI() { return logAPI; } public void setTenantManagementAPI(final TenantManagementAPI tenantManagementAPI) { this.tenantManagementAPI = tenantManagementAPI; } <<<<<<< setAPIs(); ======= setIdentityAPI(TenantAPIAccessor.getIdentityAPI(getSession())); setProcessAPI(TenantAPIAccessor.getProcessAPI(getSession())); setProfileAPI(TenantAPIAccessor.getProfileAPI(getSession())); setThemeAPI(TenantAPIAccessor.getThemeAPI(getSession())); setCommandAPI(TenantAPIAccessor.getCommandAPI(getSession())); setReportingAPI(TenantAPIAccessor.getReportingAPI(getSession())); setMonitoringAPI(TenantAPIAccessor.getMonitoringAPI(getSession())); setPlatformMonitoringAPI(TenantAPIAccessor.getPlatformMonitoringAPI(getSession())); >>>>>>> setAPIs(); <<<<<<< setAPIs(); ======= setIdentityAPI(TenantAPIAccessor.getIdentityAPI(getSession())); setProcessAPI(TenantAPIAccessor.getProcessAPI(getSession())); setProfileAPI(TenantAPIAccessor.getProfileAPI(getSession())); setThemeAPI(TenantAPIAccessor.getThemeAPI(getSession())); setCommandAPI(TenantAPIAccessor.getCommandAPI(getSession())); setReportingAPI(TenantAPIAccessor.getReportingAPI(getSession())); setMonitoringAPI(TenantAPIAccessor.getMonitoringAPI(getSession())); setPlatformMonitoringAPI(TenantAPIAccessor.getPlatformMonitoringAPI(getSession())); logAPI = TenantAPIAccessor.getLogAPI(getSession()); >>>>>>> setAPIs(); <<<<<<< setAPIs(); ======= setIdentityAPI(TenantAPIAccessor.getIdentityAPI(getSession())); setProcessAPI(TenantAPIAccessor.getProcessAPI(getSession())); setProfileAPI(TenantAPIAccessor.getProfileAPI(getSession())); setThemeAPI(TenantAPIAccessor.getThemeAPI(getSession())); setCommandAPI(TenantAPIAccessor.getCommandAPI(getSession())); setReportingAPI(TenantAPIAccessor.getReportingAPI(getSession())); setMonitoringAPI(TenantAPIAccessor.getMonitoringAPI(getSession())); setPlatformMonitoringAPI(TenantAPIAccessor.getPlatformMonitoringAPI(getSession())); logAPI = TenantAPIAccessor.getLogAPI(getSession()); >>>>>>> setAPIs();
<<<<<<< import org.bonitasoft.engine.bpm.connector.impl.ConnectorInstanceWithFailureInfoImpl; ======= import org.bonitasoft.engine.bpm.data.ArchivedDataInstance; >>>>>>> import org.bonitasoft.engine.bpm.connector.impl.ConnectorInstanceWithFailureInfoImpl; import org.bonitasoft.engine.bpm.data.ArchivedDataInstance;
<<<<<<< @Column(name = "blobValue") @Type(type = "materialized_blob") ======= >>>>>>> @Column(name = "blobValue") @Type(type = "materialized_blob")
<<<<<<< @Test public void testLegacyMainMethodTests() throws Exception { MainRunner.callMainIfExists(ObjectArrayList.class, "test", /*num=*/"500", /*seed=*/"939384"); } ======= @Test public void testOf() { final ObjectArrayList<String> l = ObjectArrayList.of("0", "1", "2"); assertEquals(ObjectArrayList.wrap(new String[] { "0", "1", "2" }), l); } @Test public void testOfEmpty() { final ObjectArrayList<String> l = ObjectArrayList.of(); assertTrue(l.isEmpty()); } @Test public void testOfSingleton() { final ObjectArrayList<String> l = ObjectArrayList.of("0"); assertEquals(ObjectArrayList.wrap(new String[] { "0" }), l); } @Test public void testToList() { final ObjectArrayList<String> baseList = ObjectArrayList.of("wood", "board", "glass", "metal"); ObjectArrayList<String> transformed = baseList.stream().map(s -> "ply" + s).collect(ObjectArrayList.toList()); assertEquals(ObjectArrayList.of("plywood", "plyboard", "plyglass", "plymetal"), transformed); } @Test public void testSpliteratorTrySplit() { final ObjectArrayList<String> baseList = ObjectArrayList .of("0", "1", "2", "3", "4", "5", "bird"); ObjectSpliterator<String> willBeSuffix = baseList.spliterator(); assertEquals(baseList.size(), willBeSuffix.getExactSizeIfKnown()); // Rather non-intuitively for finite sequences (but makes perfect sense for infinite ones), // the spec demands the original spliterator becomes the suffix and the new Spliterator becomes the prefix. ObjectSpliterator<String> prefix = willBeSuffix.trySplit(); // No assurance of where we split, but where ever it is it should be a perfect split into a prefix and suffix. java.util.stream.Stream<String> suffixStream = java.util.stream.StreamSupport .stream(willBeSuffix, false); java.util.stream.Stream<String> prefixStream = java.util.stream.StreamSupport .stream(prefix, false); final ObjectArrayList<String> prefixList = prefixStream.collect(ObjectArrayList.toList()); final ObjectArrayList<String> suffixList = suffixStream.collect(ObjectArrayList.toList()); assertEquals(baseList.size(), prefixList.size() + suffixList.size()); assertEquals(baseList.subList(0, prefixList.size()), prefixList); assertEquals(baseList.subList(prefixList.size(), baseList.size()), suffixList); final ObjectArrayList<String> recombinedList = new ObjectArrayList<>(baseList.size()); recombinedList.addAll(prefixList); recombinedList.addAll(suffixList); assertEquals(baseList, recombinedList); } >>>>>>> @Test public void testOf() { final ObjectArrayList<String> l = ObjectArrayList.of("0", "1", "2"); assertEquals(ObjectArrayList.wrap(new String[] { "0", "1", "2" }), l); } @Test public void testOfEmpty() { final ObjectArrayList<String> l = ObjectArrayList.of(); assertTrue(l.isEmpty()); } @Test public void testOfSingleton() { final ObjectArrayList<String> l = ObjectArrayList.of("0"); assertEquals(ObjectArrayList.wrap(new String[] { "0" }), l); } @Test public void testToList() { final ObjectArrayList<String> baseList = ObjectArrayList.of("wood", "board", "glass", "metal"); ObjectArrayList<String> transformed = baseList.stream().map(s -> "ply" + s).collect(ObjectArrayList.toList()); assertEquals(ObjectArrayList.of("plywood", "plyboard", "plyglass", "plymetal"), transformed); } @Test public void testSpliteratorTrySplit() { final ObjectArrayList<String> baseList = ObjectArrayList .of("0", "1", "2", "3", "4", "5", "bird"); ObjectSpliterator<String> willBeSuffix = baseList.spliterator(); assertEquals(baseList.size(), willBeSuffix.getExactSizeIfKnown()); // Rather non-intuitively for finite sequences (but makes perfect sense for infinite ones), // the spec demands the original spliterator becomes the suffix and the new Spliterator becomes the prefix. ObjectSpliterator<String> prefix = willBeSuffix.trySplit(); // No assurance of where we split, but where ever it is it should be a perfect split into a prefix and suffix. java.util.stream.Stream<String> suffixStream = java.util.stream.StreamSupport .stream(willBeSuffix, false); java.util.stream.Stream<String> prefixStream = java.util.stream.StreamSupport .stream(prefix, false); final ObjectArrayList<String> prefixList = prefixStream.collect(ObjectArrayList.toList()); final ObjectArrayList<String> suffixList = suffixStream.collect(ObjectArrayList.toList()); assertEquals(baseList.size(), prefixList.size() + suffixList.size()); assertEquals(baseList.subList(0, prefixList.size()), prefixList); assertEquals(baseList.subList(prefixList.size(), baseList.size()), suffixList); final ObjectArrayList<String> recombinedList = new ObjectArrayList<>(baseList.size()); recombinedList.addAll(prefixList); recombinedList.addAll(suffixList); assertEquals(baseList, recombinedList); } public void testLegacyMainMethodTests() throws Exception { MainRunner.callMainIfExists(ObjectArrayList.class, "test", /*num=*/"500", /*seed=*/"939384"); }
<<<<<<< loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + " but the work service is stopped"); ======= loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + ", but the work service is stopped"); >>>>>>> loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + " but the work service is stopped"); <<<<<<< loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + " but the work service is stopped"); ======= loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + ", but the work service is stopped"); >>>>>>> loggerService.log(getClass(), TechnicalLogSeverity.WARNING, "Tried to register work " + work.getDescription() + " but the work service is stopped"); <<<<<<< } catch (final TenantIdNotSetException e) { throw new WorkRegisterException("Unable to read tenant id from session", e); ======= } catch (STenantIdNotSetException e) { throw new SWorkRegisterException("Unable to read tenant id from session.", e); >>>>>>> } catch (STenantIdNotSetException e) { throw new SWorkRegisterException("Unable to read tenant id from session.", e); <<<<<<< } catch (final WorkException e) { ======= } catch (SWorkException e) { loggerService.log(getClass(), TechnicalLogSeverity.WARNING, e.getMessage()); } catch (TimeoutException e) { >>>>>>> } catch (SWorkException e) { <<<<<<< public void pause() throws WorkException { ======= public void pause() throws TimeoutException, SWorkException { >>>>>>> public void pause() throws SWorkException { <<<<<<< private void stopWithException() throws WorkException { ======= private void stopWithException() throws TimeoutException, SWorkException { >>>>>>> private void stopWithException() throws SWorkException { <<<<<<< } catch (final InterruptedException e) { throw new WorkException("Interrupted while pausing the work service", e); ======= } catch (InterruptedException e) { throw new SWorkException("Interrupted while pausing the work service", e); >>>>>>> } catch (final InterruptedException e) { throw new SWorkException("Interrupted while pausing the work service", e);
<<<<<<< ======= boolean shouldPerformUpdateAtEnd(); >>>>>>>
<<<<<<< public static FormMapping toFormMapping(SFormMapping sFormMapping) { if (sFormMapping == null) { return null; } FormMapping formMapping = new FormMapping(); formMapping.setId(sFormMapping.getId()); formMapping.setTask(sFormMapping.getTask()); formMapping.setExternal(sFormMapping.isExternal()); formMapping.setForm(sFormMapping.getForm()); formMapping.setType(FormMappingType.valueOf(sFormMapping.getType())); formMapping.setProcessDefinitionId(sFormMapping.getProcessDefinitionId()); long lastUpdateDate = sFormMapping.getLastUpdateDate(); formMapping.setLastUpdateDate(lastUpdateDate > 0 ? new Date(lastUpdateDate): null); formMapping.setLastUpdatedBy(sFormMapping.getLastUpdatedBy()); return formMapping; } public static List<FormMapping> toFormMappings(List<SFormMapping> serverObjects) { final List<FormMapping> clientObjects = new ArrayList<FormMapping>(serverObjects.size()); for (final SFormMapping serverObject : serverObjects) { ; clientObjects.add(toFormMapping(serverObject)); } return clientObjects; } ======= public static ContractDefinition toContract(final SContractDefinition sContract) { final ContractDefinitionImpl contract = new ContractDefinitionImpl(); for (final SSimpleInputDefinition input : sContract.getSimpleInputs()) { contract.addSimpleInput(toSimpleInput(input)); } for (final SComplexInputDefinition input : sContract.getComplexInputs()) { contract.addComplexInput(toComplexInput(input)); } for (final SConstraintDefinition sConstraintDefinition : sContract.getConstraints()) { final ConstraintDefinitionImpl constraint = new ConstraintDefinitionImpl(sConstraintDefinition.getName(), sConstraintDefinition.getExpression(), sConstraintDefinition.getExplanation(), ConstraintType.valueOf(sConstraintDefinition.getConstraintType().toString())); for (final String inputName : sConstraintDefinition.getInputNames()) { constraint.addInputName(inputName); } contract.addConstraint(constraint); } return contract; } private static SimpleInputDefinition toSimpleInput(final SSimpleInputDefinition input) { return new SimpleInputDefinitionImpl(input.getName(), Type.valueOf(input.getType().toString()), input.getDescription(), input.isMultiple()); } private static ComplexInputDefinition toComplexInput(final SComplexInputDefinition input) { final List<SimpleInputDefinition> simpleInputDefinitions = new ArrayList<SimpleInputDefinition>(); final List<ComplexInputDefinition> complexInputDefinitions = new ArrayList<ComplexInputDefinition>(); for (final SSimpleInputDefinition sSimpleInputDefinition : input.getSimpleInputDefinitions()) { simpleInputDefinitions.add(toSimpleInput(sSimpleInputDefinition)); } for (final SComplexInputDefinition sComplexInputDefinition : input.getComplexInputDefinitions()) { complexInputDefinitions.add(toComplexInput(sComplexInputDefinition)); } return new ComplexInputDefinitionImpl(input.getName(), input.getDescription(), input.isMultiple(), simpleInputDefinitions, complexInputDefinitions); } >>>>>>> public static FormMapping toFormMapping(SFormMapping sFormMapping) { if (sFormMapping == null) { return null; } FormMapping formMapping = new FormMapping(); formMapping.setId(sFormMapping.getId()); formMapping.setTask(sFormMapping.getTask()); formMapping.setExternal(sFormMapping.isExternal()); formMapping.setForm(sFormMapping.getForm()); formMapping.setType(FormMappingType.valueOf(sFormMapping.getType())); formMapping.setProcessDefinitionId(sFormMapping.getProcessDefinitionId()); long lastUpdateDate = sFormMapping.getLastUpdateDate(); formMapping.setLastUpdateDate(lastUpdateDate > 0 ? new Date(lastUpdateDate): null); formMapping.setLastUpdatedBy(sFormMapping.getLastUpdatedBy()); return formMapping; } public static List<FormMapping> toFormMappings(List<SFormMapping> serverObjects) { final List<FormMapping> clientObjects = new ArrayList<FormMapping>(serverObjects.size()); for (final SFormMapping serverObject : serverObjects) { ; clientObjects.add(toFormMapping(serverObject)); } return clientObjects; } public static ContractDefinition toContract(final SContractDefinition sContract) { final ContractDefinitionImpl contract = new ContractDefinitionImpl(); for (final SSimpleInputDefinition input : sContract.getSimpleInputs()) { contract.addSimpleInput(toSimpleInput(input)); } for (final SComplexInputDefinition input : sContract.getComplexInputs()) { contract.addComplexInput(toComplexInput(input)); } for (final SConstraintDefinition sConstraintDefinition : sContract.getConstraints()) { final ConstraintDefinitionImpl constraint = new ConstraintDefinitionImpl(sConstraintDefinition.getName(), sConstraintDefinition.getExpression(), sConstraintDefinition.getExplanation(), ConstraintType.valueOf(sConstraintDefinition.getConstraintType().toString())); for (final String inputName : sConstraintDefinition.getInputNames()) { constraint.addInputName(inputName); } contract.addConstraint(constraint); } return contract; } private static SimpleInputDefinition toSimpleInput(final SSimpleInputDefinition input) { return new SimpleInputDefinitionImpl(input.getName(), Type.valueOf(input.getType().toString()), input.getDescription(), input.isMultiple()); } private static ComplexInputDefinition toComplexInput(final SComplexInputDefinition input) { final List<SimpleInputDefinition> simpleInputDefinitions = new ArrayList<SimpleInputDefinition>(); final List<ComplexInputDefinition> complexInputDefinitions = new ArrayList<ComplexInputDefinition>(); for (final SSimpleInputDefinition sSimpleInputDefinition : input.getSimpleInputDefinitions()) { simpleInputDefinitions.add(toSimpleInput(sSimpleInputDefinition)); } for (final SComplexInputDefinition sComplexInputDefinition : input.getComplexInputDefinitions()) { complexInputDefinitions.add(toComplexInput(sComplexInputDefinition)); } return new ComplexInputDefinitionImpl(input.getName(), input.getDescription(), input.isMultiple(), simpleInputDefinitions, complexInputDefinitions); }
<<<<<<< import com.bonitasoft.engine.CommonAPISPIT; import com.bonitasoft.engine.bdm.BusinessObjectDAOFactory; import com.bonitasoft.engine.bdm.BusinessObjectModelConverter; import com.bonitasoft.engine.bdm.dao.BusinessObjectDAO; import com.bonitasoft.engine.bdm.model.BusinessObject; import com.bonitasoft.engine.bdm.model.BusinessObjectModel; import com.bonitasoft.engine.bdm.model.Query; import com.bonitasoft.engine.bdm.model.field.FieldType; import com.bonitasoft.engine.bdm.model.field.RelationField; import com.bonitasoft.engine.bdm.model.field.RelationField.FetchType; import com.bonitasoft.engine.bdm.model.field.RelationField.Type; import com.bonitasoft.engine.bdm.model.field.SimpleField; import com.bonitasoft.engine.bpm.process.impl.ProcessDefinitionBuilderExt; import com.bonitasoft.engine.businessdata.BusinessDataReference; import com.bonitasoft.engine.businessdata.BusinessDataRepositoryDeploymentException; import com.bonitasoft.engine.businessdata.BusinessDataRepositoryException; import com.bonitasoft.engine.businessdata.SimpleBusinessDataReference; /** * @deprecated From 7.0.0 on, please report changes to this class in org.bonitasoft.engine.business.data.BDRepositoryIT */ @Deprecated ======= >>>>>>> import com.bonitasoft.engine.CommonAPISPIT; import com.bonitasoft.engine.bdm.BusinessObjectDAOFactory; import com.bonitasoft.engine.bdm.BusinessObjectModelConverter; import com.bonitasoft.engine.bdm.dao.BusinessObjectDAO; import com.bonitasoft.engine.bdm.model.BusinessObject; import com.bonitasoft.engine.bdm.model.BusinessObjectModel; import com.bonitasoft.engine.bdm.model.Query; import com.bonitasoft.engine.bdm.model.field.FieldType; import com.bonitasoft.engine.bdm.model.field.RelationField; import com.bonitasoft.engine.bdm.model.field.RelationField.FetchType; import com.bonitasoft.engine.bdm.model.field.RelationField.Type; import com.bonitasoft.engine.bdm.model.field.SimpleField; import com.bonitasoft.engine.bpm.process.impl.ProcessDefinitionBuilderExt; import com.bonitasoft.engine.businessdata.BusinessDataReference; import com.bonitasoft.engine.businessdata.BusinessDataRepositoryDeploymentException; import com.bonitasoft.engine.businessdata.BusinessDataRepositoryException; import com.bonitasoft.engine.businessdata.SimpleBusinessDataReference; /** * @deprecated From 7.0.0 on, please report changes to this class in org.bonitasoft.engine.business.data.BDRepositoryIT */ @Deprecated <<<<<<< final String firstName = "FlofFlof"; final String lastName = "Boudin"; final Expression employeeExpression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee", new StringBuilder().append("import ") .append(EMPLOYEE_QUALIFIED_NAME).append("; import ").append(ADDRESS_QUALIFIED_NAME).append("; Employee e = new Employee(); e.firstName = '") .append(firstName).append("'; e.lastName = '").append(lastName).append("'; e.addToAddresses(myAddress); return e;").toString(), EMPLOYEE_QUALIFIED_NAME, new ExpressionBuilder().createBusinessDataExpression("myAddress", ADDRESS_QUALIFIED_NAME)); ======= final String firstNameEmployee1 = "FlofFlof"; final String lastNameEmployee1 = "Boudin"; final Expression employee1Expression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee", "import " + EMPLOYEE_QUALIF_CLASSNAME + "; import org.bonita.pojo.Address; Employee e = new Employee(); e.firstName = '" + firstNameEmployee1 + "'; e.lastName = '" + lastNameEmployee1 + "'; e.addToAddresses(myAddress); return e;", EMPLOYEE_QUALIF_CLASSNAME, new ExpressionBuilder().createBusinessDataExpression("myAddress", ADDRESS_QUALIF_NAME)); >>>>>>> final String firstName = "FlofFlof"; final String lastName = "Boudin"; final Expression employeeExpression = new ExpressionBuilder().createGroovyScriptExpression("createNewEmployee", new StringBuilder().append("import ") .append(EMPLOYEE_QUALIFIED_NAME).append("; import ").append(ADDRESS_QUALIFIED_NAME).append("; Employee e = new Employee(); e.firstName = '") .append(firstName).append("'; e.lastName = '").append(lastName).append("'; e.addToAddresses(myAddress); return e;").toString(), EMPLOYEE_QUALIFIED_NAME, new ExpressionBuilder().createBusinessDataExpression("myAddress", ADDRESS_QUALIFIED_NAME)); <<<<<<< new ExpressionBuilder().createGroovyScriptExpression(getLastNameWithDAOExpression, "import " + EMPLOYEE_QUALIFIED_NAME + "; Employee e = " + employeeDAOName + ".findByFirstName('" + firstName + "', 0, 10).get(0); e.getAddresses().get(0).city", String.class.getName(), new ExpressionBuilder().buildBusinessObjectDAOExpression(employeeDAOName, EMPLOYEE_QUALIFIED_NAME + "DAO")), null); ======= new ExpressionBuilder().createGroovyScriptExpression(getLastNameWithDAOExpression, "import " + EMPLOYEE_QUALIF_CLASSNAME + "; Employee e = " + employeeDAOName + ".findByFirstName('" + firstNameEmployee1 + "', 0, 10).get(0); e.getAddresses().get(0).city", String.class.getName(), new ExpressionBuilder().buildBusinessObjectDAOExpression(employeeDAOName, EMPLOYEE_QUALIF_CLASSNAME + "DAO")), null); expressions.put(new ExpressionBuilder().createQueryBusinessDataExpression(COUNT_ADDRESS, "Address." + COUNT_ADDRESS, Long.class.getName()), null); expressions.put(new ExpressionBuilder().createQueryBusinessDataExpression(COUNT_EMPLOYEE, "Employee." + COUNT_EMPLOYEE, Long.class.getName()), null); >>>>>>> new ExpressionBuilder().createGroovyScriptExpression(getLastNameWithDAOExpression, "import " + EMPLOYEE_QUALIF_CLASSNAME + "; Employee e = " + employeeDAOName + ".findByFirstName('" + firstNameEmployee1 + "', 0, 10).get(0); e.getAddresses().get(0).city", String.class.getName(), new ExpressionBuilder().buildBusinessObjectDAOExpression(employeeDAOName, EMPLOYEE_QUALIF_CLASSNAME + "DAO")), null); expressions.put(new ExpressionBuilder().createQueryBusinessDataExpression(COUNT_ADDRESS, "Address." + COUNT_ADDRESS, Long.class.getName()), null); expressions.put(new ExpressionBuilder().createQueryBusinessDataExpression(COUNT_EMPLOYEE, "Employee." + COUNT_EMPLOYEE, Long.class.getName()), null);
<<<<<<< importProvidedPage("bonita-layout-page.zip"); importProvidedPage("step-autogenerated-form.zip"); importProvidedPage("process-autogenerated-form.zip"); } ======= importProvidedPage("bonita-layout-page.zip"); importProvidedPage("bonita-theme-page.zip"); } >>>>>>> importProvidedPage("bonita-layout-page.zip"); importProvidedPage("bonita-theme-page.zip"); importProvidedPage("step-autogenerated-form.zip"); importProvidedPage("process-autogenerated-form.zip"); }
<<<<<<< import org.bonitasoft.engine.api.impl.ProcessConfigurationAPIImpl; ======= import org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl; >>>>>>> import org.bonitasoft.engine.api.impl.ProcessConfigurationAPIImpl; import org.bonitasoft.engine.api.impl.TenantAdministrationAPIImpl; <<<<<<< apis.put(ProcessConfigurationAPI.class.getName(), new ProcessConfigurationAPIImpl()); ======= apis.put(BusinessDataAPI.class.getName(), new BusinessDataAPIImpl()); >>>>>>> apis.put(ProcessConfigurationAPI.class.getName(), new ProcessConfigurationAPIImpl()); apis.put(BusinessDataAPI.class.getName(), new BusinessDataAPIImpl());
<<<<<<< public int getNextAvailableIndex(Long parentMenuId) throws SBonitaReadException { int lastIndex = getLastUsedIndex(parentMenuId); return lastIndex + 1; } protected Integer executeGetLastUsedIndexQuery(Long parentMenuId) throws SBonitaReadException { SelectOneDescriptor<Integer> selectDescriptor; if (parentMenuId == null) { selectDescriptor = new SelectOneDescriptor<Integer>("getLastIndexForRootMenu", Collections.<String, Object> emptyMap(), SApplicationMenu.class); } else { SApplicationMenuBuilderFactoryImpl factory = new SApplicationMenuBuilderFactoryImpl(); selectDescriptor = new SelectOneDescriptor<Integer>("getLastIndexForChildOf", Collections.<String, Object> singletonMap( factory.getParentIdKey(), parentMenuId), SApplicationMenu.class); } Integer lastUsedIndex = persistenceService.selectOne(selectDescriptor); return lastUsedIndex; } public int getLastUsedIndex(Long parentMenuId) throws SBonitaReadException { Integer lastUsedIndex = executeGetLastUsedIndexQuery(parentMenuId); return lastUsedIndex == null ? 0 : lastUsedIndex; } ======= @Override public List<String> getAllPagesForProfile(long profileId) throws SBonitaReadException { SelectListDescriptor<String> selectList = new SelectListDescriptor<String>("getAllPagesForProfile",Collections.<String, Object>singletonMap("profileId",profileId),SApplicationPage.class, new QueryOptions(0,QueryOptions.UNLIMITED_NUMBER_OF_RESULTS)); return persistenceService.selectList(selectList); } >>>>>>> @Override public List<String> getAllPagesForProfile(long profileId) throws SBonitaReadException { SelectListDescriptor<String> selectList = new SelectListDescriptor<String>("getAllPagesForProfile",Collections.<String, Object>singletonMap("profileId",profileId),SApplicationPage.class, new QueryOptions(0,QueryOptions.UNLIMITED_NUMBER_OF_RESULTS)); return persistenceService.selectList(selectList); } public int getNextAvailableIndex(Long parentMenuId) throws SBonitaReadException { int lastIndex = getLastUsedIndex(parentMenuId); return lastIndex + 1; } protected Integer executeGetLastUsedIndexQuery(Long parentMenuId) throws SBonitaReadException { SelectOneDescriptor<Integer> selectDescriptor; if (parentMenuId == null) { selectDescriptor = new SelectOneDescriptor<Integer>("getLastIndexForRootMenu", Collections.<String, Object> emptyMap(), SApplicationMenu.class); } else { SApplicationMenuBuilderFactoryImpl factory = new SApplicationMenuBuilderFactoryImpl(); selectDescriptor = new SelectOneDescriptor<Integer>("getLastIndexForChildOf", Collections.<String, Object> singletonMap( factory.getParentIdKey(), parentMenuId), SApplicationMenu.class); } Integer lastUsedIndex = persistenceService.selectOne(selectDescriptor); return lastUsedIndex; } public int getLastUsedIndex(Long parentMenuId) throws SBonitaReadException { Integer lastUsedIndex = executeGetLastUsedIndexQuery(parentMenuId); return lastUsedIndex == null ? 0 : lastUsedIndex; }
<<<<<<< * Commands are used to extend engine behavior, and are classes that are called from this API and executed on the server side. <br> ======= * <code>Command</code>s are used to extend engine behavior, and are classes that are called from this API and executed on the server side. <br/> >>>>>>> * Commands are used to extend engine behavior, and are classes that are called from this API and executed on the server side. <br> <<<<<<< * A command is composed of a jar containing at least one class that implements org.bonitasoft.engine.command.TenantCommand. * org.bonitasoft.engine.command.system.CommandWithParameters can be used to handle parameter more easily. The behavior of the command must be defined in the * execute method of this class.<br> ======= * A command is composed of a jar containing at least one class that implements <code>org.bonitasoft.engine.command.TenantCommand</code>. * <code>org.bonitasoft.engine.command.system.CommandWithParameters</code> can be used to handle parameter more easily. The behavior of the command must be * defined in the * execute method of this class.<br/> >>>>>>> * A command is composed of a jar containing at least one class that implements <code>org.bonitasoft.engine.command.TenantCommand</code>. * <code>org.bonitasoft.engine.command.system.CommandWithParameters</code> can be used to handle parameter more easily. The behavior of the command must be * defined in the * execute method of this class.<br> <<<<<<< * Code example:<br> * * In this example we deploy a command named "myCommandName". The class that implements TenantCommand is org.bonitasoft.engine.command.IntegerCommand and * is contained in the jar we deploy using CommandAPI.addDependency. * ======= * Code example:<br/> * In this example we deploy a command named "myCommandName". The class that implements <code>TenantCommand</code> is * <code>org.bonitasoft.engine.command.IntegerCommand</code> and is contained in the jar we deploy using {@link CommandAPI#addDependency(String, byte[])}. * <br/> * <br/> >>>>>>> * Code example:<br> * * In this example we deploy a command named "myCommandName". The class that implements <code>TenantCommand</code> is <code>org.bonitasoft.engine.command.IntegerCommand</code> and * is contained in the jar we deploy using CommandAPI.addDependency. * <br> * <br> <<<<<<< * the JAR content * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The JAR content of the dependency. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The JAR content of the dependency. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the dependency name. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The name of the dependency. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The name of the dependency. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the implementation class which will be uses when executing the command. This class is inside the jar. * @return the descriptor of the newly created command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The name of the implementation class of the command. It will be used when executing the command. This class is inside the jar of a dependency. * @return The descriptor of the newly created command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The name of the implementation class of the command. It will be used when executing the command. This class is inside the jar of a dependency. * @return The descriptor of the newly created command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the parameters * @return the result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The parameters of the command * @return The result of the command execution. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The parameters of the command * @return The result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the parameters * @return the result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The parameters of the command * @return The result of the command execution. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The parameters of the command * @return The result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the parameters * @return the result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The parameters of the command * @return The result of the command execution. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The parameters of the command * @return The result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the parameters * @return the result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The parameters of the command * @return The result of the command execution. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The parameters of the command * @return The result of the command execution. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the command name * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The name of the command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The name of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the command name * @return the descriptor of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The name of the command * @return The descriptor of the command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The name of the command * @return The descriptor of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the sorting criterion * @return the paginated list of descriptors of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The sorting criterion of the list. * @return The paginated list of descriptors of the command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The sorting criterion of the list. * @return The paginated list of descriptors of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the update descriptor * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The update descriptor (containing the fields to update & their new value). * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The update descriptor (containing the fields to update & their new value). * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * Delete all commands * * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * Delete all commands. * * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * Delete all commands. * * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * The sorting criterion * @return The list of commands * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The sorting criterion of the list. * @return The paginated list of descriptors of the command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The sorting criterion of the list. * @return The paginated list of descriptors of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * identifier of command * @return the descriptor of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The identifier of command * @return The descriptor of the command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The identifier of command * @return The descriptor of the command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the update descriptor * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The update descriptor * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The update descriptor * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * the identifier of command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The identifier of command * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The identifier of command * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * The criterion used during the search * @return A {@link SearchResult} containing the search result * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. ======= * The criterion used during the search * @return A {@link SearchResult} containing the descriptor of the commands. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * The criterion used during the search * @return A {@link SearchResult} containing the descriptor of the commands. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired.
<<<<<<< public long getNumberOfSProcessInstanceFailed() { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("getNumberOfSProcessInstanceFailed"); return ((Number) namedQuery.uniqueResult()).longValue(); } @SuppressWarnings("unchecked") public List<SProcessInstance> searchSProcessInstanceFailed() { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("searchSProcessInstanceFailed"); return namedQuery.list(); } ======= public long getNumberOfProcessInstances(final long processDefinitionId) { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("countProcessInstancesOfProcessDefinition"); namedQuery.setParameter("processDefinitionId", processDefinitionId); return (Long) namedQuery.uniqueResult(); } >>>>>>> public long getNumberOfSProcessInstanceFailed() { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("getNumberOfSProcessInstanceFailed"); return ((Number) namedQuery.uniqueResult()).longValue(); } @SuppressWarnings("unchecked") public List<SProcessInstance> searchSProcessInstanceFailed() { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("searchSProcessInstanceFailed"); return namedQuery.list(); } public long getNumberOfProcessInstances(final long processDefinitionId) { getSession().enableFilter("tenantFilter").setParameter("tenantId", PersistentObjectBuilder.DEFAULT_TENANT_ID); final Query namedQuery = getNamedQuery("countProcessInstancesOfProcessDefinition"); namedQuery.setParameter("processDefinitionId", processDefinitionId); return (Long) namedQuery.uniqueResult(); }
<<<<<<< try { if (!lockService.tryLock(processInstanceId, SFlowElementsContainerType.PROCESS.name())) { // reschedule the work final ExecuteFlowNodeWork runnable = new ExecuteFlowNodeWork(Type.FLOWNODE, flowNodeInstanceId, operations, expressionContext, processInstanceId); try { final int sleepTime = 50; if (logger.isLoggable(getClass(), TechnicalLogSeverity.DEBUG)) { logger.log(this.getClass(), TechnicalLogSeverity.DEBUG, "waiting " + sleepTime + " ms to reexecute " + runnable.getDescription()); } Thread.sleep(sleepTime); } catch (final InterruptedException e) { } workService.registerWork(runnable); return null; } transactionService.registerBonitaSynchronization(new UnlockSynchronization(lockService, processInstanceId, SFlowElementsContainerType.PROCESS .name())); } catch (final SBonitaException e) { throw new SFlowNodeExecutionException(e); } ======= >>>>>>> <<<<<<< if (logger.isLoggable(getClass(), TechnicalLogSeverity.ERROR)) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, msg.toString()); } ======= logger.log(this.getClass(), TechnicalLogSeverity.ERROR, msg.toString(), sbe); >>>>>>> if (logger.isLoggable(getClass(), TechnicalLogSeverity.ERROR)) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, msg.toString(), sbe); } <<<<<<< if (!lockService.tryLock(parentId, SFlowElementsContainerType.PROCESS.name())) {// lock activity in order to avoid hit 2 times at the same time // reschedule work because we did not lock final NotifyChildFinishedWork runnable = new NotifyChildFinishedWork(processDefinitionId, sFlowNodeInstanceChild.getId(), sFlowNodeInstanceChild.getParentContainerId(), sFlowNodeInstanceChild.getParentContainerType().name(), stateId); try { if (logger.isLoggable(getClass(), TechnicalLogSeverity.DEBUG)) { logger.log(this.getClass(), TechnicalLogSeverity.DEBUG, "waiting " + 50 + " ms to reexecute " + runnable.getDescription()); } Thread.sleep(50); } catch (final InterruptedException e) { } workService.registerWork(runnable); return; } transactionService.registerBonitaSynchronization(new UnlockSynchronization(lockService, parentId, SFlowElementsContainerType.PROCESS.name())); ======= >>>>>>>
<<<<<<< private XMLNode createContractNode(final SContractDefinition contract) { final XMLNode contractNode = new XMLNode(CONTRACT_NODE); final List<SInputDefinition> inputs = contract.getInputs(); if (!inputs.isEmpty()) { final XMLNode inputsNode = new XMLNode(CONTRACT_INPUTS_NODE); contractNode.addChild(inputsNode); for (final SInputDefinition input : inputs) { inputsNode.addChild(createInputNode(input)); } } final List<SRuleDefinition> rules = contract.getRules(); if (!rules.isEmpty()) { final XMLNode rulesNode = new XMLNode(CONTRACT_RULES_NODE); contractNode.addChild(rulesNode); for (final SRuleDefinition rule : rules) { rulesNode.addChild(createRuleNode(rule)); } } return contractNode; } private XMLNode createRuleNode(final SRuleDefinition rule) { final XMLNode ruleNode = new XMLNode(CONTRACT_RULE_NODE); ruleNode.addAttribute(NAME, rule.getName()); ruleNode.addChild(RULE_EXPRESSION, rule.getExpression()); ruleNode.addChild(RULE_EXPLANATION, rule.getExplanation()); final XMLNode namesNode = new XMLNode(INPUT_NAMES); ruleNode.addChild(namesNode); for (final String inputName : rule.getInputNames()) { namesNode.addChild(INPUT_NAME, inputName); } return ruleNode; } private XMLNode createInputNode(final SInputDefinition input) { final XMLNode inputNode = new XMLNode(CONTRACT_INPUT_NODE); inputNode.addAttribute(NAME, input.getName()); inputNode.addAttribute(TYPE, input.getType()); inputNode.addAttribute(DESCRIPTION, input.getDescription()); return inputNode; } ======= private void addBusinessDataDefinitionNodes(final List<SBusinessDataDefinition> businessDataDefinitions, final XMLNode containerNode) { if (!businessDataDefinitions.isEmpty()) { final XMLNode businessDataDefinitionsNode = new XMLNode(BUSINESS_DATA_DEFINITIONS_NODE); containerNode.addChild(businessDataDefinitionsNode); for (final SBusinessDataDefinition businessDataDefinition : businessDataDefinitions) { final XMLNode businessDataDefinitionNode = createBusinessDataDefinitionNode(businessDataDefinition); businessDataDefinitionsNode.addChild(businessDataDefinitionNode); } } } >>>>>>> private XMLNode createContractNode(final SContractDefinition contract) { final XMLNode contractNode = new XMLNode(CONTRACT_NODE); final List<SInputDefinition> inputs = contract.getInputs(); if (!inputs.isEmpty()) { final XMLNode inputsNode = new XMLNode(CONTRACT_INPUTS_NODE); contractNode.addChild(inputsNode); for (final SInputDefinition input : inputs) { inputsNode.addChild(createInputNode(input)); } } final List<SRuleDefinition> rules = contract.getRules(); if (!rules.isEmpty()) { final XMLNode rulesNode = new XMLNode(CONTRACT_RULES_NODE); contractNode.addChild(rulesNode); for (final SRuleDefinition rule : rules) { rulesNode.addChild(createRuleNode(rule)); } } return contractNode; } private XMLNode createRuleNode(final SRuleDefinition rule) { final XMLNode ruleNode = new XMLNode(CONTRACT_RULE_NODE); ruleNode.addAttribute(NAME, rule.getName()); ruleNode.addChild(RULE_EXPRESSION, rule.getExpression()); ruleNode.addChild(RULE_EXPLANATION, rule.getExplanation()); final XMLNode namesNode = new XMLNode(INPUT_NAMES); ruleNode.addChild(namesNode); for (final String inputName : rule.getInputNames()) { namesNode.addChild(INPUT_NAME, inputName); } return ruleNode; } private XMLNode createInputNode(final SInputDefinition input) { final XMLNode inputNode = new XMLNode(CONTRACT_INPUT_NODE); inputNode.addAttribute(NAME, input.getName()); inputNode.addAttribute(TYPE, input.getType()); inputNode.addAttribute(DESCRIPTION, input.getDescription()); return inputNode; } private void addBusinessDataDefinitionNodes(final List<SBusinessDataDefinition> businessDataDefinitions, final XMLNode containerNode) { if (!businessDataDefinitions.isEmpty()) { final XMLNode businessDataDefinitionsNode = new XMLNode(BUSINESS_DATA_DEFINITIONS_NODE); containerNode.addChild(businessDataDefinitionsNode); for (final SBusinessDataDefinition businessDataDefinition : businessDataDefinitions) { final XMLNode businessDataDefinitionNode = createBusinessDataDefinitionNode(businessDataDefinition); businessDataDefinitionsNode.addChild(businessDataDefinitionNode); } } }
<<<<<<< ======= @Mock private FlowNodeStateManager manager; >>>>>>> @Mock private FlowNodeStateManager manager; <<<<<<< public void getDocument_from_process_instance_and_name_should_return_a_document_with_generated_url_when_it_has_content() { ======= public void toArchivedUserTaskInstance_sould_return_the_right_idenfiers() throws Exception { final SAUserTaskInstanceImpl sInstance = new SAUserTaskInstanceImpl(); sInstance.setRootContainerId(1L); sInstance.setParentContainerId(2L); sInstance.setLogicalGroup(0, 456789456798L); sInstance.setLogicalGroup(1, 1L); sInstance.setLogicalGroup(2, 456L); sInstance.setLogicalGroup(3, 2L); sInstance.setStateId(5); sInstance.setPriority(STaskPriority.NORMAL); when(manager.getState(5)).thenReturn(new CompletedActivityStateImpl()); final ArchivedUserTaskInstance archivedUserTaskInstance = ModelConvertor.toArchivedUserTaskInstance(sInstance, manager); assertThat(archivedUserTaskInstance.getProcessDefinitionId()).isEqualTo(456789456798L); assertThat(archivedUserTaskInstance.getRootContainerId()).isEqualTo(1L); assertThat(archivedUserTaskInstance.getParentContainerId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getProcessInstanceId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getParentActivityInstanceId()).isEqualTo(456L); } @Test public void getDocument_from_process_instance_and_name_should_return_a_document_with_generated_url_when_it_has_content() throws Exception { >>>>>>> public void toArchivedUserTaskInstance_sould_return_the_right_idenfiers() { final SAUserTaskInstanceImpl sInstance = new SAUserTaskInstanceImpl(); sInstance.setRootContainerId(1L); sInstance.setParentContainerId(2L); sInstance.setLogicalGroup(0, 456789456798L); sInstance.setLogicalGroup(1, 1L); sInstance.setLogicalGroup(2, 456L); sInstance.setLogicalGroup(3, 2L); sInstance.setStateId(5); sInstance.setPriority(STaskPriority.NORMAL); when(manager.getState(5)).thenReturn(new CompletedActivityStateImpl()); final ArchivedUserTaskInstance archivedUserTaskInstance = ModelConvertor.toArchivedUserTaskInstance(sInstance, manager); assertThat(archivedUserTaskInstance.getProcessDefinitionId()).isEqualTo(456789456798L); assertThat(archivedUserTaskInstance.getRootContainerId()).isEqualTo(1L); assertThat(archivedUserTaskInstance.getParentContainerId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getProcessInstanceId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getParentActivityInstanceId()).isEqualTo(456L); } @Test public void getDocument_from_process_instance_and_name_should_return_a_document_with_generated_url_when_it_has_content() {
<<<<<<< builder.addUserTask("step1", "actor") .addData("tData", String.class.getName(), new ExpressionBuilder().createConstantStringExpression("The default value")).isTransient(); processDefinition = deployAndEnableWithActor(builder.done(), "actor", user); ======= builder.addUserTask("step1", "actor").addData("tData", String.class.getName(), new ExpressionBuilder().createConstantStringExpression("The default value")).isTransient(); processDefinition = deployAndEnableProcessWithActor(builder.done(), "actor", user); >>>>>>> builder.addUserTask("step1", "actor") .addData("tData", String.class.getName(), new ExpressionBuilder().createConstantStringExpression("The default value")).isTransient(); processDefinition = deployAndEnableProcessWithActor(builder.done(), "actor", user);
<<<<<<< import org.bonitasoft.engine.bpm.contract.ContractDefinition; import org.bonitasoft.engine.bpm.contract.ContractViolationException; import org.bonitasoft.engine.bpm.contract.Type; import org.bonitasoft.engine.bpm.contract.impl.ContractDefinitionImpl; import org.bonitasoft.engine.bpm.contract.validation.ContractValidator; import org.bonitasoft.engine.bpm.contract.impl.SimpleInputDefinitionImpl; ======= import org.bonitasoft.engine.api.DocumentAPI; import org.bonitasoft.engine.api.impl.transaction.connector.GetConnectorImplementations; import org.bonitasoft.engine.bpm.connector.ConnectorCriterion; import org.bonitasoft.engine.bpm.connector.ConnectorImplementationDescriptor; >>>>>>> import org.bonitasoft.engine.bpm.contract.ContractDefinition; import org.bonitasoft.engine.bpm.contract.ContractViolationException; import org.bonitasoft.engine.bpm.contract.Type; import org.bonitasoft.engine.bpm.contract.impl.ContractDefinitionImpl; import org.bonitasoft.engine.bpm.contract.validation.ContractValidator; import org.bonitasoft.engine.bpm.contract.impl.SimpleInputDefinitionImpl; import org.bonitasoft.engine.api.DocumentAPI; import org.bonitasoft.engine.api.impl.transaction.connector.GetConnectorImplementations; import org.bonitasoft.engine.bpm.connector.ConnectorCriterion; import org.bonitasoft.engine.bpm.connector.ConnectorImplementationDescriptor; <<<<<<< import org.bonitasoft.engine.bpm.flownode.FlowNodeExecutionException; import org.bonitasoft.engine.bpm.flownode.UserTaskNotFoundException; ======= import org.bonitasoft.engine.bpm.flownode.HumanTaskInstance; import org.bonitasoft.engine.bpm.flownode.TimerEventTriggerInstanceNotFoundException; import org.bonitasoft.engine.bpm.flownode.ActivityInstanceCriterion; import org.bonitasoft.engine.bpm.flownode.ArchivedActivityInstance; import org.bonitasoft.engine.bpm.process.ArchivedProcessInstance; >>>>>>> import org.bonitasoft.engine.bpm.flownode.HumanTaskInstance; import org.bonitasoft.engine.bpm.flownode.TimerEventTriggerInstanceNotFoundException; import org.bonitasoft.engine.bpm.flownode.ActivityInstanceCriterion; import org.bonitasoft.engine.bpm.flownode.ArchivedActivityInstance; import org.bonitasoft.engine.bpm.process.ArchivedProcessInstance; import org.bonitasoft.engine.bpm.flownode.FlowNodeExecutionException; import org.bonitasoft.engine.bpm.flownode.UserTaskNotFoundException; <<<<<<< import org.bonitasoft.engine.commons.exceptions.SBonitaException; import org.bonitasoft.engine.commons.transaction.TransactionExecutor; ======= import org.bonitasoft.engine.core.connector.ConnectorService; import org.bonitasoft.engine.core.connector.exception.SConnectorException; import org.bonitasoft.engine.core.connector.parser.JarDependencies; import org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor; >>>>>>> import org.bonitasoft.engine.core.connector.ConnectorService; import org.bonitasoft.engine.core.connector.exception.SConnectorException; import org.bonitasoft.engine.core.connector.parser.JarDependencies; import org.bonitasoft.engine.core.connector.parser.SConnectorImplementationDescriptor; import org.bonitasoft.engine.commons.exceptions.SBonitaException; import org.bonitasoft.engine.commons.transaction.TransactionExecutor; <<<<<<< import org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityInstanceNotFoundException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityReadException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SFlowNodeNotFoundException; ======= import org.bonitasoft.engine.core.process.instance.api.ProcessInstanceService; import org.bonitasoft.engine.core.process.instance.api.event.EventInstanceService; import org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceHierarchicalDeletionException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceModificationException; >>>>>>> import org.bonitasoft.engine.core.process.instance.api.ProcessInstanceService; import org.bonitasoft.engine.core.process.instance.api.event.EventInstanceService; import org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceHierarchicalDeletionException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SProcessInstanceModificationException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityInstanceNotFoundException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SActivityReadException; import org.bonitasoft.engine.core.process.instance.api.exceptions.SFlowNodeNotFoundException; <<<<<<< import org.bonitasoft.engine.core.process.instance.model.SUserTaskInstance; ======= import org.bonitasoft.engine.core.process.instance.model.archive.SAProcessInstance; import org.bonitasoft.engine.core.process.instance.model.event.trigger.STimerEventTriggerInstance; >>>>>>> import org.bonitasoft.engine.core.process.instance.model.archive.SAProcessInstance; import org.bonitasoft.engine.core.process.instance.model.event.trigger.STimerEventTriggerInstance; import org.bonitasoft.engine.core.process.instance.model.SUserTaskInstance;
<<<<<<< designProcessDefinition.addAutomaticTask("step2").addOperation(OperationBuilder.setDocument("textFile").with(groovyThatCreateDocumentContent).done()); designProcessDefinition.addUserTask("step3", actorName); ======= designProcessDefinition.addAutomaticTask("step2").addOperation( new OperationBuilder().createNewInstance().setRightOperand(groovyThatCreateDocumentContent).setType(OperatorType.DOCUMENT_CREATE_UPDATE) .setLeftOperand("textFile", false).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); >>>>>>> designProcessDefinition.addAutomaticTask("step2").addOperation(OperationBuilder.setDocument("textFile").with(groovyThatCreateDocumentContent).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); <<<<<<< designProcessDefinition.addAutomaticTask("step2").addOperation(OperationBuilder.setDocument("textFile").with(groovyThatReturnNull).done()); designProcessDefinition.addUserTask("step3", actorName); ======= designProcessDefinition.addAutomaticTask("step2").addOperation( new OperationBuilder().createNewInstance().setRightOperand(groovyThatReturnNull).setType(OperatorType.DOCUMENT_CREATE_UPDATE) .setLeftOperand("textFile", false).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); >>>>>>> designProcessDefinition.addAutomaticTask("step2").addOperation(OperationBuilder.setDocument("textFile").with(groovyThatReturnNull).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); <<<<<<< OperationBuilder.setDocument("textFile").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")).done()); designProcessDefinition.addUserTask("step3", actorName); ======= new OperationBuilder().createNewInstance().setRightOperand(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")) .setType(OperatorType.DOCUMENT_CREATE_UPDATE).setLeftOperand("textFile", false).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); >>>>>>> OperationBuilder.setDocument("textFile").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")).done()); designProcessDefinition.addUserTask("step3", ACTOR_NAME); <<<<<<< final String actorName = "doctor"; designProcessDefinition.addActor(actorName).addDescription("The doc'"); UserTaskDefinitionBuilder userTaskBuilder = designProcessDefinition.addUserTask("step1", actorName); userTaskBuilder.addOperation(OperationBuilder.setDocument("textFile2").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")) .done()); userTaskBuilder = designProcessDefinition.addUserTask("step2", actorName); userTaskBuilder.addOperation(OperationBuilder.setDocument("textFile4").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")) .done()); ======= designProcessDefinition.addActor(ACTOR_NAME).addDescription("The doc'"); UserTaskDefinitionBuilder userTaskBuilder = designProcessDefinition.addUserTask("step1", ACTOR_NAME); userTaskBuilder.addOperation(new OperationBuilder().createNewInstance() .setRightOperand(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")).setType(OperatorType.DOCUMENT_CREATE_UPDATE) .setLeftOperand("textFile2", false).done()); userTaskBuilder = designProcessDefinition.addUserTask("step2", ACTOR_NAME); userTaskBuilder.addOperation(new OperationBuilder().createNewInstance() .setRightOperand(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")).setType(OperatorType.DOCUMENT_CREATE_UPDATE) .setLeftOperand("textFile4", false).done()); >>>>>>> designProcessDefinition.addActor(ACTOR_NAME).addDescription("The doc'"); UserTaskDefinitionBuilder userTaskBuilder = designProcessDefinition.addUserTask("step1", ACTOR_NAME); userTaskBuilder.addOperation(OperationBuilder.setDocument("textFile2").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")) .done()); userTaskBuilder = designProcessDefinition.addUserTask("step2", ACTOR_NAME); userTaskBuilder.addOperation(OperationBuilder.setDocument("textFile4").with(getDocumentValueExpressionWithUrl("http://www.example.com/new_url.txt")) .done()); <<<<<<< builder.addActor(ACTOR); builder.addUserTask("step1", ACTOR).addOperation( OperationBuilder.setDocument("caseDocument").with(expressionBuilder.createGroovyScriptExpression("addDocVersion", ======= builder.addActor(ACTOR_NAME); builder.addUserTask("step1", ACTOR_NAME).addOperation( new LeftOperandBuilder().createNewInstance("caseDocument").done(), OperatorType.DOCUMENT_CREATE_UPDATE, "=", null, expressionBuilder.createGroovyScriptExpression("addDocVersion", >>>>>>> builder.addActor(ACTOR_NAME); builder.addUserTask("step1", ACTOR_NAME).addOperation( OperationBuilder.setDocument("caseDocument").with(expressionBuilder.createGroovyScriptExpression("addDocVersion", <<<<<<< expressionBuilder.createDataExpression("url", String.class.getName()))).done()); builder.addUserTask("step2", ACTOR).addTransition("step1", "step2"); final ProcessDefinition docDefinition = deployAndEnableWithActor(builder.done(), ACTOR, user); ======= expressionBuilder.createDataExpression("url", String.class.getName()))); builder.addUserTask("step2", ACTOR_NAME).addTransition("step1", "step2"); final ProcessDefinition docDefinition = deployAndEnableWithActor(builder.done(), ACTOR_NAME, user); >>>>>>> expressionBuilder.createDataExpression("url", String.class.getName()))).done()); builder.addUserTask("step2", ACTOR_NAME).addTransition("step1", "step2"); final ProcessDefinition docDefinition = deployAndEnableWithActor(builder.done(), ACTOR_NAME, user);
<<<<<<< ======= private final TransactionExecutor transactionExecutor; private long callerId = -1; private long subProcessId = -1; private long targetSFlowNodeDefinitionId = -1; private Long idOfTheProcessToInterrupt; private SFlowNodeInstance subProcflowNodeInstance; >>>>>>> private long callerId = -1; private long subProcessId = -1; private long targetSFlowNodeDefinitionId = -1; private Long idOfTheProcessToInterrupt; private SFlowNodeInstance subProcflowNodeInstance; <<<<<<< @Override protected String getDescription() { return getClass().getSimpleName() + ": Process of type " + processDefinition.getName() + " (" + processDefinition.getVersion() + ")" + ((subProcflowNodeInstance != null) ? ", subProcflowNodeInstanceId:" + subProcflowNodeInstance.getId() : ""); } ======= public void setTargetSFlowNodeDefinitionId(long targetSFlowNodeDefinitionId) { this.targetSFlowNodeDefinitionId = targetSFlowNodeDefinitionId; } >>>>>>> @Override protected String getDescription() { return getClass().getSimpleName() + ": Process of type " + processDefinition.getName() + " (" + processDefinition.getVersion() + ")" + ((subProcflowNodeInstance != null) ? ", subProcflowNodeInstanceId:" + subProcflowNodeInstance.getId() : ""); } public void setTargetSFlowNodeDefinitionId(long targetSFlowNodeDefinitionId) { this.targetSFlowNodeDefinitionId = targetSFlowNodeDefinitionId; }
<<<<<<< ======= private final class MatchLeftOperandName extends BaseMatcher<SLeftOperand> { private final String name; public MatchLeftOperandName(final String name) { this.name = name; } @Override public boolean matches(final Object item) { return item instanceof SLeftOperand && name.equals(((SLeftOperand) item).getName()); } @Override public void describeTo(final Description description) { } } private final class MatchOperationType extends BaseMatcher<SOperation> { private final SOperatorType type; public MatchOperationType(final SOperatorType type) { this.type = type; } @Override public boolean matches(final Object item) { return item instanceof SOperation && type.equals(((SOperation) item).getType()); } @Override public void describeTo(final Description description) { } } >>>>>>> <<<<<<< operations.add(buildOperation(TYPE_1, "data2", ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data3", ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data4", ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data5", ASSIGNMENT)); ======= operations.add(buildOperation(TYPE_1, "data2", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data3", SOperatorType.JAVA_METHOD)); operations.add(buildOperation(TYPE_2, "data4", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data5", SOperatorType.DELETION)); final HashMap<String, Object> inputValues = new HashMap<>(); final SExpressionContext expressionContext = new SExpressionContext(123l, "containerType", 987L, inputValues); //when operationServiceImpl.retrieveLeftOperandsAndPutItInExpressionContextIfNotIn(operations, 123l/* data container */, "containerType", expressionContext); //then verify(leftOperandHandler1, times(1)).loadLeftOperandInContext(leftOperandCaptor1.capture(), anyLong(), anyString(), eq(expressionContext)); final List<SLeftOperand> value1 = leftOperandCaptor1.getValue(); assertThat(value1).extracting("name").containsOnly("data1", "data2"); verify(leftOperandHandler2, times(1)).loadLeftOperandInContext(leftOperandCaptor2.capture(), anyLong(), anyString(), eq(expressionContext)); final List<SLeftOperand> value2 = leftOperandCaptor2.getValue(); assertThat(value2).extracting("name").containsOnly("data3", "data4", "data5"); } @Test public void should_not_load_assignment_operations() throws SOperationExecutionException, SBonitaReadException { //given final List<SOperation> operations = new ArrayList<>(); operations.add(buildOperation(TYPE_1, "data1", SOperatorType.JAVA_METHOD)); operations.add(buildOperation(TYPE_1, "data2", SOperatorType.ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data3", SOperatorType.JAVA_METHOD)); operations.add(buildOperation(TYPE_2, "data4", SOperatorType.ASSIGNMENT)); operations.add(buildOperation(TYPE_3, "data5", SOperatorType.ASSIGNMENT)); >>>>>>> operations.add(buildOperation(TYPE_1, "data2", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data3", SOperatorType.JAVA_METHOD)); operations.add(buildOperation(TYPE_2, "data4", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data5", SOperatorType.DELETION)); final HashMap<String, Object> inputValues = new HashMap<>(); final SExpressionContext expressionContext = new SExpressionContext(123l, "containerType", 987L, inputValues); //when operationServiceImpl.retrieveLeftOperandsAndPutItInExpressionContextIfNotIn(operations, 123l/* data container */, "containerType", expressionContext); //then verify(leftOperandHandler1, times(1)).loadLeftOperandInContext(leftOperandCaptor1.capture(), anyLong(), anyString(), eq(expressionContext)); final List<SLeftOperand> value1 = leftOperandCaptor1.getValue(); assertThat(value1).extracting("name").containsOnly("data1", "data2"); verify(leftOperandHandler2, times(1)).loadLeftOperandInContext(leftOperandCaptor2.capture(), anyLong(), anyString(), eq(expressionContext)); final List<SLeftOperand> value2 = leftOperandCaptor2.getValue(); assertThat(value2).extracting("name").containsOnly("data3", "data4", "data5"); } @Test public void should_not_load_assignment_operations() throws SOperationExecutionException, SBonitaReadException { //given final List<SOperation> operations = new ArrayList<>(); operations.add(buildOperation(TYPE_1, "data1", JAVA_METHOD)); operations.add(buildOperation(TYPE_1, "data2", ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data3", JAVA_METHOD)); operations.add(buildOperation(TYPE_2, "data4", ASSIGNMENT)); operations.add(buildOperation(TYPE_2, "data5", ASSIGNMENT)); <<<<<<< operations.add(buildOperation(TYPE_1, "data2", ASSIGNMENT)); ======= operations.add(buildOperation(TYPE_1, "data1", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data2", SOperatorType.JAVA_METHOD)); >>>>>>> operations.add(buildOperation(TYPE_1, "data1", SOperatorType.XPATH_UPDATE_QUERY)); operations.add(buildOperation(TYPE_2, "data2", SOperatorType.JAVA_METHOD)); <<<<<<< final Map<SLeftOperand, LeftOperandUpdateStatus> leftOperands = Collections.<SLeftOperand, LeftOperandUpdateStatus> singletonMap( buildLeftOperand("type1", "data1"), new LeftOperandUpdateStatus(ASSIGNMENT)); ======= final Map<SLeftOperand, LeftOperandUpdateStatus> leftOperands = Collections.<SLeftOperand, LeftOperandUpdateStatus>singletonMap( buildLeftOperand("type1", "data1"), new LeftOperandUpdateStatus(SOperatorType.ASSIGNMENT)); >>>>>>> final Map<SLeftOperand, LeftOperandUpdateStatus> leftOperands = Collections.<SLeftOperand, LeftOperandUpdateStatus>singletonMap( buildLeftOperand("type1", "data1"), new LeftOperandUpdateStatus(ASSIGNMENT));
<<<<<<< SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(activityInstanceId); SDataInstance data; final long parentProcessInstanceId = flowNodeInstance.getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader("process", parentProcessInstanceId); ======= final long parentProcessInstanceId = activityInstanceService.getFlowNodeInstance(activityInstanceId).getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader(ScopeType.PROCESS.name(), parentProcessInstanceId); >>>>>>> SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(activityInstanceId); SDataInstance data; final long parentProcessInstanceId = flowNodeInstance.getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader(ScopeType.PROCESS.name(), parentProcessInstanceId); <<<<<<< SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(activityInstanceId); final long parentProcessInstanceId = flowNodeInstance.getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader("process", parentProcessInstanceId); ======= final long parentProcessInstanceId = activityInstanceService.getFlowNodeInstance(activityInstanceId).getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader(ScopeType.PROCESS.name(), parentProcessInstanceId); >>>>>>> SFlowNodeInstance flowNodeInstance = activityInstanceService.getFlowNodeInstance(activityInstanceId); final long parentProcessInstanceId = flowNodeInstance.getLogicalGroup(processDefinitionIndex); final ClassLoader processClassLoader = classLoaderService.getLocalClassLoader(ScopeType.PROCESS.name(), parentProcessInstanceId); <<<<<<< for (Operation operation : operations) { String name = operation.getLeftOperand().getName(); if (transientDataNames.contains(name)) { final SOperation sOperation = ServerModelConvertor.convertOperation(operation); final SExpressionContext sExpressionContext = new SExpressionContext(activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), activityInstance.getLogicalGroup(processDefinitionIndex)); sExpressionContext.setSerializableInputValues(expressionContexts); operationService.execute(sOperation, activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), sExpressionContext); } else { // same order between dataInstances and dataNames SDataInstance dataInstance = dataInstances.get(dataNames.indexOf(name)); final SOperation sOperation = ServerModelConvertor.convertOperation(operation); final SExpressionContext sExpressionContext = new SExpressionContext(activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), activityInstance.getLogicalGroup(processDefinitionIndex)); sExpressionContext.setSerializableInputValues(expressionContexts); operationService.execute(sOperation, dataInstance.getContainerId(), dataInstance.getContainerType(), sExpressionContext); } ======= final SActivityInstance activityInstance = activityInstanceService.getActivityInstance(activityInstanceId); for (int i = 0; i < dataInstances.size(); i++) { // data instances and operation are in the same order final SDataInstance dataInstance = dataInstances.get(i); final Operation operation = operations.get(i); final SOperation sOperation = ModelConvertor.toSOperation(operation); final SExpressionContext sExpressionContext = new SExpressionContext(activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), activityInstance.getLogicalGroup(processDefinitionIndex)); sExpressionContext.setSerializableInputValues(expressionContexts); operationService.execute(sOperation, dataInstance.getContainerId(), dataInstance.getContainerType(), sExpressionContext); >>>>>>> for (Operation operation : operations) { String name = operation.getLeftOperand().getName(); if (transientDataNames.contains(name)) { final SOperation sOperation = ServerModelConvertor.convertOperation(operation); final SExpressionContext sExpressionContext = new SExpressionContext(activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), activityInstance.getLogicalGroup(processDefinitionIndex)); sExpressionContext.setSerializableInputValues(expressionContexts); operationService.execute(sOperation, activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), sExpressionContext); } else { // same order between dataInstances and dataNames SDataInstance dataInstance = dataInstances.get(dataNames.indexOf(name)); final SOperation sOperation = ServerModelConvertor.convertOperation(operation); final SExpressionContext sExpressionContext = new SExpressionContext(activityInstanceId, DataInstanceContainer.ACTIVITY_INSTANCE.toString(), activityInstance.getLogicalGroup(processDefinitionIndex)); sExpressionContext.setSerializableInputValues(expressionContexts); operationService.execute(sOperation, dataInstance.getContainerId(), dataInstance.getContainerType(), sExpressionContext); } <<<<<<< final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ProcessDefinitionService processDefinitionService = tenantAccessor.getProcessDefinitionService(); final ProcessExecutor processExecutor = tenantAccessor.getProcessExecutor(); final long starterId; final long userIdFromSession = getUserId(); if (userId == 0) { starterId = userIdFromSession; } else { starterId = userId; } // Retrieval of the process definition: final SProcessDefinition sProcessDefinition; try { final SProcessDefinitionDeployInfo deployInfo = processDefinitionService.getProcessDeploymentInfo(processDefinitionId); if (ActivationState.DISABLED.name().equals(deployInfo.getActivationState())) { throw new ProcessActivationException("Process disabled"); } sProcessDefinition = processDefinitionService.getProcessDefinition(processDefinitionId); } catch (final SProcessDefinitionNotFoundException e) { throw new ProcessDefinitionNotFoundException(e); } catch (final SBonitaException e) { throw new RetrieveException(e); } final SProcessInstance startedInstance; try { final List<SOperation> sOperations = ServerModelConvertor.convertOperations(operations); Map<String, Object> operationContext; if (context != null) { operationContext = new HashMap<String, Object>(context); } else { operationContext = Collections.emptyMap(); } startedInstance = processExecutor.start(sProcessDefinition, starterId, userIdFromSession, sOperations, operationContext, null); } catch (final SBonitaException e) { throw new ProcessExecutionException(e); }// FIXME in case process instance creation exception -> put it in failed final ProcessInstance processInstance = ModelConvertor.toProcessInstance(sProcessDefinition, startedInstance); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); if (logger.isLoggable(this.getClass(), TechnicalLogSeverity.INFO)) { final StringBuilder stb = new StringBuilder(); stb.append("The user <"); stb.append(SessionInfos.getUserNameFromSession()); if (starterId != userIdFromSession) { stb.append(">acting as delegate of user with id <"); stb.append(starterId); } stb.append("> has started instance <"); stb.append(processInstance.getId()); stb.append("> of process <"); stb.append(sProcessDefinition.getName()); stb.append("> in version <"); stb.append(sProcessDefinition.getVersion()); stb.append("> and id <"); stb.append(sProcessDefinition.getId()); stb.append(">"); logger.log(this.getClass(), TechnicalLogSeverity.INFO, stb.toString()); } return processInstance; } ======= ProcessStarter starter = new ProcessStarter(userId, processDefinitionId, operations, context); return starter.start(); } >>>>>>> ProcessStarter starter = new ProcessStarter(userId, processDefinitionId, operations, context); return starter.start(); }
<<<<<<< ======= * @author Celine Souchet * >>>>>>> * @author Celine Souchet
<<<<<<< import org.bonitasoft.engine.commons.exceptions.SBonitaException; ======= >>>>>>> import org.bonitasoft.engine.commons.exceptions.SBonitaException; <<<<<<< import com.bonitasoft.manager.Features; /** * @author Celine Souchet */ public class IdentityAPIExt extends IdentityAPIImpl implements IdentityAPI { @Override protected TenantServiceAccessor getTenantAccessor() { try { final SessionAccessor sessionAccessor = ServiceAccessorFactory.getInstance().createSessionAccessor(); final long tenantId = sessionAccessor.getTenantId(); return TenantServiceSingleton.getInstance(tenantId); } catch (final Exception e) { throw new BonitaRuntimeException(e); } } @Override public String exportOrganization() throws OrganizationExportException { LicenseChecker.getInstance().checkLicenceAndFeature(Features.WEB_ORGANIZATION_EXCHANGE); final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ExportOrganization exportOrganization = new ExportOrganization(tenantAccessor.getXMLWriter(), tenantAccessor.getIdentityService()); try { exportOrganization.execute(); return exportOrganization.getResult(); } catch (final SBonitaException e) { throw new OrganizationExportException(e); } } } ======= /** * @author Celine Souchet * @author Matthieu Chaffotte */ public class IdentityAPIExt extends IdentityAPIImpl implements IdentityAPI { // In order to not have an API break, this interface is still present even if it has no methods. @Override protected TenantServiceAccessor getTenantAccessor() { try { final SessionAccessor sessionAccessor = ServiceAccessorFactory.getInstance().createSessionAccessor(); final long tenantId = sessionAccessor.getTenantId(); return TenantServiceSingleton.getInstance(tenantId); } catch (final Exception e) { throw new BonitaRuntimeException(e); } } } >>>>>>> import com.bonitasoft.manager.Features; /** * @author Celine Souchet * @author Matthieu Chaffotte */ public class IdentityAPIExt extends IdentityAPIImpl implements IdentityAPI { // In order to not have an API break, this interface is still present even if it has no methods. @Override protected TenantServiceAccessor getTenantAccessor() { try { final SessionAccessor sessionAccessor = ServiceAccessorFactory.getInstance().createSessionAccessor(); final long tenantId = sessionAccessor.getTenantId(); return TenantServiceSingleton.getInstance(tenantId); } catch (final Exception e) { throw new BonitaRuntimeException(e); } } @Override public String exportOrganization() throws OrganizationExportException { LicenseChecker.getInstance().checkLicenceAndFeature(Features.WEB_ORGANIZATION_EXCHANGE); final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final ExportOrganization exportOrganization = new ExportOrganization(tenantAccessor.getXMLWriter(), tenantAccessor.getIdentityService()); try { exportOrganization.execute(); return exportOrganization.getResult(); } catch (final SBonitaException e) { throw new OrganizationExportException(e); } } }
<<<<<<< public void pauseShouldStopWorkservice() throws WorkRegisterException, WorkException { ======= public void pauseShouldStopWorkservice() throws TimeoutException, SBonitaException { >>>>>>> public void pauseShouldStopWorkservice() throws SBonitaException { <<<<<<< public void should_pause_shutdown_ThreadPool_and_clear_queue() throws WorkRegisterException, InterruptedException, WorkException { final InOrder inOrder = inOrder(executorService, workService, queue); ======= public void should_pause_shutdown_ThreadPool_and_clear_queue() throws InterruptedException, TimeoutException, SBonitaException { InOrder inOrder = inOrder(executorService, workService, queue); >>>>>>> public void should_pause_shutdown_ThreadPool_and_clear_queue() throws InterruptedException, SBonitaException { InOrder inOrder = inOrder(executorService, workService, queue); <<<<<<< public void should_stop_shutdown_ThreadPool_and_clear_queue() throws WorkRegisterException, InterruptedException, WorkException { final InOrder inOrder = inOrder(executorService, workService, queue); ======= public void should_stop_shutdown_ThreadPool_and_clear_queue() throws InterruptedException { InOrder inOrder = inOrder(executorService, workService, queue); >>>>>>> public void should_stop_shutdown_ThreadPool_and_clear_queue() throws InterruptedException { InOrder inOrder = inOrder(executorService, workService, queue); <<<<<<< public void pauseShouldNotAllowToRegisterWork() throws WorkRegisterException, WorkException { ======= public void pauseShouldNotAllowToRegisterWork() throws TimeoutException, SBonitaException { >>>>>>> public void pauseShouldNotAllowToRegisterWork() throws SBonitaException { <<<<<<< public void pauseShouldNotAllowToExecuteWork() throws WorkRegisterException, WorkException { ======= public void pauseShouldNotAllowToExecuteWork() throws TimeoutException, SBonitaException { >>>>>>> public void pauseShouldNotAllowToExecuteWork() throws SBonitaException { <<<<<<< public void resumeShouldDeactivateWorkservice() throws WorkRegisterException, WorkException { ======= public void resumeShouldDeactivateWorkservice() throws TimeoutException, SBonitaException { >>>>>>> public void resumeShouldDeactivateWorkservice() throws SBonitaException { <<<<<<< public void resumeShouldAllowToRegisterWork() throws WorkRegisterException, WorkException { ======= public void resumeShouldAllowToRegisterWork() throws TimeoutException, SBonitaException { >>>>>>> public void resumeShouldAllowToRegisterWork() throws SBonitaException { <<<<<<< public void resumeShouldAllowToExecuteWork() throws WorkRegisterException, WorkException { ======= public void resumeShouldAllowToExecuteWork() throws TimeoutException, SBonitaException { >>>>>>> public void resumeShouldAllowToExecuteWork() throws SBonitaException { <<<<<<< public void checkStopStatus() throws WorkException { ======= public void checkStopStatus() { >>>>>>> public void checkStopStatus() throws SWorkException { <<<<<<< public void should_start_do_nothing_when_already_started() throws WorkException { ======= public void should_start_do_nothing_when_already_started() { >>>>>>> public void should_start_do_nothing_when_already_started() throws SWorkException { <<<<<<< public void should_stop_do_nothing_when_already_stopped() throws WorkException { ======= public void should_stop_do_nothing_when_already_stopped() { >>>>>>> public void should_stop_do_nothing_when_already_stopped() throws SWorkException { <<<<<<< public void should_isStopped_return_true_when_only_executor_is_shutdown() throws WorkException { ======= public void should_isStopped_return_true_when_only_executor_is_shutdown() { >>>>>>> public void should_isStopped_return_true_when_only_executor_is_shutdown() throws SWorkException { <<<<<<< @Test(expected = WorkException.class) public void should_pause_throw_exception_on_timeout() throws WorkException, InterruptedException { ======= @Test(expected = TimeoutException.class) public void should_pause_throw_exception_on_timeout() throws TimeoutException, InterruptedException, SBonitaException { >>>>>>> @Test(expected = SWorkException.class) public void should_pause_throw_exception_on_timeout() throws SWorkException, InterruptedException { <<<<<<< public void should_stop_do_not_throw_exception_on_timeout() throws WorkException, InterruptedException { ======= public void should_stop_do_not_throw_exception_on_timeout() throws InterruptedException { >>>>>>> public void should_stop_do_not_throw_exception_on_timeout() throws SWorkException, InterruptedException { <<<<<<< @Test(expected = WorkException.class) public void should_pause_throw_exception_on_interrupted() throws WorkException, InterruptedException { ======= @Test(expected = SWorkException.class) public void should_pause_throw_exception_on_interrupted() throws TimeoutException, InterruptedException, SBonitaException { >>>>>>> @Test(expected = SWorkException.class) public void should_pause_throw_exception_on_interrupted() throws InterruptedException, SBonitaException { <<<<<<< public void should_stop_do_not_throw_exception_on_interrupted() throws WorkException, InterruptedException { ======= public void should_stop_do_not_throw_exception_on_interrupted() throws InterruptedException { >>>>>>> public void should_stop_do_not_throw_exception_on_interrupted() throws SWorkException, InterruptedException {
<<<<<<< import org.bonitasoft.engine.identity.CustomUserInfoValue; ======= import org.bonitasoft.engine.execution.state.CompletedActivityStateImpl; import org.bonitasoft.engine.execution.state.FlowNodeStateManager; >>>>>>> import org.bonitasoft.engine.execution.state.CompletedActivityStateImpl; import org.bonitasoft.engine.execution.state.FlowNodeStateManager; import org.bonitasoft.engine.identity.CustomUserInfoValue; <<<<<<< @Test public void should_convert_server_definition_into_client_definition() { CustomUserInfoDefinitionImpl definition = ModelConvertor.convert( new DummySCustomUserInfoDefinition(1L, "name", "description")); assertThat(definition.getId()).isEqualTo(1L); assertThat(definition.getName()).isEqualTo("name"); assertThat(definition.getDescription()).isEqualTo("description"); } @Test public void should_convert_server_value_into_client_value() { CustomUserInfoValue value = ModelConvertor.convert( new DummySCustomUserInfoValue(2L, 2L, 1L, "value")); assertThat(value.getDefinitionId()).isEqualTo(2L); assertThat(value.getValue()).isEqualTo("value"); assertThat(value.getUserId()).isEqualTo(1L); } @Test public void should_return_null_when_trying_to_convert_a_null_value() { CustomUserInfoValue value = ModelConvertor.convert((SCustomUserInfoValue) null); assertThat(value).isNull(); } ======= @Test public void toArchivedUserTaskInstance_sould_return_the_right_idenfiers() throws Exception { final SAUserTaskInstanceImpl sInstance = new SAUserTaskInstanceImpl(); sInstance.setRootContainerId(1L); sInstance.setParentContainerId(2L); sInstance.setLogicalGroup(0, 456789456798L); sInstance.setLogicalGroup(1, 1L); sInstance.setLogicalGroup(2, 456L); sInstance.setLogicalGroup(3, 2L); sInstance.setStateId(5); sInstance.setPriority(STaskPriority.NORMAL); when(manager.getState(5)).thenReturn(new CompletedActivityStateImpl()); final ArchivedUserTaskInstance archivedUserTaskInstance = ModelConvertor.toArchivedUserTaskInstance(sInstance, manager); assertThat(archivedUserTaskInstance.getProcessDefinitionId()).isEqualTo(456789456798L); assertThat(archivedUserTaskInstance.getRootContainerId()).isEqualTo(1L); assertThat(archivedUserTaskInstance.getParentContainerId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getProcessInstanceId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getParentActivityInstanceId()).isEqualTo(456L); } >>>>>>> @Test public void toArchivedUserTaskInstance_sould_return_the_right_idenfiers() throws Exception { final SAUserTaskInstanceImpl sInstance = new SAUserTaskInstanceImpl(); sInstance.setRootContainerId(1L); sInstance.setParentContainerId(2L); sInstance.setLogicalGroup(0, 456789456798L); sInstance.setLogicalGroup(1, 1L); sInstance.setLogicalGroup(2, 456L); sInstance.setLogicalGroup(3, 2L); sInstance.setStateId(5); sInstance.setPriority(STaskPriority.NORMAL); when(manager.getState(5)).thenReturn(new CompletedActivityStateImpl()); final ArchivedUserTaskInstance archivedUserTaskInstance = ModelConvertor.toArchivedUserTaskInstance(sInstance, manager); assertThat(archivedUserTaskInstance.getProcessDefinitionId()).isEqualTo(456789456798L); assertThat(archivedUserTaskInstance.getRootContainerId()).isEqualTo(1L); assertThat(archivedUserTaskInstance.getParentContainerId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getProcessInstanceId()).isEqualTo(2L); assertThat(archivedUserTaskInstance.getParentActivityInstanceId()).isEqualTo(456L); } @Test public void should_convert_server_definition_into_client_definition() { CustomUserInfoDefinitionImpl definition = ModelConvertor.convert( new DummySCustomUserInfoDefinition(1L, "name", "description")); assertThat(definition.getId()).isEqualTo(1L); assertThat(definition.getName()).isEqualTo("name"); assertThat(definition.getDescription()).isEqualTo("description"); } @Test public void should_convert_server_value_into_client_value() { CustomUserInfoValue value = ModelConvertor.convert( new DummySCustomUserInfoValue(2L, 2L, 1L, "value")); assertThat(value.getDefinitionId()).isEqualTo(2L); assertThat(value.getValue()).isEqualTo("value"); assertThat(value.getUserId()).isEqualTo(1L); } @Test public void should_return_null_when_trying_to_convert_a_null_value() { CustomUserInfoValue value = ModelConvertor.convert((SCustomUserInfoValue) null); assertThat(value).isNull(); }
<<<<<<< import org.bonitasoft.engine.activity.CallActivityTest; import org.bonitasoft.engine.activity.LoopTest; import org.bonitasoft.engine.activity.MultiInstanceTest; import org.bonitasoft.engine.activity.UserTaskContractITest; import org.bonitasoft.engine.command.AdvancedStartProcessCommandIT; import org.bonitasoft.engine.command.CommandTest; import org.bonitasoft.engine.command.web.ExternalCommandsTest; import org.bonitasoft.engine.connectors.RemoteConnectorExecutionTest; ======= import org.bonitasoft.engine.activity.TaskTests; import org.bonitasoft.engine.command.CommandsTests; import org.bonitasoft.engine.connectors.RemoteConnectorExecutionIT; >>>>>>> import org.bonitasoft.engine.activity.CallActivityTest; import org.bonitasoft.engine.activity.LoopTest; import org.bonitasoft.engine.activity.MultiInstanceTest; import org.bonitasoft.engine.activity.UserTaskContractITest; import org.bonitasoft.engine.command.AdvancedStartProcessCommandIT; import org.bonitasoft.engine.command.CommandTest; import org.bonitasoft.engine.command.web.ExternalCommandsTest; import org.bonitasoft.engine.connectors.RemoteConnectorExecutionTest; import org.bonitasoft.engine.activity.TaskTests; import org.bonitasoft.engine.command.CommandsTests; import org.bonitasoft.engine.connectors.RemoteConnectorExecutionIT; <<<<<<< OperationTest.class, ManualTasksTest.class, CallActivityTest.class, LoopTest.class, MultiInstanceTest.class, UserTaskContractITest.class, ======= OperationIT.class, TaskTests.class, >>>>>>> OperationIT.class, TaskTests.class,
<<<<<<< import org.bonitasoft.engine.core.process.instance.api.RefBusinessDataService; import org.bonitasoft.engine.core.process.instance.api.TokenService; ======= >>>>>>> import org.bonitasoft.engine.core.process.instance.api.RefBusinessDataService;
<<<<<<< import static org.junit.Assert.assertEquals; ======= import static org.assertj.core.api.Assertions.assertThat; >>>>>>> import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; <<<<<<< import org.bonitasoft.engine.events.model.FireEventException; ======= import org.bonitasoft.engine.events.model.SEvent; >>>>>>> import org.bonitasoft.engine.events.model.FireEventException; import org.bonitasoft.engine.events.model.SEvent; <<<<<<< import org.bonitasoft.engine.scheduler.ServicesResolver; import org.bonitasoft.engine.scheduler.StatelessJob; ======= >>>>>>> import org.bonitasoft.engine.scheduler.ServicesResolver; import org.bonitasoft.engine.scheduler.StatelessJob; <<<<<<< SchedulerServiceImpl schedulerService; ======= private SchedulerServiceImpl schedulerService; @Mock private SchedulerExecutor schedulerExecutor; >>>>>>> SchedulerServiceImpl schedulerService; @Mock private SchedulerExecutor schedulerExecutor; <<<<<<< schedulerExecutor = mock(SchedulerExecutor.class); jobService = mock(JobService.class); ======= initMocks(this); >>>>>>> initMocks(this);
<<<<<<< @Override public ProcessConfigurationAPI getProcessConfigurationAPIi() { return new ProcessConfigurationAPIImpl(); } ======= @Override public BusinessDataAPI getBusinessDataAPI() { return new BusinessDataAPIImpl(); } >>>>>>> @Override public ProcessConfigurationAPI getProcessConfigurationAPIi() { return new ProcessConfigurationAPIImpl(); } @Override public BusinessDataAPI getBusinessDataAPI() { return new BusinessDataAPIImpl(); }
<<<<<<< import org.bonitasoft.engine.api.impl.transaction.data.GetNumberOfDataInstanceForContainer; import org.bonitasoft.engine.api.impl.transaction.document.*; ======= import org.bonitasoft.engine.api.impl.transaction.document.AttachDocumentVersion; import org.bonitasoft.engine.api.impl.transaction.document.AttachDocumentVersionAndStoreContent; import org.bonitasoft.engine.api.impl.transaction.document.GetArchivedDocument; import org.bonitasoft.engine.api.impl.transaction.document.GetDocument; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByName; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByNameAtActivityCompletion; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByNameAtProcessInstantiation; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentContent; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentsOfProcessInstance; import org.bonitasoft.engine.api.impl.transaction.document.GetNumberOfDocumentsOfProcessInstance; >>>>>>> import org.bonitasoft.engine.api.impl.transaction.document.AttachDocumentVersion; import org.bonitasoft.engine.api.impl.transaction.document.AttachDocumentVersionAndStoreContent; import org.bonitasoft.engine.api.impl.transaction.document.GetArchivedDocument; import org.bonitasoft.engine.api.impl.transaction.document.GetDocument; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByName; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByNameAtActivityCompletion; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentByNameAtProcessInstantiation; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentContent; import org.bonitasoft.engine.api.impl.transaction.document.GetDocumentsOfProcessInstance; import org.bonitasoft.engine.api.impl.transaction.document.GetNumberOfDocumentsOfProcessInstance; <<<<<<< final long author = SessionInfos.getUserIdFromSession(); ======= final SProcessDocumentBuilders documentBuilders = tenantAccessor.getProcessDocumentBuilders(); final long author = getUserId(); >>>>>>> final long author = getUserId(); <<<<<<< final long authorId = SessionInfos.getUserIdFromSession(); ======= final SProcessDocumentBuilders documentBuilders = tenantAccessor.getProcessDocumentBuilders(); final long authorId = getUserId(); >>>>>>> final long authorId = getUserId(); <<<<<<< final long authorId = SessionInfos.getUserIdFromSession(); ======= final SProcessDocumentBuilders documentBuilders = tenantAccessor.getProcessDocumentBuilders(); final long authorId = getUserId(); >>>>>>> final long authorId = getUserId(); <<<<<<< final long authorId = SessionInfos.getUserIdFromSession(); ======= final SProcessDocumentBuilders documentBuilders = tenantAccessor.getProcessDocumentBuilders(); final long authorId = getUserId(); >>>>>>> final long authorId = getUserId();
<<<<<<< * when the processInstanceId does not refer to an existing process instance * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the identifier does not refer to an existing process instance. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the identifier does not refer to an existing process instance. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the processInstanceId does not refer to an existing process instance * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the identifier does not refer to an existing process instance. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the identifier does not refer to an existing process instance. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the processInstanceId does not refer to an existing process instance * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the identifier does not refer to an existing process instance. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the identifier does not refer to an existing process instance. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< ** when the processInstanceId does not refer to an existing process instance * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= ** If the identifier does not refer to an existing process instance. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> ** If the identifier does not refer to an existing process instance. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the document identifier does not refer to an existing document * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the specified identifier does not refer to an existing document. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the specified identifier does not refer to an existing document. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the document identifier does not refer to an existing document * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the specified identifier does not refer to an existing document. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the specified identifier does not refer to an existing document. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the specified processInstanceId does not refer to an existing process instance * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the identifier does not refer to an existing process instance. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the identifier does not refer to an existing process instance. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the specified documentId does not refer to an existing document * @throws org.bonitasoft.engine.session.InvalidSessionException ======= * If the specified identifier does not refer to an existing document. * @throws InvalidSessionException >>>>>>> * If the specified identifier does not refer to an existing document. * @throws org.bonitasoft.engine.session.InvalidSessionException <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * when the specified documentName does not refer to an existing document attached to the process instance that contains the activity * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * If the specified documentName does not refer to an existing document attached to the process instance that contains the activity. * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * If the specified documentName does not refer to an existing document attached to the process instance that contains the activity. * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. <<<<<<< * @throws org.bonitasoft.engine.session.InvalidSessionException * when the session is not valid ======= * @throws InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired. >>>>>>> * @throws org.bonitasoft.engine.session.InvalidSessionException * Generic exception thrown if API Session is invalid, e.g session has expired.
<<<<<<< @Override public PageService getPageService() { return getInstanceOf(PageService.class); } ======= @Override public RefBusinessDataService getRefBusinessDataService() { return getInstanceOf(RefBusinessDataService.class); } @Override public BusinessDataModelRepository getBusinessDataModelRepository() { return getInstanceOf(BusinessDataModelRepository.class); } >>>>>>> @Override public PageService getPageService() { return getInstanceOf(PageService.class); public RefBusinessDataService getRefBusinessDataService() { return getInstanceOf(RefBusinessDataService.class); } @Override public BusinessDataModelRepository getBusinessDataModelRepository() { return getInstanceOf(BusinessDataModelRepository.class); }
<<<<<<< System.out.println("node started"); logoutPlatform(loginPlatform); ======= APITestUtil.logoutPlatform(loginPlatform); >>>>>>> logoutPlatform(loginPlatform); <<<<<<< "input1", new ExpressionBuilder().createGroovyScriptExpression("script", script, Long.class.getName(), new ExpressionBuilder().createEngineConstant(ExpressionConstants.API_ACCESSOR), ======= CONNECTOR_INPUT_NAME, new ExpressionBuilder().createGroovyScriptExpression("script", script, Long.class.getName(), new ExpressionBuilder().createEngineConstant(ExpressionConstants.API_ACCESSOR), >>>>>>> CONNECTOR_INPUT_NAME, new ExpressionBuilder().createGroovyScriptExpression("script", script, Long.class.getName(), new ExpressionBuilder().createEngineConstant(ExpressionConstants.API_ACCESSOR),
<<<<<<< SessionAccessor beforeInvokeMethod(final Session session, final String apiInterfaceName) throws BonitaHomeNotSetException, InstantiationException, IllegalAccessException, ClassNotFoundException, BonitaHomeConfigurationException, IOException, NoSuchMethodException, InvocationTargetException, SBonitaException { ======= private SessionAccessor beforeInvokeMethod(final Map<String, Serializable> options, final String apiInterfaceName) throws BonitaHomeNotSetException, InstantiationException, IllegalAccessException, ClassNotFoundException, BonitaHomeConfigurationException, IOException, NoSuchMethodException, InvocationTargetException, SBonitaException { >>>>>>> SessionAccessor beforeInvokeMethod(final Session session, final String apiInterfaceName) throws BonitaHomeNotSetException, InstantiationException, IllegalAccessException, ClassNotFoundException, BonitaHomeConfigurationException, IOException, NoSuchMethodException, InvocationTargetException, SBonitaException { <<<<<<< case PLATFORM: serverClassLoader = beforeInvokeMethodForPlatformSession(sessionAccessor, platformServiceAccessor, session); break; case API: serverClassLoader = beforeInvokeMethodForAPISession(sessionAccessor, serviceAccessorFactory, platformServiceAccessor, session); break; default: throw new InvalidSessionException("Unknown session type: " + session.getClass().getName()); ======= case PLATFORM: final PlatformSessionService platformSessionService = platformServiceAccessor.getPlatformSessionService(); final PlatformLoginService loginService = platformServiceAccessor.getPlatformLoginService(); if (!loginService.isValid(session.getId())) { throw new InvalidSessionException("Invalid session"); } platformSessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), -1); serverClassLoader = getPlatformClassLoader(platformServiceAccessor); setTechnicalLogger(platformServiceAccessor.getTechnicalLoggerService()); break; case API: final SessionService sessionService = platformServiceAccessor.getSessionService(); checkTenantSession(platformServiceAccessor, session); sessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), ((APISession) session).getTenantId()); serverClassLoader = getTenantClassLoader(platformServiceAccessor, session); setTechnicalLogger(serviceAccessorFactory.createTenantServiceAccessor(((APISession) session).getTenantId()).getTechnicalLoggerService()); break; default: throw new InvalidSessionException("Unknown session type: " + session.getClass().getName()); >>>>>>> case PLATFORM: serverClassLoader = beforeInvokeMethodForPlatformSession(sessionAccessor, platformServiceAccessor, session); break; case API: serverClassLoader = beforeInvokeMethodForAPISession(sessionAccessor, serviceAccessorFactory, platformServiceAccessor, session); break; default: throw new InvalidSessionException("Unknown session type: " + session.getClass().getName()); <<<<<<< private ClassLoader beforeInvokeMethodForAPISession(final SessionAccessor sessionAccessor, final ServiceAccessorFactory serviceAccessorFactory, final PlatformServiceAccessor platformServiceAccessor, final Session session) throws SSchedulerException, org.bonitasoft.engine.session.SSessionException, SClassLoaderException, SBonitaException, BonitaHomeNotSetException, IOException, BonitaHomeConfigurationException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { ClassLoader serverClassLoader; final SessionService sessionService = platformServiceAccessor.getSessionService(); checkTenantSession(platformServiceAccessor, session); sessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), ((APISession) session).getTenantId()); serverClassLoader = getTenantClassLoader(platformServiceAccessor, session); setTechnicalLogger(serviceAccessorFactory.createTenantServiceAccessor(((APISession) session).getTenantId()).getTechnicalLoggerService()); return serverClassLoader; } private ClassLoader beforeInvokeMethodForPlatformSession(final SessionAccessor sessionAccessor, final PlatformServiceAccessor platformServiceAccessor, final Session session) throws SSessionException, SClassLoaderException { ClassLoader serverClassLoader; final PlatformSessionService platformSessionService = platformServiceAccessor.getPlatformSessionService(); final PlatformLoginService loginService = platformServiceAccessor.getPlatformLoginService(); if (!loginService.isValid(session.getId())) { throw new InvalidSessionException("Invalid session"); } platformSessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), -1); serverClassLoader = getPlatformClassLoader(platformServiceAccessor); setTechnicalLogger(platformServiceAccessor.getTechnicalLoggerService()); return serverClassLoader; } ======= private ServiceAccessorFactory getServiceAccessorFactoryInstance() { return ServiceAccessorFactory.getInstance(); } >>>>>>> private ClassLoader beforeInvokeMethodForAPISession(final SessionAccessor sessionAccessor, final ServiceAccessorFactory serviceAccessorFactory, final PlatformServiceAccessor platformServiceAccessor, final Session session) throws SSchedulerException, org.bonitasoft.engine.session.SSessionException, SClassLoaderException, SBonitaException, BonitaHomeNotSetException, IOException, BonitaHomeConfigurationException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException { final SessionService sessionService = platformServiceAccessor.getSessionService(); checkTenantSession(platformServiceAccessor, session); sessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), ((APISession) session).getTenantId()); final ClassLoader serverClassLoader = getTenantClassLoader(platformServiceAccessor, session); setTechnicalLogger(serviceAccessorFactory.createTenantServiceAccessor(((APISession) session).getTenantId()).getTechnicalLoggerService()); return serverClassLoader; } private ClassLoader beforeInvokeMethodForPlatformSession(final SessionAccessor sessionAccessor, final PlatformServiceAccessor platformServiceAccessor, final Session session) throws SSessionException, SClassLoaderException { final PlatformSessionService platformSessionService = platformServiceAccessor.getPlatformSessionService(); final PlatformLoginService loginService = platformServiceAccessor.getPlatformLoginService(); if (!loginService.isValid(session.getId())) { throw new InvalidSessionException("Invalid session"); } platformSessionService.renewSession(session.getId()); sessionAccessor.setSessionInfo(session.getId(), -1); final ClassLoader serverClassLoader = getPlatformClassLoader(platformServiceAccessor); setTechnicalLogger(platformServiceAccessor.getTechnicalLoggerService()); return serverClassLoader; } <<<<<<< Object invokeAPI(final String apiInterfaceName, final String methodName, final List<String> classNameParameters, final Object[] parametersValues, ======= protected Object invokeAPI(final String apiInterfaceName, final String methodName, final List<String> classNameParameters, final Object[] parametersValues, >>>>>>> Object invokeAPI(final String apiInterfaceName, final String methodName, final List<String> classNameParameters, final Object[] parametersValues,
<<<<<<< * Commands in the <b>BonitaBPM Execution Engine</b> are an extension point that allows to add / call behaviour that is not available by default through * provided APIs. * The PlatformCommandAPI gives access to command registration / unregistration to 'deploy' new commands at platform level. * The commands must be packed in jars and deployed /undeployed in the Engine as dependencies using methods {@link CommandAPI#addDependency(String, byte[])}, * {@link #removeDependency(String)} * ======= * * Manipulate tenant commands. A command can be registered, unregistered, and executed with parameters.<br/> * These command are executed in the platform scope. See {@link CommandAPI} for more explanations of how to deploy, execute and undeploy a command. The only * difference between API and {@link CommandAPI} is that these commands must extend {@link org.bonitasoft.engine.command.PlatformCommand}. * * @see CommandAPI >>>>>>> * Commands in the <b>BonitaBPM Execution Engine</b> are an extension point that allows to add / call behaviour that is not available by default through * provided APIs. * The PlatformCommandAPI gives access to command registration / unregistration to 'deploy' new commands at platform level. * The commands must be packed in jars and deployed /undeployed in the Engine as dependencies using methods {@link CommandAPI#addDependency(String, byte[])}, * {@link #removeDependency(String)} * * @see CommandAPI
<<<<<<< import static org.mockito.Matchers.anyMapOf; ======= import static org.mockito.Matchers.argThat; >>>>>>> import static org.mockito.Matchers.anyMapOf; import static org.mockito.Matchers.argThat; <<<<<<< @Test public void deleteParentArchivedProcessInstanceAndElements_should_be_ignored_when_error_to_getArchivedProcessInstance() throws Exception { // given: doThrow(SProcessInstanceModificationException.class).when(processInstanceService).deleteArchivedProcessInstanceElements(anyLong(), anyLong()); doThrow(SProcessInstanceNotFoundException.class).when(processInstanceService).getArchivedProcessInstance(archivedProcessInstanceId); doNothing().when(processInstanceService).logArchivedProcessInstanceNotFound(any(SProcessInstanceModificationException.class)); // when: processInstanceService.deleteParentArchivedProcessInstanceAndElements(aProcessInstance); // then: verify(processInstanceService).getArchivedProcessInstance(archivedProcessInstanceId); } @Test(expected = SProcessInstanceModificationException.class) public void deleteParentArchivedProcessInstanceAndElementsOnStillExistingProcessShouldRaiseException() throws Exception { ======= @Test(expected = SBonitaException.class) public void exceptionInDeleteParentArchivedPIAndElementsOnStillExistingProcessShouldRaiseException() throws Exception { >>>>>>> @Test(expected = SProcessInstanceModificationException.class) public void deleteParentArchivedProcessInstanceAndElementsOnStillExistingProcessShouldRaiseException() throws Exception {
<<<<<<< public static final BonitaHomeServer INSTANCE = new BonitaHomeServer(); ======= private String version; public static final BonitaHomeServer INSTANCE = new BonitaHomeServer();; >>>>>>> private String version; public static final BonitaHomeServer INSTANCE = new BonitaHomeServer();
<<<<<<< BPMRemoteTestsLocal.class, ======= BPMRemoteTests.class, FormMappingIT.class, >>>>>>> BPMRemoteTestsLocal.class, FormMappingIT.class,
<<<<<<< @Column(name = "clobValue") @Type(type = "materialized_clob") ======= >>>>>>> @Column(name = "clobValue") @Type(type = "materialized_clob")
<<<<<<< public void connect() throws ConnectorException { final String kind = (String) getInputParameter(KIND); if (kind.equals(CONNECT)) { ======= public void connect() { final String kind = (String) getInputParameter("kind"); if (kind.equals("connect")) { >>>>>>> public void connect() { final String kind = (String) getInputParameter(KIND); if (kind.equals(CONNECT)) { <<<<<<< public void disconnect() throws ConnectorException { final String kind = (String) getInputParameter(KIND); if (kind.equals(DISCONNECT)) { ======= public void disconnect() { final String kind = (String) getInputParameter("kind"); if (kind.equals("disconnect")) { >>>>>>> public void disconnect() { final String kind = (String) getInputParameter(KIND); if (kind.equals(DISCONNECT)) {
<<<<<<< private static final Object mutex = new BuilderFactoryMutex(); ======= private static final Object MUTEX = new Object(); >>>>>>> private static final Object MUTEX = new BuilderFactoryMutex(); <<<<<<< //System.err.println("Looking for class: " + clazz.getName()); if (!this.factoryCache.containsKey(clazz.getName())) { ======= if (!this.factoryCache.containsKey(clazz)) { >>>>>>> if (!this.factoryCache.containsKey(clazz.getName())) {
<<<<<<< public void cannotAccessTenantAPIsOnMaintenanceTenant() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil(); ======= public void cannotAccessTenantAPIsOnPausedTenant() throws Exception { APITestSPUtil apiTestSPUtil = new APITestSPUtil(); >>>>>>> public void cannotAccessTenantAPIsOnPausedTenant() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil(); <<<<<<< @Cover(classes = { ServerAPI.class }, jira = "BS-7101", keywords = { "tenant maintenance" }, concept = BPMNConcept.NONE) public void should_be_able_to_login_only_with_technical_user_in_maintenance() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil(); ======= @Cover(classes = { ServerAPI.class }, jira = "BS-7101", keywords = { "tenant pause" }, concept = BPMNConcept.NONE) public void should_be_able_to_login_only_with_technical_user_on_paused_tenant() throws Exception { APITestSPUtil apiTestSPUtil = new APITestSPUtil(); >>>>>>> @Cover(classes = { ServerAPI.class }, jira = "BS-7101", keywords = { "tenant pause" }, concept = BPMNConcept.NONE) public void should_be_able_to_login_only_with_technical_user_on_paused_tenant() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil(); <<<<<<< @Cover(classes = { ServerAPI.class }, jira = "BS-2242", keywords = { "tenant maintenance" }, concept = BPMNConcept.NONE) public void maintenanceAnnotatedAPIMethodShouldBePossibleOnMaintenanceTenant() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil(); ======= @Cover(classes = { ServerAPI.class }, jira = "BS-2242", keywords = { "tenant pause" }, concept = BPMNConcept.NONE) public void pauseAnnotatedAPIMethodShouldBePossibleOnPausedTenant() throws Exception { APITestSPUtil apiTestSPUtil = new APITestSPUtil(); >>>>>>> @Cover(classes = { ServerAPI.class }, jira = "BS-2242", keywords = { "tenant pause" }, concept = BPMNConcept.NONE) public void pauseAnnotatedAPIMethodShouldBePossibleOnPausedTenant() throws Exception { final APITestSPUtil apiTestSPUtil = new APITestSPUtil();
<<<<<<< import org.bonitasoft.engine.bpm.document.Document; import org.bonitasoft.engine.bpm.document.DocumentNotFoundException; ======= import org.bonitasoft.engine.bpm.data.DataInstance; import org.bonitasoft.engine.bpm.data.impl.IntegerDataInstanceImpl; >>>>>>> import org.bonitasoft.engine.bpm.data.DataInstance; import org.bonitasoft.engine.bpm.data.impl.IntegerDataInstanceImpl; import org.bonitasoft.engine.bpm.document.Document; import org.bonitasoft.engine.bpm.document.DocumentNotFoundException; <<<<<<< import org.bonitasoft.engine.core.document.api.DocumentService; import org.bonitasoft.engine.core.document.exception.SProcessDocumentDeletionException; import org.bonitasoft.engine.core.document.model.SDocumentMapping; import org.bonitasoft.engine.core.document.model.impl.SDocumentMappingImpl; ======= import org.bonitasoft.engine.core.operation.OperationService; import org.bonitasoft.engine.core.operation.model.SOperation; import org.bonitasoft.engine.core.process.definition.ProcessDefinitionService; import org.bonitasoft.engine.core.process.definition.model.SActivityDefinition; import org.bonitasoft.engine.core.process.definition.model.SFlowElementContainerDefinition; import org.bonitasoft.engine.core.process.definition.model.SProcessDefinition; >>>>>>> import org.bonitasoft.engine.core.operation.OperationService; import org.bonitasoft.engine.core.operation.model.SOperation; import org.bonitasoft.engine.core.process.definition.ProcessDefinitionService; import org.bonitasoft.engine.core.process.definition.model.SActivityDefinition; import org.bonitasoft.engine.core.process.definition.model.SFlowElementContainerDefinition; import org.bonitasoft.engine.core.process.definition.model.SProcessDefinition; import org.bonitasoft.engine.core.document.api.DocumentService; import org.bonitasoft.engine.core.document.exception.SProcessDocumentDeletionException; import org.bonitasoft.engine.core.document.model.SDocumentMapping; import org.bonitasoft.engine.core.document.model.impl.SDocumentMappingImpl; <<<<<<< ======= @Test public void updateActivityInstanceVariables_should_load_processDef_classes() throws Exception { final String dataInstanceName = "acase"; final LeftOperand leftOperand = new LeftOperandBuilder().createNewInstance().setName(dataInstanceName) .setType(LeftOperand.TYPE_DATA).done(); final String customDataTypeName = "com.bonitasoft.support.Case"; final Expression expression = new ExpressionBuilder().createGroovyScriptExpression("updateDataCaseTest", "new com.bonitasoft.support.Case(\"title\", \"description\")", customDataTypeName); final Operation operation = new OperationBuilder().createNewInstance().setOperator("=").setLeftOperand(leftOperand).setType(OperatorType.ASSIGNMENT) .setRightOperand(expression).done(); final ClassLoader contextClassLoader = mock(ClassLoader.class); when(classLoaderService.getLocalClassLoader(anyString(), anyLong())).thenReturn(contextClassLoader); final SProcessDefinition processDef = mock(SProcessDefinition.class); when(processDefinitionService.getProcessDefinition(anyLong())).thenReturn(processDef); final SActivityInstance activityInstance = mock(SActivityInstance.class); when(activityInstanceService.getActivityInstance(anyLong())).thenReturn(activityInstance); final SFlowElementContainerDefinition flowElementContainerDefinition = mock(SFlowElementContainerDefinition.class); when(processDef.getProcessContainer()).thenReturn(flowElementContainerDefinition); when(flowElementContainerDefinition.getFlowNode(anyLong())).thenReturn(mock(SActivityDefinition.class)); final SDataInstance dataInstance = mock(SDataInstance.class); when(dataInstanceService.getDataInstances(any(List.class), anyLong(), eq(DataInstanceContainer.ACTIVITY_INSTANCE.toString()))).thenReturn(Arrays.asList(dataInstance)); doReturn(mock(SOperation.class)).when(processAPI).convertOperation(operation); final List<Operation> operations = new ArrayList<Operation>(); operations.add(operation); processAPI.updateActivityInstanceVariables(operations, 2, null); verify(classLoaderService).getLocalClassLoader(anyString(), anyLong()); } >>>>>>>
<<<<<<< import org.bonitasoft.engine.business.data.BusinessDataReference; ======= import org.bonitasoft.engine.exception.BonitaException; >>>>>>> import org.bonitasoft.engine.business.data.BusinessDataReference; import org.bonitasoft.engine.exception.BonitaException;
<<<<<<< /** * Copyright (C) 2013 BonitaSoft S.A. * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Foundation * version 2.1 of the License. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301, USA. **/ package org.bonitasoft.engine.connector; import java.lang.reflect.Proxy; import org.bonitasoft.engine.api.APIAccessor; import org.bonitasoft.engine.api.CommandAPI; import org.bonitasoft.engine.api.IdentityAPI; import org.bonitasoft.engine.api.ProcessAPI; import org.bonitasoft.engine.api.ProfileAPI; import org.bonitasoft.engine.api.ThemeAPI; import org.bonitasoft.engine.api.impl.ClientInterceptor; import org.bonitasoft.engine.api.impl.ServerAPIFactory; import org.bonitasoft.engine.api.internal.ServerAPI; import org.bonitasoft.engine.exception.BonitaRuntimeException; import org.bonitasoft.engine.service.ModelConvertor; import org.bonitasoft.engine.service.TenantServiceAccessor; import org.bonitasoft.engine.service.TenantServiceSingleton; import org.bonitasoft.engine.session.APISession; import org.bonitasoft.engine.session.SessionService; import org.bonitasoft.engine.session.model.SSession; import org.bonitasoft.engine.sessionaccessor.SessionAccessor; /** * @author Baptiste Mesta * @author Celine Souchet */ public class ConnectorAPIAccessorImpl implements APIAccessor { private static final long serialVersionUID = 3365911149008207537L; private final long tenantId; private APISession apiSession; public ConnectorAPIAccessorImpl(final long tenantId) { super(); this.tenantId = tenantId; } protected APISession getAPISession() { if (apiSession == null) { final TenantServiceAccessor tenantServiceAccessor = TenantServiceSingleton.getInstance(tenantId); final SessionAccessor sessionAccessor = tenantServiceAccessor.getSessionAccessor(); final SessionService sessionService = tenantServiceAccessor.getSessionService(); try { final SSession session = sessionService.createSession(tenantId, ConnectorAPIAccessorImpl.class.getSimpleName());// FIXME get the sessionAccessor.setSessionInfo(session.getId(), tenantId); return ModelConvertor.toAPISession(session, null); } catch (Exception e) { throw new BonitaRuntimeException(e); } } return apiSession; } @Override public IdentityAPI getIdentityAPI() { return getAPI(IdentityAPI.class, getAPISession()); } @Override public ProcessAPI getProcessAPI() { return getAPI(ProcessAPI.class, getAPISession()); } @Override public CommandAPI getCommandAPI() { return getAPI(CommandAPI.class, getAPISession()); } @Override public ProfileAPI getProfileAPI() { return getAPI(ProfileAPI.class, getAPISession()); } @Override public ThemeAPI getThemeAPI() { return getAPI(ThemeAPI.class, getAPISession()); } private static ServerAPI getServerAPI() { return ServerAPIFactory.getServerAPI(false); } private static <T> T getAPI(final Class<T> clazz, final APISession session) { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI, session); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); } } ======= /** * Copyright (C) 2013 BonitaSoft S.A. * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Foundation * version 2.1 of the License. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301, USA. **/ package org.bonitasoft.engine.connector; import java.lang.reflect.Proxy; import org.bonitasoft.engine.api.APIAccessor; import org.bonitasoft.engine.api.CommandAPI; import org.bonitasoft.engine.api.IdentityAPI; import org.bonitasoft.engine.api.ProcessAPI; import org.bonitasoft.engine.api.ProfileAPI; import org.bonitasoft.engine.api.ThemeAPI; import org.bonitasoft.engine.api.impl.ClientInterceptor; import org.bonitasoft.engine.api.impl.ServerAPIImpl; import org.bonitasoft.engine.api.internal.ServerAPI; import org.bonitasoft.engine.exception.BonitaRuntimeException; import org.bonitasoft.engine.service.ModelConvertor; import org.bonitasoft.engine.service.TenantServiceAccessor; import org.bonitasoft.engine.service.TenantServiceSingleton; import org.bonitasoft.engine.session.APISession; import org.bonitasoft.engine.session.SessionService; import org.bonitasoft.engine.session.model.SSession; import org.bonitasoft.engine.sessionaccessor.SessionAccessor; /** * @author Baptiste Mesta * @author Celine Souchet */ public class ConnectorAPIAccessorImpl implements APIAccessor { private static final long serialVersionUID = 3365911149008207537L; private final long tenantId; private APISession apiSession; public ConnectorAPIAccessorImpl(final long tenantId) { super(); this.tenantId = tenantId; } protected APISession getAPISession() { if (apiSession == null) { final TenantServiceAccessor tenantServiceAccessor = TenantServiceSingleton.getInstance(tenantId); final SessionAccessor sessionAccessor = tenantServiceAccessor.getSessionAccessor(); final SessionService sessionService = tenantServiceAccessor.getSessionService(); try { final SSession session = sessionService.createSession(tenantId, ConnectorAPIAccessorImpl.class.getSimpleName());// FIXME get the sessionAccessor.setSessionInfo(session.getId(), tenantId); return ModelConvertor.toAPISession(session, null); } catch (final Exception e) { throw new BonitaRuntimeException(e); } } return apiSession; } @Override public IdentityAPI getIdentityAPI() { return getAPI(IdentityAPI.class, getAPISession()); } @Override public ProcessAPI getProcessAPI() { return getAPI(ProcessAPI.class, getAPISession()); } @Override public CommandAPI getCommandAPI() { return getAPI(CommandAPI.class, getAPISession()); } @Override public ProfileAPI getProfileAPI() { return getAPI(ProfileAPI.class, getAPISession()); } @Override public ThemeAPI getThemeAPI() { return getAPI(ThemeAPI.class, getAPISession()); } private static ServerAPI getServerAPI() { return new ServerAPIImpl(false); } private static <T> T getAPI(final Class<T> clazz, final APISession session) { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI, session); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); } } >>>>>>> /** * Copyright (C) 2013 BonitaSoft S.A. * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU Lesser General Public License as published by the Free Software Foundation * version 2.1 of the License. * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License along with this * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth * Floor, Boston, MA 02110-1301, USA. **/ package org.bonitasoft.engine.connector; import java.lang.reflect.Proxy; import org.bonitasoft.engine.api.APIAccessor; import org.bonitasoft.engine.api.CommandAPI; import org.bonitasoft.engine.api.IdentityAPI; import org.bonitasoft.engine.api.ProcessAPI; import org.bonitasoft.engine.api.ProfileAPI; import org.bonitasoft.engine.api.ThemeAPI; import org.bonitasoft.engine.api.impl.ClientInterceptor; import org.bonitasoft.engine.api.impl.ServerAPIFactory; import org.bonitasoft.engine.api.internal.ServerAPI; import org.bonitasoft.engine.exception.BonitaRuntimeException; import org.bonitasoft.engine.service.ModelConvertor; import org.bonitasoft.engine.service.TenantServiceAccessor; import org.bonitasoft.engine.service.TenantServiceSingleton; import org.bonitasoft.engine.session.APISession; import org.bonitasoft.engine.session.SessionService; import org.bonitasoft.engine.session.model.SSession; import org.bonitasoft.engine.sessionaccessor.SessionAccessor; /** * @author Baptiste Mesta * @author Celine Souchet */ public class ConnectorAPIAccessorImpl implements APIAccessor { private static final long serialVersionUID = 3365911149008207537L; private final long tenantId; private APISession apiSession; public ConnectorAPIAccessorImpl(final long tenantId) { super(); this.tenantId = tenantId; } protected APISession getAPISession() { if (apiSession == null) { final TenantServiceAccessor tenantServiceAccessor = TenantServiceSingleton.getInstance(tenantId); final SessionAccessor sessionAccessor = tenantServiceAccessor.getSessionAccessor(); final SessionService sessionService = tenantServiceAccessor.getSessionService(); try { final SSession session = sessionService.createSession(tenantId, ConnectorAPIAccessorImpl.class.getSimpleName());// FIXME get the sessionAccessor.setSessionInfo(session.getId(), tenantId); return ModelConvertor.toAPISession(session, null); } catch (final Exception e) { throw new BonitaRuntimeException(e); } } return apiSession; } @Override public IdentityAPI getIdentityAPI() { return getAPI(IdentityAPI.class, getAPISession()); } @Override public ProcessAPI getProcessAPI() { return getAPI(ProcessAPI.class, getAPISession()); } @Override public CommandAPI getCommandAPI() { return getAPI(CommandAPI.class, getAPISession()); } @Override public ProfileAPI getProfileAPI() { return getAPI(ProfileAPI.class, getAPISession()); } @Override public ThemeAPI getThemeAPI() { return getAPI(ThemeAPI.class, getAPISession()); } private static ServerAPI getServerAPI() { return ServerAPIFactory.getServerAPI(false); } private static <T> T getAPI(final Class<T> clazz, final APISession session) { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor sessionInterceptor = new ClientInterceptor(clazz.getName(), serverAPI, session); return (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { clazz }, sessionInterceptor); } }
<<<<<<< @Id ======= >>>>>>> @Id
<<<<<<< ======= import org.bonitasoft.engine.bpm.flownode.ArchivedFlowNodeInstance; import org.bonitasoft.engine.bpm.flownode.ArchivedFlowNodeInstanceSearchDescriptor; import org.bonitasoft.engine.bpm.flownode.CallActivityDefinition; import org.bonitasoft.engine.bpm.flownode.CallActivityInstance; >>>>>>> import org.bonitasoft.engine.bpm.flownode.ArchivedFlowNodeInstance; import org.bonitasoft.engine.bpm.flownode.ArchivedFlowNodeInstanceSearchDescriptor; <<<<<<< ======= @Cover(classes = { CallActivityDefinition.class }, concept = BPMNConcept.CALL_ACTIVITY, keywords = { "Call Activity", "Gateway", "Message" }, jira = "ENGINE-1713") >>>>>>> <<<<<<< ======= @Cover(classes = { CallActivityDefinition.class }, concept = BPMNConcept.CALL_ACTIVITY, jira = "ENGINE-878", keywords = { "Data mapping with operations execution order" }) >>>>>>> <<<<<<< ======= @Cover(classes = { CallActivityDefinition.class }, concept = BPMNConcept.CALL_ACTIVITY, keywords = { "Call Activity", "Undeployed target" }, jira = "BS-10502") >>>>>>> <<<<<<< ======= @Cover(classes = { CallActivityDefinition.class }, concept = BPMNConcept.CALL_ACTIVITY, keywords = { "Call Activity", "Disabled target" }, jira = "BS-10745") >>>>>>> <<<<<<< ======= @Cover(classes = { SubProcessDefinition.class }, concept = BPMNConcept.EVENT_SUBPROCESS, keywords = { "event sub-process", "container hierarchy" }, jira = "ENGINE-1899") >>>>>>> <<<<<<< ======= @Cover(classes = { CallActivityInstance.class }, concept = BPMNConcept.CALL_ACTIVITY, keywords = { "Call Activity", "Engine constant" }, jira = "ENGINE-1009") >>>>>>> <<<<<<< ======= @Cover(classes = { CallActivityInstance.class }, concept = BPMNConcept.CALL_ACTIVITY, keywords = { "Call Activity", "Connector", "Data mapping" }, jira = "ENGINE-1243") >>>>>>>
<<<<<<< ======= ApplicationPageIT.class, ApplicationMenuIT.class, ApplicationImportExportIT.class, DeleteEventTriggerInstanceIT.class, >>>>>>> DeleteEventTriggerInstanceIT.class,
<<<<<<< final TransactionService transactionService = platformAccessor.getTransactionService(); final SPlatform platform = constructPlatform(platformAccessor); ======= final TransactionExecutor transactionExecutor = platformAccessor.getTransactionExecutor(); >>>>>>> final TransactionService transactionService = platformAccessor.getTransactionService(); <<<<<<< protected Long createSession(final long tenantId, final SessionService sessionService) throws SBonitaException { return sessionService.createSession(tenantId, "system").getId(); ======= private Long createSession(final long tenantId, final SessionService sessionService, final TransactionExecutor transactionExecutor) throws SBonitaException { final TransactionContentWithResult<Long> transaction = new TransactionContentWithResult<Long>() { private long sessionId; @Override public void execute() throws SBonitaException { final SSession session = sessionService.createSession(tenantId, "system"); // FIXME use technical user sessionId = session.getId(); } @Override public Long getResult() { return sessionId; } }; transactionExecutor.execute(transaction); return transaction.getResult(); >>>>>>> protected Long createSession(final long tenantId, final SessionService sessionService) throws SBonitaException { return sessionService.createSession(tenantId, "system").getId();
<<<<<<< final Thread thread = iterator.next(); if (isEngine(thread)) { ======= Thread thread = iterator.next(); if (isEngine(thread) && !thread.getName().startsWith("net.sf.ehcache.CacheManager")) { >>>>>>> final Thread thread = iterator.next(); if (isEngine(thread) && !thread.getName().startsWith("net.sf.ehcache.CacheManager")) {
<<<<<<< /** * Get the number of the {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} * state. * * @param queryOptions * the search criteria containing a map of specific parameters of a query * @return The number of the {@link SProcessInstance} with at least one failed task or the * {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} state. * @throws SBonitaException * @since 6.4.0 */ long getNumberOfFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException; /** * List all {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} state. * * @param queryOptions * the search criteria containing a map of specific parameters of a query * @return The list of {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} * state. * @throws SBonitaException * @since 6.4.0 */ List<SProcessInstance> searchFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException; ======= long getNumberOfProcessInstances(long processDefinitionId) throws SBonitaReadException; >>>>>>> /** * Get the number of the {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} * state. * * @param queryOptions * the search criteria containing a map of specific parameters of a query * @return The number of the {@link SProcessInstance} with at least one failed task or the * {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} state. * @throws SBonitaException * @since 6.4.0 */ long getNumberOfFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException; /** * List all {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} state. * * @param queryOptions * the search criteria containing a map of specific parameters of a query * @return The list of {@link SProcessInstance} with at least one failed task or the {@link org.bonitasoft.engine.bpm.process.ProcessInstanceState#ERROR} * state. * @throws SBonitaException * @since 6.4.0 */ List<SProcessInstance> searchFailedProcessInstances(QueryOptions queryOptions) throws SBonitaReadException; long getNumberOfProcessInstances(long processDefinitionId) throws SBonitaReadException;
<<<<<<< import org.bonitasoft.engine.core.process.instance.api.RefBusinessDataService; import org.bonitasoft.engine.core.process.instance.api.TokenService; ======= import org.bonitasoft.engine.core.process.instance.api.ProcessInstanceService; >>>>>>> import org.bonitasoft.engine.core.process.instance.api.RefBusinessDataService; import org.bonitasoft.engine.core.process.instance.api.TokenService; import org.bonitasoft.engine.core.process.instance.api.ProcessInstanceService; <<<<<<< private RefBusinessDataService refBusinessDataService; ======= private final ProcessInstanceService processInstanceService; >>>>>>> private RefBusinessDataService refBusinessDataService; private final ProcessInstanceService processInstanceService; <<<<<<< final ActivityInstanceService activityInstanceService, final UserFilterService userFilterService, final ClassLoaderService classLoaderService, final ActorMappingService actorMappingService, final ConnectorInstanceService connectorInstanceService, final ExpressionResolverService expressionResolverService, final ProcessDefinitionService processDefinitionService, final DataInstanceService dataInstanceService, final OperationService operationService, final WorkService workService, final ContainerRegistry containerRegistry, final EventInstanceService eventInstanceService, final SchedulerService schedulerService, final SCommentService commentService, final IdentityService identityService, final TechnicalLoggerService logger, final TokenService tokenService, final ParentContainerResolver parentContainerResolver, RefBusinessDataService refBusinessDataService) { ======= final ActivityInstanceService activityInstanceService, final UserFilterService userFilterService, final ClassLoaderService classLoaderService, final ActorMappingService actorMappingService, final ConnectorInstanceService connectorInstanceService, final ExpressionResolverService expressionResolverService, final ProcessDefinitionService processDefinitionService, final DataInstanceService dataInstanceService, final OperationService operationService, final WorkService workService, final ContainerRegistry containerRegistry, final EventInstanceService eventInstanceService, final SchedulerService schedulerService, final SCommentService commentService, final IdentityService identityService, final TechnicalLoggerService logger, final ProcessInstanceService processInstanceService, final ParentContainerResolver parentContainerResolver) { >>>>>>> final ActivityInstanceService activityInstanceService, final UserFilterService userFilterService, final ClassLoaderService classLoaderService, final ActorMappingService actorMappingService, final ConnectorInstanceService connectorInstanceService, final ExpressionResolverService expressionResolverService, final ProcessDefinitionService processDefinitionService, final DataInstanceService dataInstanceService, final OperationService operationService, final WorkService workService, final ContainerRegistry containerRegistry, final EventInstanceService eventInstanceService, final SchedulerService schedulerService, final SCommentService commentService, final IdentityService identityService, final TechnicalLoggerService logger, final ProcessInstanceService processInstanceService, final ParentContainerResolver parentContainerResolver) {
<<<<<<< if (operation.getRightOperand() == null && operation.getType() != OperatorType.DELETION) { ======= checkRightOperand(operation); return this; } private void checkRightOperand(final Operation operation) { if (operation.getRightOperand() == null) { >>>>>>> checkRightOperand(operation); return this; } private void checkRightOperand(final Operation operation) { if (operation.getRightOperand() == null && operation.getType() != OperatorType.DELETION) { <<<<<<< * Add a boundary event * ======= * Adds a boundary event * >>>>>>> * Adds a boundary event * <<<<<<< * Add an interrupting boundary event * ======= * Adds an interrupting boundary event * >>>>>>> * Adds an interrupting boundary event *
<<<<<<< import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Callable; import org.apache.commons.lang3.math.NumberUtils; ======= import java.util.concurrent.Callable; >>>>>>> import java.io.IOException; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import java.util.concurrent.Callable; <<<<<<< import org.bonitasoft.engine.transaction.TransactionService; import org.springframework.util.CollectionUtils; ======= import org.bonitasoft.engine.transaction.TransactionService; >>>>>>> import org.bonitasoft.engine.transaction.TransactionService; <<<<<<< Long tenantId = (NumberUtils.isNumber(String.valueOf(credentials.get(AuthenticationConstants.BASIC_TENANT_ID)))) ? NumberUtils.toLong(String .valueOf(credentials.get( AuthenticationConstants.BASIC_TENANT_ID))) : null; final PlatformServiceAccessor platformServiceAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); final PlatformService platformService = platformServiceAccessor.getPlatformService(); final TransactionExecutor platformTransactionExecutor = platformServiceAccessor.getTransactionExecutor(); // first call before create session: put the platform in cache if necessary // putPlatformInCacheIfNecessary(platformServiceAccessor, platformService); TransactionContentWithResult<STenant> getTenant; if (tenantId == null) { getTenant = new GetDefaultTenantInstance(platformService); } else { getTenant = new GetTenantInstance(tenantId, platformService); } platformTransactionExecutor.execute(getTenant); final STenant sTenant = getTenant.getResult(); final long resolvedTenantId = sTenant.getId(); String userName = (credentials.get(AuthenticationConstants.BASIC_USERNAME) != null) ? String.valueOf(credentials .get(AuthenticationConstants.BASIC_USERNAME)) : null; checkThatWeCanLogin(userName, tenantId, platformService, sTenant, resolvedTenantId); final TenantServiceAccessor serviceAccessor = getTenantServiceAccessor(resolvedTenantId); final LoginService loginService = serviceAccessor.getLoginService(); final IdentityService identityService = serviceAccessor.getIdentityService(); final TransactionService transactionService = platformServiceAccessor.getTransactionService(); final Map<String, Serializable> credentialsWithResolvedTenantId = new HashMap<String, Serializable>(credentials); credentialsWithResolvedTenantId.put(AuthenticationConstants.BASIC_TENANT_ID, resolvedTenantId); SSession sSession = transactionService .executeInTransaction(new LoginAndRetrieveUser(loginService, identityService, credentialsWithResolvedTenantId)); return ModelConvertor.toAPISession(sSession, sTenant.getName()); } catch (final LoginException e) { throw e; } catch (final RuntimeException e) { throw e; } catch (final Throwable e) { ======= return login(userName, password, null); } catch (final LoginException e) { throw e; } catch (final BonitaRuntimeException e) { throw e; } catch (final Exception e) { >>>>>>> Long tenantId = (NumberUtils.isNumber(String.valueOf(credentials.get(AuthenticationConstants.BASIC_TENANT_ID)))) ? NumberUtils.toLong(String .valueOf(credentials.get( AuthenticationConstants.BASIC_TENANT_ID))) : null; String userName = (credentials.get(AuthenticationConstants.BASIC_USERNAME) != null) ? String.valueOf(credentials .get(AuthenticationConstants.BASIC_USERNAME)) : null; return login(userName, password, null); } catch (final LoginException e) { throw e; } catch (final BonitaRuntimeException e) { throw e; } catch (final Exception e) { <<<<<<< protected void checkCredentials(final Map<String, Serializable> credentials) throws LoginException { if (CollectionUtils.isEmpty(credentials)) { throw new LoginException("credentials are null or empty"); } } protected void checkThatWeCanLogin(final String userName, final Long tenantId, final PlatformService platformService, final STenant sTenant, final long resolvedTenantId) throws LoginException, BonitaHomeNotSetException, IOException { if (!platformService.isTenantActivated(sTenant)) { throw new LoginException("Tenant " + sTenant.getName() + " is not activated"); } ======= protected APISession login(final String userName, final String password, final Long tenantId) throws Exception { final PlatformServiceAccessor platformServiceAccessor = ServiceAccessorFactory.getInstance().createPlatformServiceAccessor(); final PlatformService platformService = platformServiceAccessor.getPlatformService(); final TransactionExecutor platformTransactionExecutor = platformServiceAccessor.getTransactionExecutor(); // first call before create session: put the platform in cache if necessary final TransactionContentWithResult<STenant> getTenant; if (tenantId == null) { getTenant = new GetDefaultTenantInstance(platformService); } else { getTenant = new GetTenantInstance(tenantId, platformService); } platformTransactionExecutor.execute(getTenant); final STenant sTenant = getTenant.getResult(); final long localTenantId = sTenant.getId(); checkThatWeCanLogin(userName, platformService, sTenant); final TenantServiceAccessor serviceAccessor = getTenantServiceAccessor(localTenantId); final LoginService loginService = serviceAccessor.getLoginService(); final IdentityService identityService = serviceAccessor.getIdentityService(); final TransactionService transactionService = platformServiceAccessor.getTransactionService(); SSession sSession = transactionService.executeInTransaction(new LoginAndRetrieveUser(loginService, identityService, localTenantId, userName, password)); return ModelConvertor.toAPISession(sSession, sTenant.getName()); } @SuppressWarnings("unused") protected void checkThatWeCanLogin(final String userName, final PlatformService platformService, final STenant sTenant) throws LoginException { if (!platformService.isTenantActivated(sTenant)) { throw new LoginException("Tenant " + sTenant.getName() + " is not activated !!"); } >>>>>>> protected void checkCredentials(final Map<String, Serializable> credentials) throws LoginException { if (CollectionUtils.isEmpty(credentials)) { throw new LoginException("credentials are null or empty"); } } @SuppressWarnings("unused") protected void checkThatWeCanLogin(final String userName, final PlatformService platformService, final STenant sTenant) throws LoginException { if (!platformService.isTenantActivated(sTenant)) { throw new LoginException("Tenant " + sTenant.getName() + " is not activated !!"); } <<<<<<< private final Map<String, Serializable> credentials; ======= private final long tenantId; private final String userName; private final String password; >>>>>>> private final Map<String, Serializable> credentials; <<<<<<< this.credentials = credentials; } @Override public SSession call() throws Exception { ======= this.tenantId = tenantId; this.userName = userName; this.password = password; } @Override public SSession call() throws Exception { >>>>>>> this.credentials = credentials; } @Override public SSession call() throws Exception {
<<<<<<< import android.util.Log; ======= import com.android.gallery3d.R; >>>>>>> import android.util.Log; import com.android.gallery3d.R;
<<<<<<< private boolean mFixedAspect = false; public void setFixedAspect(boolean t) { mFixedAspect = t; } ======= private boolean mDisableFilterButtons = false; >>>>>>> private boolean mDisableFilterButtons = false; private boolean mFixedAspect = false; public void setFixedAspect(boolean t) { mFixedAspect = t; }
<<<<<<< onClickBottomSheet(findViewById(R.id.fl_bottom_sheet)); MobclickAgent.onEvent(getApplicationContext(),"enter_mainactivity_by_click_notification_dayline"); mIvSoundDayline.postDelayed(new Runnable() { @Override public void run() { onClickDaylineSound(findViewById(R.id.iv_sound_dayline)); } },1000); ======= onClickBottomSheet(); >>>>>>> onClickBottomSheet(); MobclickAgent.onEvent(getApplicationContext(),"enter_mainactivity_by_click_notification_dayline"); mIvSoundDayline.postDelayed(new Runnable() { @Override public void run() { onClickDaylineSound(findViewById(R.id.iv_sound_dayline)); } },1000);
<<<<<<< Options options = createCommandLineOptions(); CommandLine cl = parseCommandLine(args, options); if(cl==null) { System.out.println("Error Parsing Command Line Arguments"); return; } try { KarmaStats stats = new KarmaStats(cl); if(!stats.parseCommandLineOptions(cl)) { System.out.println("Parse ERROR"); return; } } catch (Exception e) { e.printStackTrace(); } ======= >>>>>>> Options options = createCommandLineOptions(); CommandLine cl = parseCommandLine(args, options); if(cl==null) { System.out.println("Error Parsing Command Line Arguments"); return; } try { KarmaStats stats = new KarmaStats(cl); if(!stats.parseCommandLineOptions(cl)) { System.out.println("Parse ERROR"); return; } } catch (Exception e) { e.printStackTrace(); } <<<<<<< String[] fname = fileSplit[fileSplit.length - 1].split("\\."); StringBuffer nameBuf = new StringBuffer(); /* * If model name has "." in the name. * */ if(fname.length>2) { for(int j=0;j<fname.length-1;j++) { nameBuf.append(fname[j]); } } String modelName = nameBuf.toString(); ======= String[] fname = fileSplit[fileSplit.length - 1].split("\\."); String modelName = fname[0]; >>>>>>> String[] fname = fileSplit[fileSplit.length - 1].split("\\."); StringBuffer nameBuf = new StringBuffer(); /* * If model name has "." in the name. * */ if(fname.length>2) { for(int j=0;j<fname.length-1;j++) { nameBuf.append(fname[j]); } } String modelName = nameBuf.toString(); <<<<<<< private static CommandLine parseCommandLine(String args[], Options options) { CommandLineParser parser = new BasicParser(); CommandLine cl = null; try { /** * PARSE THE COMMAND LINE ARGUMENTS * */ cl = parser.parse(options, args); if (cl == null || cl.getOptions().length == 0) { return null; } } catch (Exception e) { return cl; } return cl; } private static Options createCommandLineOptions() { Options options = new Options(); options.addOption(new Option("inputfile", "inputfile", true, "Input TTL File")); options.addOption(new Option("outputfile", "outputfile", true, "location of the output file with name")); options.addOption(new Option("pretty", "pretty", false, "JSON or JSONLines selection")); return options; } private boolean parseCommandLineOptions(CommandLine cl) { String isPretty; inputFile = (String) cl.getOptionValue("sourcetype"); if(inputFile==null) { System.out.println("Please provide input File"); return false; } outputFile = (String) cl.getOptionValue("outputfile","KarmaStats.json"); isPretty = (String) cl.getOptionValue("pretty","false"); if(!isPretty.equals("false")) { isPretty = "true"; } this.isPretty = Boolean.parseBoolean(isPretty); return true; } ======= >>>>>>> private static CommandLine parseCommandLine(String args[], Options options) { CommandLineParser parser = new BasicParser(); CommandLine cl = null; try { /** * PARSE THE COMMAND LINE ARGUMENTS * */ cl = parser.parse(options, args); if (cl == null || cl.getOptions().length == 0) { return null; } } catch (Exception e) { return cl; } return cl; } private static Options createCommandLineOptions() { Options options = new Options(); options.addOption(new Option("inputfile", "inputfile", true, "Input TTL File")); options.addOption(new Option("outputfile", "outputfile", true, "location of the output file with name")); options.addOption(new Option("pretty", "pretty", false, "JSON or JSONLines selection")); return options; } private boolean parseCommandLineOptions(CommandLine cl) { String isPretty; inputFile = (String) cl.getOptionValue("sourcetype"); if(inputFile==null) { System.out.println("Please provide input File"); return false; } outputFile = (String) cl.getOptionValue("outputfile","KarmaStats.json"); isPretty = (String) cl.getOptionValue("pretty","false"); if(!isPretty.equals("false")) { isPretty = "true"; } this.isPretty = Boolean.parseBoolean(isPretty); return true; }
<<<<<<< Vector<Segment> res; ======= Vector<Segment> res = new Vector<>(); >>>>>>> Vector<Segment> res; <<<<<<< Vector<int[]> kmappings = new Vector<int[]>(); for(Dataitem elem: stringArrayListEntry.getValue()){ ======= Vector<int[]> kmappings = new Vector<>(); for(Dataitem elem: groups.get(key)){ >>>>>>> Vector<int[]> kmappings = new Vector<>(); for(Dataitem elem: stringArrayListEntry.getValue()){
<<<<<<< int c; Vector<TNode> x = new Vector<TNode>(); ======= int c = 0; Vector<TNode> x = new Vector<>(); >>>>>>> int c; Vector<TNode> x = new Vector<>();
<<<<<<< if (modelingConfiguration.getPropertiesDirect()) { if (this.ontologyManager.isConnectedByDirectProperty(sourceUri, targetUri) || this.ontologyManager.isConnectedByDirectProperty(targetUri, sourceUri)) { ======= if (ModelingConfiguration.getPropertiesDirect()) { if (this.ontologyManager.isConnectedByDirectProperty(sourceUri, targetUri)) { >>>>>>> if (modelingConfiguration.getPropertiesDirect()) { if (this.ontologyManager.isConnectedByDirectProperty(sourceUri, targetUri)) { <<<<<<< if (modelingConfiguration.getPropertiesIndirect() && !connected) { if (this.ontologyManager.isConnectedByIndirectProperty(sourceUri, targetUri) || this.ontologyManager.isConnectedByIndirectProperty(targetUri, sourceUri)) { ======= if (ModelingConfiguration.getPropertiesIndirect()) { if (!sourceConnectedToTarget && this.ontologyManager.isConnectedByIndirectProperty(sourceUri, targetUri)) { >>>>>>> if (modelingConfiguration.getPropertiesIndirect()) { if (!sourceConnectedToTarget && this.ontologyManager.isConnectedByIndirectProperty(sourceUri, targetUri)) { <<<<<<< if (modelingConfiguration.getPropertiesWithOnlyRange() && !connected) { if (this.ontologyManager.isConnectedByDomainlessProperty(sourceUri, targetUri) || this.ontologyManager.isConnectedByDomainlessProperty(targetUri, sourceUri)) { ======= if (ModelingConfiguration.getPropertiesWithOnlyRange()) { if (!sourceConnectedToTarget && this.ontologyManager.isConnectedByDomainlessProperty(sourceUri, targetUri)) { >>>>>>> if (modelingConfiguration.getPropertiesWithOnlyRange()) { if (!sourceConnectedToTarget && this.ontologyManager.isConnectedByDomainlessProperty(sourceUri, targetUri)) { <<<<<<< if (modelingConfiguration.getPropertiesWithoutDomainRange() && !connected) { ======= if (ModelingConfiguration.getPropertiesWithoutDomainRange() && !sourceConnectedToTarget && !targetConnectedToSource) { >>>>>>> if (modelingConfiguration.getPropertiesWithoutDomainRange() && !sourceConnectedToTarget && !targetConnectedToSource) {
<<<<<<< while (!tlines.isEmpty()) { Vector<Vector<Segment>> nlines = new Vector<Vector<Segment>>(); ======= while (tlines.size() > 0) { Vector<Vector<Segment>> nlines = new Vector<>(); >>>>>>> while (!tlines.isEmpty()) { Vector<Vector<Segment>> nlines = new Vector<>(); <<<<<<< Vector<Segment> ret; ======= Vector<Segment> ret = new Vector<>(); >>>>>>> Vector<Segment> ret; <<<<<<< Vector<GrammarTreeNode> result; ======= Vector<GrammarTreeNode> result = new Vector<>(); >>>>>>> Vector<GrammarTreeNode> result; <<<<<<< Vector<GrammarTreeNode> result; ======= Vector<GrammarTreeNode> result = new Vector<>(); >>>>>>> Vector<GrammarTreeNode> result;
<<<<<<< ======= >>>>>>>
<<<<<<< addTag(CommandTag.SemanticType); ======= this.nodeId = nodeId; addTag(CommandTag.Modeling); >>>>>>> this.nodeId = nodeId; addTag(CommandTag.SemanticType);
<<<<<<< List<Attribute> rawAttributes; List<String> rawAttributeIDs = new ArrayList<String>(); List<String> rawValues; String singleValue; ======= List<Attribute> rawAttributes = null; List<String> rawAttributeIDs = new ArrayList<>(); List<String> rawValues = null; String singleValue = null; >>>>>>> List<Attribute> rawAttributes; List<String> rawAttributeIDs = new ArrayList<>(); List<String> rawValues; String singleValue;
<<<<<<< boolean localsUninitialized = interpreter.getLocals() == initialLocals; if(localsUninitialized) { PyStringMap locals = new PyStringMap(); interpreter.setLocals(locals); interpreter.exec(scripts.get(PythonTransformationHelper.getImportStatements())); interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getIsEmptyDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getHasSelectedRowsStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getVDefStatement())); } if(localsUninitialized ||(!libraryHasBeenLoaded || reloadLibrary)) { importUserScripts(interpreter); } ======= interpreter.exec(scripts.get(PythonTransformationHelper.getImportStatements())); interpreter.exec(scripts.get(PythonTransformationHelper.getRowIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueFromNestedColumnByIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getIsEmptyDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getVDefStatement())); >>>>>>> boolean localsUninitialized = interpreter.getLocals() == initialLocals; if(localsUninitialized) { PyStringMap locals = new PyStringMap(); interpreter.setLocals(locals); interpreter.exec(scripts.get(PythonTransformationHelper.getImportStatements())); interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getIsEmptyDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getHasSelectedRowsStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getGetValueFromNestedColumnByIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getRowIndexDefStatement())); interpreter.exec(scripts.get(PythonTransformationHelper.getVDefStatement())); } if(localsUninitialized ||(!libraryHasBeenLoaded || reloadLibrary)) { importUserScripts(interpreter); }
<<<<<<< import java.net.MalformedURLException; import java.net.URL; ======= import java.net.URL; >>>>>>> import java.net.MalformedURLException; import java.net.URL; <<<<<<< return getRDF(formParams); ======= boolean refreshModel = false; String sRefreshModel = formParams.getFirst(FormParameters.REFRESH_MODEL); if(sRefreshModel != null && sRefreshModel.equalsIgnoreCase("true")) refreshModel = true; return GenerateRDF(formParams.getFirst(FormParameters.RAW_DATA), formParams.getFirst(FormParameters.R2RML_URL), refreshModel); >>>>>>> return getRDF(formParams); <<<<<<< ======= logger.info("Generating RDF for: " + formParams.getFirst(FormParameters.RAW_DATA)); boolean refreshModel = false; String sRefreshModel = formParams.getFirst(FormParameters.REFRESH_MODEL); if(sRefreshModel != null && sRefreshModel.equalsIgnoreCase("true")) refreshModel = true; String strRDF = GenerateRDF(formParams.getFirst(FormParameters.RAW_DATA), formParams.getFirst(FormParameters.R2RML_URL), refreshModel); int responseCode = PublishRDFToTripleStore(formParams, strRDF); >>>>>>> logger.info("Generating RDF for: " + formParams.getFirst(FormParameters.RAW_DATA)); <<<<<<< String strRDF = getRDF(formParams); ======= boolean refreshModel = false; String sRefreshModel = formParams.getFirst(FormParameters.REFRESH_MODEL); if(sRefreshModel != null && sRefreshModel.equalsIgnoreCase("true")) refreshModel = true; String strRDF = GenerateRDF(formParams.getFirst(FormParameters.RAW_DATA), formParams.getFirst(FormParameters.R2RML_URL), refreshModel); int responseCode = PublishRDFToTripleStore(formParams, strRDF); //TODO Make it better if(responseCode == 200 || responseCode == 201) logger.info("Successfully completed"); else logger.error("There was an error while publishing to Triplestore"); >>>>>>> String strRDF = getRDF(formParams); <<<<<<< private String GenerateRDF(InputStream dataStream, String r2rmlURI, String dataType) throws KarmaException, JSONException, IOException { initialization(); ======= private String GenerateRDF(String metadataJSON, String r2rmlURI, boolean refreshR2RML) throws KarmaException, JSONException, IOException { logger.info("Parse and model JSON:" + metadataJSON); UpdateContainer uc = new UpdateContainer(); KarmaMetadataManager userMetadataManager = new KarmaMetadataManager(); userMetadataManager.register(new UserPreferencesMetadata(), uc); userMetadataManager.register(new UserConfigMetadata(), uc); userMetadataManager.register(new PythonTransformationMetadata(), uc); SemanticTypeUtil.setSemanticTypeTrainingStatus(false); ModelingConfiguration.setLearnerEnabled(false); // disable automatic learning >>>>>>> private String GenerateRDF(InputStream dataStream, String r2rmlURI, String dataType, boolean refreshR2RML) throws KarmaException, JSONException, IOException { initialization(); <<<<<<< //TODO Replace PHONE with something meaningful gRDFGen.generateRDF(FormParameters.R2RML_URL,"PHONE",dataStream , InputType.valueOf(dataType), false, outWriter); ======= WorksheetR2RMLJenaModelParser modelParser = getModel(rmlID, refreshR2RML); String sourceName = r2rmlURI; gRDFGen.generateRDF(modelParser, sourceName, metadataJSON, InputType.JSON, -1, false, outWriter); >>>>>>> WorksheetR2RMLJenaModelParser modelParser = getModel(rmlID, refreshR2RML); String sourceName = r2rmlURI; gRDFGen.generateRDF(modelParser, sourceName, dataStream, InputType.JSON, -1, false, outWriter); <<<<<<< private String GenerateRDF(String rawData, String r2rmlURI, String dataType) throws KarmaException, JSONException, IOException { return GenerateRDF(new StringInputStream(rawData), r2rmlURI, dataType); } static { try { initialization(); } catch (KarmaException ke) { logger.error("KarmaException: " + ke.getMessage()); } } private static void initialization() throws KarmaException { UpdateContainer uc = new UpdateContainer(); KarmaMetadataManager userMetadataManager = new KarmaMetadataManager(); userMetadataManager.register(new UserPreferencesMetadata(), uc); userMetadataManager.register(new UserConfigMetadata(), uc); userMetadataManager.register(new PythonTransformationMetadata(), uc); SemanticTypeUtil.setSemanticTypeTrainingStatus(false); ModelingConfiguration.setLearnerEnabled(false); // disable automatic learning } ======= private WorksheetR2RMLJenaModelParser getModel(R2RMLMappingIdentifier modelIdentifier, boolean refreshR2RML) throws JSONException, KarmaException { WorksheetR2RMLJenaModelParser modelParser = null; if(refreshR2RML == false) { modelParser = (WorksheetR2RMLJenaModelParser) modelCache.get(modelIdentifier.getName()); } if(modelParser == null) { modelParser = new WorksheetR2RMLJenaModelParser(modelIdentifier); modelCache.put(modelIdentifier.getName(), modelParser); } return modelParser; } >>>>>>> private String GenerateRDF(String rawData, String r2rmlURI, String dataType, boolean refreshModel) throws KarmaException, JSONException, IOException { return GenerateRDF(new StringInputStream(rawData), r2rmlURI, dataType, refreshModel); } static { try { initialization(); } catch (KarmaException ke) { logger.error("KarmaException: " + ke.getMessage()); } } private static void initialization() throws KarmaException { UpdateContainer uc = new UpdateContainer(); KarmaMetadataManager userMetadataManager = new KarmaMetadataManager(); userMetadataManager.register(new UserPreferencesMetadata(), uc); userMetadataManager.register(new UserConfigMetadata(), uc); userMetadataManager.register(new PythonTransformationMetadata(), uc); SemanticTypeUtil.setSemanticTypeTrainingStatus(false); ModelingConfiguration.setLearnerEnabled(false); // disable automatic learning } private WorksheetR2RMLJenaModelParser getModel(R2RMLMappingIdentifier modelIdentifier, boolean refreshR2RML) throws JSONException, KarmaException { WorksheetR2RMLJenaModelParser modelParser = null; if(refreshR2RML == false) { modelParser = (WorksheetR2RMLJenaModelParser) modelCache.get(modelIdentifier.getName()); } if(modelParser == null) { modelParser = new WorksheetR2RMLJenaModelParser(modelIdentifier); modelCache.put(modelIdentifier.getName(), modelParser); } return modelParser; }
<<<<<<< String rule; HashSet<String> vs = new HashSet<String>(); ArrayList<String> lviews = new ArrayList<String>(); ======= String rule = ""; HashSet<String> vs = new HashSet<>(); ArrayList<String> lviews = new ArrayList<>(); >>>>>>> String rule; HashSet<String> vs = new HashSet<>(); ArrayList<String> lviews = new ArrayList<>();
<<<<<<< for (SemanticTypeMapping stm : mappings) { SteinerNodes sn = new SteinerNodes(contextId); sn.addNodes(stm.getSourceColumn(), stm.getSource(), stm.getTarget(), stm.getConfidence()); ======= for (SemanticTypeMapping stm : sortedMappings) { SteinerNodes sn = new SteinerNodes(); sn.addNodes(stm); >>>>>>> for (SemanticTypeMapping stm : sortedMappings) { SteinerNodes sn = new SteinerNodes(contextId); sn.addNodes(stm); <<<<<<< SteinerNodes sn = new SteinerNodes(nodeSet,contextId); sn.addNodes(stm.getSourceColumn(), stm.getSource(), stm.getTarget(), stm.getConfidence()); ======= SteinerNodes sn = new SteinerNodes(nodeSet); sn.addNodes(stm); >>>>>>> SteinerNodes sn = new SteinerNodes(nodeSet,contextId); sn.addNodes(stm); <<<<<<< for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(ContextParametersRegistry.getInstance().getContextParameters(contextId).getKarmaHome()).getMaxQueuedMappigs() && i < newSteinerNodes.size(); i++) ======= for (int i = 0; i < ModelingConfiguration.getMappingBranchingFactor() && i < newSteinerNodes.size(); i++) >>>>>>> for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(contextId).getMappingBranchingFactor() && i < newSteinerNodes.size(); i++) <<<<<<< for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(ContextParametersRegistry.getInstance().getContextParameters(contextId).getKarmaHome()).getMaxQueuedMappigs() && i < newSteinerNodes.size(); i++) ======= for (int i = 0; i < ModelingConfiguration.getMappingBranchingFactor() && i < newSteinerNodes.size(); i++) >>>>>>> for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(contextId).getMappingBranchingFactor() && i < newSteinerNodes.size(); i++) <<<<<<< for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(ContextParametersRegistry.getInstance().getContextParameters(contextId).getKarmaHome()).getMaxQueuedMappigs() && i < paretoFrontierSteinerSets.size(); i++) { ======= for (int i = 0; i < ModelingConfiguration.getMappingBranchingFactor() && i < paretoFrontierSteinerSets.size(); i++) { >>>>>>> for (int i = 0; i < ModelingConfigurationRegistry.getInstance().getModelingConfiguration(contextId).getMappingBranchingFactor() && i < paretoFrontierSteinerSets.size(); i++) {
<<<<<<< public Vector<Integer> orgPos = new Vector<Integer>(); public Vector<Integer> tarPos = new Vector<Integer>(); public Vector<Integer> length = new Vector<Integer>(); public Vector<String[]> exps = new Vector<String[]>(); public List<ANode> children = new Vector<ANode>(); ======= public Vector<Integer> orgPos = new Vector<>(); public Vector<Integer> tarPos = new Vector<>(); public Vector<Integer> length = new Vector<>(); public Vector<String[]> exps = new Vector<>(); public Vector<ANode> children = new Vector<>(); >>>>>>> public Vector<Integer> orgPos = new Vector<>(); public Vector<Integer> tarPos = new Vector<>(); public Vector<Integer> length = new Vector<>(); public Vector<String[]> exps = new Vector<>(); public List<ANode> children = new Vector<>();
<<<<<<< import java.util.Map; ======= import java.util.List; import java.util.Map; >>>>>>> import java.util.List; import java.util.Map; <<<<<<< String raw = stringEntry.getValue()[0]; String[] pair = { raw, stringEntry.getValue()[2] }; if (testdata.containsKey(stringEntry.getValue()[3])) { HashMap<String, String[]> xelem = testdata.get(stringEntry.getValue()[3]); if (!xelem.containsKey(stringEntry.getKey())) { xelem.put(stringEntry.getKey(), pair); ======= String raw = exps.get(keyString)[0]; String[] pair = { raw, exps.get(keyString)[2] }; if (testdata.containsKey(exps.get(keyString)[3])) { Map<String, String[]> xelem = testdata.get(exps .get(keyString)[3]); if (!xelem.containsKey(keyString)) { xelem.put(keyString, pair); >>>>>>> String raw = stringEntry.getValue()[0]; String[] pair = { raw, stringEntry.getValue()[2] }; if (testdata.containsKey(stringEntry.getValue()[3])) { Map<String, String[]> xelem = testdata.get(stringEntry.getValue()[3]); if (!xelem.containsKey(stringEntry.getKey())) { xelem.put(stringEntry.getKey(), pair); <<<<<<< Vector<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { ======= List<String> examples = new Vector<String>(); for (String key : raw.keySet()) { >>>>>>> List<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { <<<<<<< Vector<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { ======= List<String> examples = new Vector<String>(); for (String key : raw.keySet()) { >>>>>>> List<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { <<<<<<< for (Map.Entry<String, HashMap<String, String[]>> stringHashMapEntry : this.testdata.entrySet()) { HashMap<String, String[]> r = stringHashMapEntry.getValue(); s1 += "partition " + stringHashMapEntry.getKey() + "\n"; ======= for (String key : this.testdata.keySet()) { Map<String, String[]> r = testdata.get(key); s1 += "partition " + key + "\n"; >>>>>>> for (Map.Entry<String, HashMap<String, String[]>> stringHashMapEntry : this.testdata.entrySet()) { Map<String, String[]> r = stringHashMapEntry.getValue(); s1 += "partition " + stringHashMapEntry.getKey() + "\n";
<<<<<<< import edu.isi.karma.controller.command.selection.SuperSelection; import edu.isi.karma.kr2rml.KR2RMLRDFWriter; ======= >>>>>>> import edu.isi.karma.controller.command.selection.SuperSelection;
<<<<<<< private Boolean learnerEnabled; private Boolean learnAlignmentEnabled; private Boolean multipleSamePropertyPerNode; ======= private static Boolean learnerEnabled; private static Boolean addOntologyPaths; // private static Boolean learnAlignmentEnabled; private static Boolean multipleSamePropertyPerNode; >>>>>>> private Boolean learnerEnabled; private Boolean addOntologyPaths; // private Boolean learnAlignmentEnabled; private Boolean multipleSamePropertyPerNode; <<<<<<< public Boolean getManualAlignment() { if (manualAlignment == null) { ======= // public static Boolean getManualAlignment() { // if (manualAlignment == null) { // load(); // logger.debug("Manual Alignment:" + manualAlignment); // } // return manualAlignment; // } public static Boolean getOntologyAlignment() { if (ontologyAlignment == null) { load(); logger.debug("Use Ontology in Alignment:" + ontologyAlignment); } return ontologyAlignment; } public static Boolean getKnownModelsAlignment() { if (knownModelsAlignment == null) { >>>>>>> // public static Boolean getManualAlignment() { // if (manualAlignment == null) { // load(); // logger.debug("Manual Alignment:" + manualAlignment); // } // return manualAlignment; // } public Boolean getOntologyAlignment() { if (ontologyAlignment == null) { load(); logger.debug("Use Ontology in Alignment:" + ontologyAlignment); } return ontologyAlignment; } public Boolean getKnownModelsAlignment() { if (knownModelsAlignment == null) { <<<<<<< // public static String getModelsJsonDir() { // if (modelsJsonDir == null) // load(); // return modelsJsonDir; // } // // public static String getModelsGraphvizDir() { // if (modelsGraphvizDir == null) // load(); // return modelsGraphvizDir; // } // // public static String getAlignmentGraphDir() { // if (alignmentGraphDir == null) // load(); // return alignmentGraphDir; // } public Integer getMaxCandidateModels() { if (maxCandidateModels == null) ======= public static Integer getNumCandidateMappings() { if (numCandidateMappings == null) >>>>>>> public Integer getNumCandidateMappings() { if (numCandidateMappings == null) <<<<<<< public Integer getMaxQueuedMappigs() { if (maxQueuedMappigs == null) ======= public static Integer getMappingBranchingFactor() { if (mappingBranchingFactor == null) >>>>>>> public Integer getMappingBranchingFactor() { if (mappingBranchingFactor == null) <<<<<<< public boolean isLearnAlignmentEnabled() { if (learnAlignmentEnabled == null) ======= public static boolean getAddOntologyPaths() { if (addOntologyPaths == null) >>>>>>> public boolean getAddOntologyPaths() { if (addOntologyPaths == null) <<<<<<< public void setManualAlignment(Boolean newManualAlignment) ======= public static void setManualAlignment() >>>>>>> public void setManualAlignment()
<<<<<<< boolean result = true;//utilObj.saveToStore(modelFileLocalPath, tripleStoreUrl, graphName, true, null); if (tripleStoreUrl != null && tripleStoreUrl.trim().compareTo("") != 0) { String url = RESTserverAddress + "/R2RMLMapping/local/" + modelFileName; ======= boolean result = utilObj.saveToStore(modelFileLocalPath, tripleStoreUrl, graphName, true, null); if (localTripleStoreUrl != null && localTripleStoreUrl.trim().compareTo("") != 0) { UriBuilder builder = UriBuilder.fromPath(modelFileName); String url = RESTserverAddress + "/R2RMLMapping/local/" + builder.build().toString(); >>>>>>> boolean result = true;//utilObj.saveToStore(modelFileLocalPath, tripleStoreUrl, graphName, true, null); if (tripleStoreUrl != null && tripleStoreUrl.trim().compareTo("") != 0) { UriBuilder builder = UriBuilder.fromPath(modelFileName); String url = RESTserverAddress + "/R2RMLMapping/local/" + builder.build().toString();
<<<<<<< List<Row> resultRows = new ArrayList<Row>(); for (Entry<String, ArrayList<String>> stringArrayListEntry : hash.entrySet()) { ArrayList<String> r = stringArrayListEntry.getValue(); ======= List<Row> resultRows = new ArrayList<>(); for (String hashKey : hash.keySet()) { ArrayList<String> r = hash.get(hashKey); >>>>>>> List<Row> resultRows = new ArrayList<>(); for (Entry<String, ArrayList<String>> stringArrayListEntry : hash.entrySet()) { ArrayList<String> r = stringArrayListEntry.getValue();
<<<<<<< Map<Node, Integer> verticesIndex = new HashMap<Node, Integer>(); Map<String, ColumnNode> columnNodes = new HashMap<>(); ======= HashMap<Node, Integer> verticesIndex = new HashMap<>(); HashMap<String, ColumnNode> columnNodes = new HashMap<>(); >>>>>>> Map<Node, Integer> verticesIndex = new HashMap<>(); Map<String, ColumnNode> columnNodes = new HashMap<>(); <<<<<<< Map<Node, Integer> verticesIndex = new HashMap<Node, Integer>(); ======= HashMap<Node, Integer> verticesIndex = new HashMap<>(); >>>>>>> Map<Node, Integer> verticesIndex = new HashMap<>();
<<<<<<< import edu.isi.karma.kr2rml.mapping.R2RMLMappingIdentifier; ======= import edu.isi.karma.kr2rml.R2RMLMappingIdentifier; import edu.isi.karma.modeling.ModelingConfiguration; >>>>>>> import edu.isi.karma.kr2rml.mapping.R2RMLMappingIdentifier; import edu.isi.karma.modeling.ModelingConfiguration;
<<<<<<< modelingConfiguration.getTopKSteinerTree(), null, null, true); ======= ModelingConfiguration.getTopKSteinerTree(), 50, 1, true); >>>>>>> modelingConfiguration.getTopKSteinerTree(), 50, 1, true); <<<<<<< int count = Math.min(sortableSemanticModels.size(), modelingConfiguration.getNumCandidateMappings()); ======= // int count = Math.min(sortableSemanticModels.size(), ModelingConfiguration.getNumCandidateMappings()); >>>>>>> // int count = Math.min(sortableSemanticModels.size(), modelingConfiguration.getNumCandidateMappings());
<<<<<<< public HashMap<String, Boolean> legalParitions = new HashMap<String, Boolean>(); Vector<Partition> examples = new Vector<Partition>(); Set<String> exampleInputs = new HashSet<String>(); Vector<Vector<String[]>> constraints = new Vector<Vector<String[]>>(); ======= public HashMap<String, Boolean> legalParitions = new HashMap<>(); Vector<Partition> examples = new Vector<>(); HashSet<String> exampleInputs = new HashSet<>(); Vector<Vector<String[]>> constraints = new Vector<>(); >>>>>>> public HashMap<String, Boolean> legalParitions = new HashMap<>(); Vector<Partition> examples = new Vector<>(); Set<String> exampleInputs = new HashSet<>(); Vector<Vector<String[]>> constraints = new Vector<>(); <<<<<<< Map<String, Vector<String[]>> xHashMap1 = new HashMap<String, Vector<String[]>>(); ======= HashMap<String, Vector<String[]>> xHashMap1 = new HashMap<>(); >>>>>>> Map<String, Vector<String[]>> xHashMap1 = new HashMap<>(); <<<<<<< Set<String> xHashSet2 = new HashSet<String>(); ======= HashSet<String> xHashSet2 = new HashSet<>(); >>>>>>> Set<String> xHashSet2 = new HashSet<>(); <<<<<<< List<String> g = new ArrayList<String>(); ======= ArrayList<String> g = new ArrayList<>(); >>>>>>> List<String> g = new ArrayList<>(); <<<<<<< public void assignUnlabeledData(List<Partition> pars) { HashMap<String, Double> dists = new HashMap<String, Double>(); ======= public void assignUnlabeledData(Vector<Partition> pars) { HashMap<String, Double> dists = new HashMap<>(); >>>>>>> public void assignUnlabeledData(List<Partition> pars) { HashMap<String, Double> dists = new HashMap<>(); <<<<<<< Map<Partition, HashMap<String, Double>> testResult = new HashMap<Partition, HashMap<String, Double>>(); ======= HashMap<Partition, HashMap<String, Double>> testResult = new HashMap<>(); >>>>>>> Map<Partition, HashMap<String, Double>> testResult = new HashMap<>(); <<<<<<< List<String> strings) { ArrayList<ArrayList<Double>> res = new ArrayList<ArrayList<Double>>(); ======= ArrayList<String> strings) { ArrayList<ArrayList<Double>> res = new ArrayList<>(); >>>>>>> List<String> strings) { ArrayList<ArrayList<Double>> res = new ArrayList<>(); <<<<<<< ArrayList<double[]> instances = new ArrayList<double[]>(); for (Map.Entry<String, double[]> stringEntry : string2Vector.entrySet()) { double[] elem = stringEntry.getValue(); ======= ArrayList<double[]> instances = new ArrayList<>(); for (String s : string2Vector.keySet()) { double[] elem = string2Vector.get(s); >>>>>>> ArrayList<double[]> instances = new ArrayList<>(); for (Map.Entry<String, double[]> stringEntry : string2Vector.entrySet()) { double[] elem = stringEntry.getValue(); <<<<<<< List<Partition> nPs = new ArrayList<Partition>(); ======= ArrayList<Partition> nPs = new ArrayList<>(); >>>>>>> List<Partition> nPs = new ArrayList<>();
<<<<<<< import edu.isi.karma.webserver.ContextParametersRegistry; import edu.isi.karma.webserver.ServletContextParameterMap; ======= >>>>>>> import edu.isi.karma.webserver.ContextParametersRegistry; import edu.isi.karma.webserver.ServletContextParameterMap; <<<<<<< if (number == modelingConfiguration.getMaxCandidateModels()) ======= if (number == ModelingConfiguration.getNumCandidateMappings()) >>>>>>> if (number == modelingConfiguration.getNumCandidateMappings()) <<<<<<< int count = Math.min(sortableSemanticModels.size(), modelingConfiguration.getMaxCandidateModels()); ======= int count = Math.min(sortableSemanticModels.size(), ModelingConfiguration.getNumCandidateMappings()); >>>>>>> int count = Math.min(sortableSemanticModels.size(), modelingConfiguration.getNumCandidateMappings());
<<<<<<< public ArrayList<Integer> deCorrelate(Map<String, double[]> data) { ArrayList<Integer> toRemove = new ArrayList<Integer>(); Set<String> signs = new HashSet<String>(); ======= public ArrayList<Integer> deCorrelate(HashMap<String, double[]> data) { ArrayList<Integer> toRemove = new ArrayList<>(); HashSet<String> signs = new HashSet<>(); >>>>>>> public ArrayList<Integer> deCorrelate(Map<String, double[]> data) { ArrayList<Integer> toRemove = new ArrayList<>(); Set<String> signs = new HashSet<>(); <<<<<<< Set<String> curRow = new HashSet<String>(); ======= HashSet<String> curRow = new HashSet<>(); >>>>>>> Set<String> curRow = new HashSet<>();
<<<<<<< ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId()); File uploadedFile = FileUtil.downloadFileFromHTTPRequest(request, contextParameters.getParameterValue(ContextParameter.USER_UPLOADED_DIR)); ======= >>>>>>> ServletContextParameterMap contextParameters = ContextParametersRegistry.getInstance().getContextParameters(workspace.getContextId());
<<<<<<< isinloop, contextId); ======= isinloop); if(elem.length> 2) xsec.convert = elem[2]; >>>>>>> isinloop, contextId); if(elem.length> 2) xsec.convert = elem[2];
<<<<<<< @SuppressWarnings("CollectionDeclaredAsConcreteClass") public Map<String, Vector<TNode>> org = new HashMap<String, Vector<TNode>>(); @SuppressWarnings("CollectionDeclaredAsConcreteClass") public Map<String, Vector<TNode>> tran = new HashMap<String, Vector<TNode>>(); @SuppressWarnings("CollectionDeclaredAsConcreteClass") public Map<String, String[]> raw = new HashMap<String, String[]>(); ======= public HashMap<String, Vector<TNode>> org = new HashMap<>(); public HashMap<String, Vector<TNode>> tran = new HashMap<>(); public HashMap<String, String[]> raw = new HashMap<>(); >>>>>>> public Map<String, Vector<TNode>> org = new HashMap<>(); public Map<String, Vector<TNode>> tran = new HashMap<>(); public Map<String, String[]> raw = new HashMap<>(); <<<<<<< Vector<String[]> result = new Vector<String[]>(); for (Map.Entry<String, String[]> stringEntry : exps.entrySet()) { String[] record = stringEntry.getValue(); ======= Vector<String[]> result = new Vector<>(); for (String key : exps.keySet()) { String[] record = exps.get(key); >>>>>>> Vector<String[]> result = new Vector<>(); for (Map.Entry<String, String[]> stringEntry : exps.entrySet()) { String[] record = stringEntry.getValue(); <<<<<<< HashMap<String, String[]> vstr = new HashMap<String, String[]>(); vstr.put(stringEntry.getKey(), pair); testdata.put(stringEntry.getValue()[3], vstr); ======= HashMap<String, String[]> vstr = new HashMap<>(); vstr.put(keyString, pair); testdata.put(exps.get(keyString)[3], vstr); >>>>>>> HashMap<String, String[]> vstr = new HashMap<>(); vstr.put(stringEntry.getKey(), pair); testdata.put(stringEntry.getValue()[3], vstr); <<<<<<< @SuppressWarnings("CollectionDeclaredAsConcreteClass") public int ambiguityScore(List<TNode> vec) { Map<String, Integer> d = new HashMap<String, Integer>(); ======= public int ambiguityScore(Vector<TNode> vec) { HashMap<String, Integer> d = new HashMap<>(); >>>>>>> public int ambiguityScore(List<TNode> vec) { Map<String, Integer> d = new HashMap<>(); <<<<<<< List<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { ======= Vector<String> examples = new Vector<>(); for (String key : raw.keySet()) { >>>>>>> List<String> examples = new Vector<>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { <<<<<<< List<String> examples = new Vector<String>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) { ======= Vector<String> examples = new Vector<>(); for (String key : raw.keySet()) { >>>>>>> List<String> examples = new Vector<>(); for (Map.Entry<String, String[]> stringEntry : raw.entrySet()) {
<<<<<<< final List<Object> rval = new ArrayList<Object>(); for (final Map.Entry<String, Object> stringObjectEntry : graph.entrySet()) { final Map<String, Object> node = (Map<String, Object>) stringObjectEntry.getValue(); final List<String> properties = new ArrayList<String>(node.keySet()); ======= final List<Object> rval = new ArrayList<>(); for (final String id : graph.keySet()) { final Map<String, Object> node = (Map<String, Object>) graph.get(id); final List<String> properties = new ArrayList<>(node.keySet()); >>>>>>> final List<Object> rval = new ArrayList<>(); for (final Map.Entry<String, Object> stringObjectEntry : graph.entrySet()) { final Map<String, Object> node = (Map<String, Object>) stringObjectEntry.getValue(); final List<String> properties = new ArrayList<>(node.keySet());
<<<<<<< Map<String, JSONArray> comMap = new HashMap<String, JSONArray>(); ======= HashMap<String, JSONArray> comMap = new HashMap<>(); >>>>>>> Map<String, JSONArray> comMap = new HashMap<>();
<<<<<<< import edu.isi.karma.util.EncodingDetector; ======= >>>>>>> import edu.isi.karma.util.EncodingDetector; <<<<<<< import edu.isi.karma.webserver.ServletContextParameterMap; import edu.isi.karma.webserver.ServletContextParameterMap.ContextParameter; ======= >>>>>>> import edu.isi.karma.webserver.ServletContextParameterMap; import edu.isi.karma.webserver.ServletContextParameterMap.ContextParameter; <<<<<<< ======= >>>>>>> <<<<<<< logger.debug("Generating rdf for " + sourceName); Workspace workspace = initializeWorkspace(); initOfflineWorkspaceSettings(workspace); ======= logger.debug("Generating rdf for " + sourceName); Workspace workspace = initializeWorkspace(); >>>>>>> logger.debug("Generating rdf for " + sourceName); Workspace workspace = initializeWorkspace(); initOfflineWorkspaceSettings(workspace);
<<<<<<< import org.json.JSONArray; import org.json.JSONObject; ======= import org.json.JSONException; >>>>>>> import org.json.JSONArray; import org.json.JSONObject; import org.json.JSONException;
<<<<<<< import org.slf4j.Logger; import org.slf4j.LoggerFactory; import au.com.bytecode.opencsv.CSVReader; import edu.isi.karma.controller.command.selection.SuperSelection; import edu.isi.karma.rep.CellValue; import edu.isi.karma.rep.HNode; import edu.isi.karma.rep.HNode.HNodeType; import edu.isi.karma.rep.HNodePath; import edu.isi.karma.rep.HTable; import edu.isi.karma.rep.Node; import edu.isi.karma.rep.Node.NodeStatus; import edu.isi.karma.rep.RepFactory; import edu.isi.karma.rep.Row; import edu.isi.karma.rep.Table; import edu.isi.karma.rep.Worksheet; import edu.isi.karma.rep.Workspace; ======= import org.slf4j.Logger; import org.slf4j.LoggerFactory; import au.com.bytecode.opencsv.CSVReader; import edu.isi.karma.er.helper.CloneTableUtils; import edu.isi.karma.rep.CellValue; import edu.isi.karma.rep.HNode; import edu.isi.karma.rep.HNode.HNodeType; import edu.isi.karma.rep.HNodePath; import edu.isi.karma.rep.HTable; import edu.isi.karma.rep.Node; import edu.isi.karma.rep.Node.NodeStatus; import edu.isi.karma.rep.RepFactory; import edu.isi.karma.rep.Row; import edu.isi.karma.rep.Table; import edu.isi.karma.rep.Worksheet; import edu.isi.karma.rep.Workspace; >>>>>>> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import au.com.bytecode.opencsv.CSVReader; import edu.isi.karma.controller.command.selection.SuperSelection; import edu.isi.karma.er.helper.CloneTableUtils; import edu.isi.karma.rep.CellValue; import edu.isi.karma.rep.HNode; import edu.isi.karma.rep.HNode.HNodeType; import edu.isi.karma.rep.HNodePath; import edu.isi.karma.rep.HTable; import edu.isi.karma.rep.Node; import edu.isi.karma.rep.Node.NodeStatus; import edu.isi.karma.rep.RepFactory; import edu.isi.karma.rep.Row; import edu.isi.karma.rep.Table; import edu.isi.karma.rep.Worksheet; import edu.isi.karma.rep.Workspace; <<<<<<< private String splitValueHNodeID; private SuperSelection selection; ======= private final String newhNodeId; private String splitValueHNodeId; >>>>>>> private SuperSelection selection; private final String newhNodeId; private String splitValueHNodeId; <<<<<<< this.selection = sel; ======= this.newhNodeId = null; >>>>>>> this.selection = sel; this.newhNodeId = null;
<<<<<<< LinkedList<String> tempSubjects = new LinkedList<String>(); while(tempSubjects.size() < limit && !subjects.isEmpty()) ======= LinkedList<String> tempSubjects = new LinkedList<>(); while(tempSubjects.size() < limit && subjects.size() > 0) >>>>>>> LinkedList<String> tempSubjects = new LinkedList<>(); while(tempSubjects.size() < limit && !subjects.isEmpty())
<<<<<<< private String contextId; public BANKSfromMM(String contextId) { super(); this.contextId = contextId; ======= private Integer recursiveLevel; private Integer maxPermutations; public BANKSfromMM() { // TODO Auto-generated constructor stub >>>>>>> private String contextId; private Integer recursiveLevel; private Integer maxPermutations; public BANKSfromMM(String contextId) { super(); this.contextId = contextId; <<<<<<< public BANKSfromMM(TreeSet<SteinerNode> terminals, String contextId) throws Exception { ======= public BANKSfromMM(TreeSet<SteinerNode> terminals, Integer recursiveLevel, Integer maxPermutations) throws Exception { >>>>>>> public BANKSfromMM(TreeSet<SteinerNode> terminals, Integer recursiveLevel, Integer maxPermutations, String contextId) throws Exception { <<<<<<< this.contextId = contextId; ======= this.recursiveLevel = recursiveLevel; this.maxPermutations = maxPermutations; >>>>>>> this.contextId = contextId; this.recursiveLevel = recursiveLevel; this.maxPermutations = maxPermutations;
<<<<<<< private PDFTranscoder pdfTranscoder; public BatikSVGImage(Element svgElement, Box box, double cssWidth, double cssHeight, ======= private final PDFTranscoder pdfTranscoder; public BatikSVGImage(Element svgElement, double cssWidth, double cssHeight, >>>>>>> private final PDFTranscoder pdfTranscoder; public BatikSVGImage(Element svgElement, Box box, double cssWidth, double cssHeight,
<<<<<<< private static final int FINAL_REVISION = Integer.MAX_VALUE / 4; /** * Creates a new LogisimVersion object without a revision number * @param major * @param minor * @param release * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release) { return get(major, minor, release, FINAL_REVISION); } /** * Creates a new LogisimVersion object with a revision number * @param major * @param minor * @param release * @param revision * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release, int revision) { return new LogisimVersion(major, minor, release, revision); } /** * Breaks up a single string containing the version number into several integers. * Uses "." as delimiter. * @param versionString * @return a LogisimVersion object */ public static LogisimVersion parse(String versionString) { String[] parts = versionString.split("\\."); int major = 0; int minor = 0; int release = 0; int revision = FINAL_REVISION; try { if (parts.length >= 1) { major = Integer.parseInt(parts[0]); } if (parts.length >= 2) { minor = Integer.parseInt(parts[1]); } if (parts.length >= 3) { release = Integer.parseInt(parts[2]); } if (parts.length >= 4) { revision = Integer.parseInt(parts[3]); } } catch (NumberFormatException e) { } return new LogisimVersion(major, minor, release, revision); } private int major; private int minor; private int release; private int revision; private String repr; /** * Logisim version number constructor. Versions have the form: major.minor.release.revision * @param major * @param minor * @param release * @param revision */ private LogisimVersion(int major, int minor, int release, int revision) { this.major = major; this.minor = minor; this.release = release; this.revision = revision; this.repr = null; } @Override public boolean equals(Object other) { if (other instanceof LogisimVersion) { LogisimVersion o = (LogisimVersion) other; return this.major == o.major && this.minor == o.minor && this.release == o.release && this.revision == o.revision; } else { return false; } } @Override public int compareTo(LogisimVersion other) { int ret = this.major - other.major; if (ret != 0) { return ret; } ret = this.minor - other.minor; if (ret != 0) { return ret; } ret = this.release - other.release; if (ret != 0) { return ret; } return this.revision - other.revision; } /** * converts version number into a string * @return ret */ @Override public String toString() { String ret = repr; if (ret == null) { ret = major + "." + minor + "." + release; if (revision != FINAL_REVISION) { ret += "." + revision; } repr = ret; } return ret; } ======= private static final int FINAL_REVISION = Integer.MAX_VALUE / 4; /** * Creates a new LogisimVersion object without a revision number * @param major * @param minor * @param release * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release) { return get(major, minor, release, FINAL_REVISION); } /** * Creates a new LogisimVersion object with a revision number * @param major * @param minor * @param release * @param revision * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release, int revision) { return new LogisimVersion(major, minor, release, revision); } /** * Breaks up a single string containing the version number into several integers. * Uses "." as delimiter. * @param versionString * @return a LogisimVersion object */ public static LogisimVersion parse(String versionString) { String[] parts = versionString.split("\\."); int major = 0; int minor = 0; int release = 0; int revision = FINAL_REVISION; try { if (parts.length >= 1) major = Integer.parseInt(parts[0]); if (parts.length >= 2) minor = Integer.parseInt(parts[1]); if (parts.length >= 3) release = Integer.parseInt(parts[2]); if (parts.length >= 4) revision = Integer.parseInt(parts[3]); } catch (NumberFormatException e) { System.out.println( "Something went wrong when parsing the version string:\n" ); e.printStackTrace(); } return new LogisimVersion(major, minor, release, revision); } private int major; private int minor; private int release; private int revision; private String repr; /** * Logisim version number constructor. Versions have the form: major.minor.release.revision * @param major * @param minor * @param release * @param revision */ private LogisimVersion(int major, int minor, int release, int revision) { this.major = major; this.minor = minor; this.release = release; this.revision = revision; this.repr = null; } @Override public int hashCode() { return this.major + this.minor + this.release + this.revision; } @Override public boolean equals(Object other) { if (other instanceof LogisimVersion) { LogisimVersion o = (LogisimVersion) other; return this.major == o.major && this.minor == o.minor && this.release == o.release && this.revision == o.revision; } else { return false; } } @Override public int compareTo(LogisimVersion other) { int ret = this.major - other.major; if (ret != 0) return ret; ret = this.minor - other.minor; if (ret != 0) return ret; ret = this.release - other.release; if (ret != 0) return ret; return this.revision - other.revision; } /** * converts version number into a string * @return ret */ @Override public String toString() { String ret = repr; if (ret == null) { ret = major + "." + minor + "." + release; if (revision != FINAL_REVISION) ret += "." + revision; repr = ret; } return ret; } >>>>>>> private static final int FINAL_REVISION = Integer.MAX_VALUE / 4; /** * Creates a new LogisimVersion object without a revision number * @param major * @param minor * @param release * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release) { return get(major, minor, release, FINAL_REVISION); } /** * Creates a new LogisimVersion object with a revision number * @param major * @param minor * @param release * @param revision * @return a LogisimVersion object */ public static LogisimVersion get(int major, int minor, int release, int revision) { return new LogisimVersion(major, minor, release, revision); } /** * Breaks up a single string containing the version number into several integers. * Uses "." as delimiter. * @param versionString * @return a LogisimVersion object */ public static LogisimVersion parse(String versionString) { String[] parts = versionString.split("\\."); int major = 0; int minor = 0; int release = 0; int revision = FINAL_REVISION; try { if (parts.length >= 1) { major = Integer.parseInt(parts[0]); } if (parts.length >= 2) { minor = Integer.parseInt(parts[1]); } if (parts.length >= 3) { release = Integer.parseInt(parts[2]); } if (parts.length >= 4) { revision = Integer.parseInt(parts[3]); } } catch (NumberFormatException e) { System.out.println( "Something went wrong when parsing the version string:\n" ); e.printStackTrace(); } return new LogisimVersion(major, minor, release, revision); } private int major; private int minor; private int release; private int revision; private String repr; /** * Logisim version number constructor. Versions have the form: major.minor.release.revision * @param major * @param minor * @param release * @param revision */ private LogisimVersion(int major, int minor, int release, int revision) { this.major = major; this.minor = minor; this.release = release; this.revision = revision; this.repr = null; } @Override public int hashCode() { return this.major + this.minor + this.release + this.revision; } @Override public boolean equals(Object other) { if (other instanceof LogisimVersion) { LogisimVersion o = (LogisimVersion) other; return this.major == o.major && this.minor == o.minor && this.release == o.release && this.revision == o.revision; } else { return false; } } @Override public int compareTo(LogisimVersion other) { int ret = this.major - other.major; if (ret != 0) { return ret; } ret = this.minor - other.minor; if (ret != 0) { return ret; } ret = this.release - other.release; if (ret != 0) { return ret; } return this.revision - other.revision; } /** * converts version number into a string * @return ret */ @Override public String toString() { String ret = repr; if (ret == null) { ret = major + "." + minor + "." + release; if (revision != FINAL_REVISION) { ret += "." + revision; } repr = ret; } return ret; }
<<<<<<< /** * Tests that too long words fall below floats (left, right, both). * This test is needed to make sure fixes for issue 482 do not prevent * this behavior. */ @Test public void testTooLongWordsFallBelowFloats() throws IOException { assertTrue(vt.runTest("too-long-words-fall-below-floats")); } /** * Test for break-word with lots of unreakable words to make sure we don't * trigger the safety valve which is part of the fix for 482. */ @Test public void testIssue429BreakWordLotsOfShortAndLong() throws IOException { assertTrue(vt.runTest("issue-429-break-word-lots-of-short-and-long")); } ======= /** * Ensure there is no NPE exception launched if the decoding of an image fail (base64 case). * * See issue https://github.com/danfickle/openhtmltopdf/issues/474 * * @throws IOException */ @Test public void testIssue474NpeImageDecoding() throws IOException { assertTrue(vt.runTest("issue-474-npe-image-decoding")); } >>>>>>> /** * Tests that too long words fall below floats (left, right, both). * This test is needed to make sure fixes for issue 482 do not prevent * this behavior. */ @Test public void testTooLongWordsFallBelowFloats() throws IOException { assertTrue(vt.runTest("too-long-words-fall-below-floats")); } /** * Test for break-word with lots of unreakable words to make sure we don't * trigger the safety valve which is part of the fix for 482. */ @Test public void testIssue429BreakWordLotsOfShortAndLong() throws IOException { assertTrue(vt.runTest("issue-429-break-word-lots-of-short-and-long")); } /** * Ensure there is no NPE exception launched if the decoding of an image fail (base64 case). * * See issue https://github.com/danfickle/openhtmltopdf/issues/474 * * @throws IOException */ @Test public void testIssue474NpeImageDecoding() throws IOException { assertTrue(vt.runTest("issue-474-npe-image-decoding")); }