Skip to content

Commit

Permalink
re arrangement
Browse files Browse the repository at this point in the history
  • Loading branch information
leemitra committed Sep 30, 2023
1 parent e073ed5 commit 03cd091
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.moneproject.controller.config;
package com.github.moneproject.config;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.moneproject.controller.config;
package com.github.moneproject.config;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -68,9 +68,9 @@ public TaskServiceFactoryBean taskServiceFactoryBean() {
}

@Bean
public RuntimeEngine getRuntimeEngine(RuntimeManager runtimeManager){
public RuntimeEngine getRuntimeEngine(RuntimeManager runtimeManager) {
return runtimeManager.getRuntimeEngine(EmptyContext.get());
}
}
/*
* @Bean
* public RuntimeEngine runtimeEngine(RuntimeManager runtimeManager) {
Expand All @@ -86,7 +86,7 @@ private Map<Resource, ResourceType> getAssets() {
assets.put(ResourceFactory
.newClassPathResource("jbpm/processes/sample.bpmn"),
ResourceType.BPMN2);
assets.put(ResourceFactory.newClassPathResource("jbpm/processes/bankLoadProcess.bpmn2"), ResourceType.BPMN2);
assets.put(ResourceFactory.newClassPathResource("jbpm/processes/bankLoadProcess.bpmn2"), ResourceType.BPMN2);
return assets;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.moneproject.controller.config;
package com.github.moneproject.config;

import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -41,7 +41,7 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
"org.jbpm.persistence.correlation", "org.jbpm.executor.entities",
"org.jbpm.runtime.manager.impl.jpa",
"org.jbpm.services.task.impl.model",
"org.jbpm.services.task.audit.impl.model","com.github.model");
"org.jbpm.services.task.audit.impl.model", "com.github.model");
emf.setJpaPropertyMap(getJpaProperties());
emf.setMappingResources("META-INF/JBPMorm.xml", "META-INF/Taskorm.xml",
"META-INF/TaskAuditorm.xml");
Expand All @@ -51,7 +51,7 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
private Map<String, ?> getJpaProperties() {
Map<String, Object> p = new HashMap<String, Object>();
p.put("hibernate.max_fetch_depth", 3);
p.put("hibernate.hbm2ddl.auto", "update");
p.put("hibernate.hbm2ddl.auto", "create");
p.put("hibernate.dialect", "org.hibernate.dialect.MariaDB106Dialect");
p.put("hibernate.id.new_generator_mappings", false);
p.put("hibernate.show_sql", true);
Expand All @@ -62,5 +62,5 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
public PlatformTransactionManager transactionManager() throws NamingException {
return new JpaTransactionManager(entityManagerFactory().getObject());
}

}
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
package com.github.moneproject.controller;public class MainController {
package com.github.moneproject.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MainController {

@GetMapping("/checkAvailable")
public String getMapping(){

return "completed";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ public class OneController {

@Autowired
private RuntimeManager runtimeManager;


@GetMapping("/")
public String getHome(){
RuntimeEngine engine= runtimeManager.getRuntimeEngine(EmptyContext.get());
KieSession kieSession= engine.getKieSession();
///ProcessInstance instance = kieSession.startProcess("com.example.sample");
ProcessInstance instance = kieSession.startProcess("com.group.bankLoadProcess");
public String getHome() {
RuntimeEngine engine = runtimeManager.getRuntimeEngine(EmptyContext.get());
KieSession kieSession = engine.getKieSession();
/// ProcessInstance instance = kieSession.startProcess("com.example.sample");
ProcessInstance instance = kieSession.startProcess("com.group.bankLoadProcess");
System.out.println(instance.getId());
runtimeManager.disposeRuntimeEngine(engine);
kieSession.dispose();
return "hello world";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import org.hibernate.dialect.MySQL5Dialect;

public class CustomMariaDBDialect extends MySQL5Dialect {

@Override
public String getQuerySequencesString() {
return "select SEQUENCE_OWNER, SEQUENCE_NAME, greatest(MIN_VALUE, -9223372036854775807) MIN_VALUE,\n"+
"Least(MAX_VALUE, 9223372036854775808) MAX_VALUE, INCREMENT_BY, CYCLE_FLAG, ORDER_FLAG, CACHE_SIZE,\n"+
"Least(greatest(LAST_NUMBER, -9223372036854775807), 9223372036854775808) LAST_NUMBER,\n"+
"PARTITION_COUNT, SESSION_FLAG, KEEP_VALUE\n"+
return "select SEQUENCE_OWNER, SEQUENCE_NAME, greatest(MIN_VALUE, -9223372036854775807) MIN_VALUE,\n" +
"Least(MAX_VALUE, 9223372036854775808) MAX_VALUE, INCREMENT_BY, CYCLE_FLAG, ORDER_FLAG, CACHE_SIZE,\n"
+
"Least(greatest(LAST_NUMBER, -9223372036854775807), 9223372036854775808) LAST_NUMBER,\n" +
"PARTITION_COUNT, SESSION_FLAG, KEEP_VALUE\n" +
"from all_sequences";
}
}

0 comments on commit 03cd091

Please sign in to comment.