upgrade to 7.24.0.Final
This commit is contained in:
commit
a08f5edacf
31 changed files with 682 additions and 156 deletions
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>drools-framework-examples</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>drools-framework-loyalty-model</artifactId>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>drools-framework-examples</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<version>1.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "productManagerApp",
|
||||
"name": "webapp",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"angular": "1.3.0-rc.5",
|
||||
|
|
|
|||
|
|
@ -42,9 +42,20 @@
|
|||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>drools-framework-swimming-pool-model</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pymmasoftware.jbpm</groupId>
|
||||
<artifactId>drools-framework-swimming-pool-model</artifactId>
|
||||
<artifactId>drools-framework-kie-server-client-connector</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
FROM openjdk:8-jre-slim
|
||||
|
||||
EXPOSE 9080
|
||||
EXPOSE 8090
|
||||
ADD application.properties /application.properties
|
||||
ADD maven/swimmingpool-web.jar app.jar
|
||||
USER root
|
||||
RUN bash -c 'touch /app.jar'
|
||||
ENV JAVA_OPTS "-Dspring.config.location=file:./ "
|
||||
|
||||
ENTRYPOINT exec java $JAVA_OPTS $PYMMA_OPTS -jar /app.jar
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
# See http://docs.spring.io/spring-boot/docs/1.1.4.RELEASE/reference/htmlsingle/#boot-features-external-config-profile-specific-properties
|
||||
# for more details about creating profile-specific property files
|
||||
# See http://docs.spring.io/spring-boot/docs/1.1.4.RELEASE/reference/htmlsingle/#howto-initialize-a-database-using-jpa
|
||||
url.swimmingpool.calculate=http://reverse-proxy:9500/
|
||||
server.port=8080
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.swimmingpool.web;
|
||||
|
||||
|
||||
import org.chtijbug.drools.generic.restclient.GenericConnexionConfiguration;
|
||||
import org.chtijbug.drools.generic.restclient.rest.UsedRestAPI;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.PropertySource;
|
||||
|
||||
|
||||
@Configuration
|
||||
@ComponentScan
|
||||
|
||||
@EnableAutoConfiguration
|
||||
@PropertySource("classpath:application.properties")
|
||||
public class Application {
|
||||
|
||||
@Value(value = "${url.swimmingpool.calculate}")
|
||||
private String url;
|
||||
@Value(value = "${url.swimmingpool.calculate.username}")
|
||||
private String username;
|
||||
@Value(value = "${url.swimmingpool.calculate.password}")
|
||||
private String password;
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public UsedRestAPI serviceCalculate() {
|
||||
GenericConnexionConfiguration swimmingPoolConnexionConfiguration = new GenericConnexionConfiguration(url, username, password);
|
||||
|
||||
return swimmingPoolConnexionConfiguration.getGenericRestAPI();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package org.chtijbug.swimmingpool.web;
|
||||
|
||||
import org.springframework.web.filter.CharacterEncodingFilter;
|
||||
|
||||
import javax.servlet.annotation.WebFilter;
|
||||
import javax.servlet.annotation.WebInitParam;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Date: 20/10/14
|
||||
* Time: 09:27
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
@WebFilter(urlPatterns = {"/*"}, filterName = "CharacterEncodingFilter", initParams = {
|
||||
@WebInitParam(name = "encoding", value = "UTF-8"),
|
||||
@WebInitParam(name = "forceEncoding", value = "true"),
|
||||
})
|
||||
public class CharacterUTF8EncodingFilter extends CharacterEncodingFilter {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,19 +15,15 @@
|
|||
*/
|
||||
package org.chtijbug.swimmingpool.web;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
@Controller
|
||||
public class HomeController {
|
||||
|
||||
|
||||
@SpringBootApplication
|
||||
public class SwimmingPoolWebUIApplication {
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SwimmingPoolWebUIApplication.class, args);
|
||||
@RequestMapping("/")
|
||||
public String home() {
|
||||
return "index";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.swimmingpool.web;
|
||||
|
||||
|
||||
import org.chtijbug.drools.generic.restclient.rest.UsedRestAPI;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.training.leisure.swimmingpool.Quote;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Date: 08/10/14
|
||||
* Time: 10:37
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/quote")
|
||||
public class QuoteController {
|
||||
@Resource
|
||||
private UsedRestAPI serviceCalculate;
|
||||
|
||||
@RequestMapping(value = "/calculate/{containerId:.+}/{className:.+}", method = RequestMethod.PUT)
|
||||
public Quote storeTicket(@PathVariable("containerId") String containerid,
|
||||
@PathVariable("className") String className,
|
||||
@RequestBody Quote quoteRequest) {
|
||||
Quote response = null;
|
||||
try {
|
||||
// response = (Quote) serviceCalculate.runSession(containerid, "swimmingpool.P000", Quote.class.getCanonicalName(), quoteRequest);
|
||||
response = (Quote) serviceCalculate.runSession(containerid, "swimmingpool.P000", className, quoteRequest);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.swimmingpool.web;
|
||||
|
||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
||||
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Date: 07/10/14
|
||||
* Time: 14:07
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class WebInitializer extends SpringBootServletInitializer {
|
||||
@Override
|
||||
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
|
||||
return application.sources(Application.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* Copyright 2014 Pymma Software
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.chtijbug.swimmingpool.web.controller;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.client.RequestCallback;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
import org.training.leisure.swimmingpool.Quote;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Created by IntelliJ IDEA.
|
||||
* Date: 08/10/14
|
||||
* Time: 10:37
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/quote")
|
||||
public class QuoteController {
|
||||
private static Logger logger = LoggerFactory.getLogger(QuoteController.class);
|
||||
@Value("${url.swimmingpool.calculate}")
|
||||
private String urlCalcul;
|
||||
private RestTemplate restTemplateKieServer = new RestTemplate();
|
||||
private ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
@RequestMapping(value = "/calculate/{containerId:.+}", method = RequestMethod.PUT)
|
||||
public Quote storeTicket(@PathVariable("containerId") String containerid,
|
||||
@RequestBody Quote quoteRequest) {
|
||||
Quote responseMoteur=null;
|
||||
try {
|
||||
|
||||
String completeurl = urlCalcul+"/"+containerid;
|
||||
logger.info("url moteur reco : " + completeurl);
|
||||
ResponseEntity<Quote> response = restTemplateKieServer
|
||||
.execute(completeurl, HttpMethod.PUT, requestCallback(quoteRequest), clientHttpResponse -> {
|
||||
Quote extractedResponse = null;
|
||||
if (clientHttpResponse.getBody() != null) {
|
||||
Scanner s = new Scanner(clientHttpResponse.getBody()).useDelimiter("\\A");
|
||||
String result = s.hasNext() ? s.next() : "";
|
||||
extractedResponse = mapper.readValue(result, Quote.class);
|
||||
}
|
||||
ResponseEntity<Quote> extractedValue = new ResponseEntity<>(extractedResponse, clientHttpResponse.getHeaders(), clientHttpResponse.getStatusCode());
|
||||
return extractedValue;
|
||||
});
|
||||
Quote reponseMoteur = null;
|
||||
if (response.getBody() != null) {
|
||||
reponseMoteur = response.getBody();
|
||||
} else {
|
||||
reponseMoteur = quoteRequest;
|
||||
}
|
||||
return reponseMoteur;
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return responseMoteur;
|
||||
}
|
||||
private RequestCallback requestCallback(final Quote updatedInstance) {
|
||||
return clientHttpRequest -> {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
mapper.writeValue(clientHttpRequest.getBody(), updatedInstance);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
|
||||
clientHttpRequest.getHeaders().add(
|
||||
HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
log4j.rootLogger=debug, stdout
|
||||
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stdout.Target=System.out
|
||||
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stdout.layout.ConversionPattern=%t %-5p %c{2} - %m%n
|
||||
|
|
@ -66,8 +66,8 @@ productManagerModule.controller('quoteManagerController', function ($scope, $htt
|
|||
$scope.productSearch = "";
|
||||
$http.defaults.headers.post["Content-Type"] = "application/json";
|
||||
$scope.allSessionExecutionDetails = [];
|
||||
$scope.containerid = "dev-pymma-nautic";
|
||||
$scope.aClassName = "";
|
||||
$scope.containerid = "dev";
|
||||
$scope.aClassName = "org.training.leisure.swimmingpool.Quote";
|
||||
var _lastGoodResult = '';
|
||||
$scope.toPrettyJSON = function (objStr, tabWidth) {
|
||||
try {
|
||||
|
|
@ -107,7 +107,7 @@ productManagerModule.controller('quoteManagerController', function ($scope, $htt
|
|||
|
||||
$scope.calculatePrice = function () {
|
||||
var myQuote = $scope.quote;
|
||||
$http.put(urlBase + "/quote/calculate/" + $scope.containerid, myQuote).success(function (data) {
|
||||
$http.put(urlBase + "/swimmingpool-web/quote/calculate/" + $scope.containerid + "/" + $scope.aClassName, myQuote).success(function (data) {
|
||||
$scope.quoteResult = data;
|
||||
$scope.allSessionExecutionDetails = JSON.parse(data.sessionLogging);
|
||||
$scope.sessionLogging = JSON.stringify($scope.allSessionExecutionDetails, null, 3);
|
||||
|
|
|
|||
Loading…
Add table
editor.link_modal.header
Reference in a new issue