Skip to content

Commit 912e6c1

Browse files
committed
feat: add external adito url parameter (#2063670)
1 parent 249d163 commit 912e6c1

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

modules/adito-data-service/src/main/java/org/flowable/aditoDataService/AditoDeploymentService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public ProcessDeployment deployProcess (String pProcessModelXML)
4242
return null;
4343
}
4444

45-
public String getProcessDefinitionUrl ()
45+
public String getProcessDefinitionUrl()
4646
{
4747
if (disableDeployRedirect)
4848
return null;
49-
return restClientService.getAditoBaseUrl().replace("host.docker.internal", "localhost") + aditoProcessDefinitionUrl;
49+
return restClientService.getAditoExternalUrl().replace("host.docker.internal", "localhost") + aditoProcessDefinitionUrl;
5050
}
5151
}

modules/adito-data-service/src/main/java/org/flowable/aditoDataService/RestClientService.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,29 @@ public class RestClientService
2323
private String aditoBaseUrl = "https://host.docker.internal:8443";
2424
private String aditoUser = "flowableIdmService";
2525
private String aditoPassword = "HczABCxBEUKSmwQEnT8vbmkE8Bj1hcXOKSbsLWBg";
26+
private String aditoExternalUrl;
2627

2728
private WebClient webClient;
2829
private final Logger logger = LoggerFactory.getLogger(RestClientService.class);
2930

30-
public WebClient getWebClient ()
31+
public WebClient getWebClient()
3132
{
3233
return this.webClient;
3334
}
3435

35-
public String getAditoBaseUrl() {
36+
public String getAditoExternalUrl() {
37+
if (aditoExternalUrl != null)
38+
return aditoExternalUrl;
3639
return aditoBaseUrl;
3740
}
3841

39-
public RestClientService (@Value("${aditoUrl:}") String springAditoBaseUrl, @Value("${aditoUser:}") String springAditoUser, @Value("${aditoPassword:}") String springAditoPassword)
42+
public RestClientService(@Value("${aditoUrl:}") String springAditoBaseUrl, @Value("${aditoUser:}") String springAditoUser, @Value("${aditoPassword:}") String springAditoPassword,
43+
@Value("${aditoExternalUrl:}") String springAditoExternalUrl)
4044
{
4145
if (environmentVariablesArePresent())
4246
loadEndpointConfigFromEnvironment();
4347
else if (springVariablesArePresent(springAditoBaseUrl))
44-
loadEndpointConfigFromSpring(springAditoBaseUrl, springAditoUser, springAditoPassword);
48+
loadEndpointConfigFromSpring(springAditoBaseUrl, springAditoUser, springAditoPassword, springAditoExternalUrl);
4549
else
4650
logger.info("Using default core connection configuration");
4751

@@ -87,9 +91,12 @@ private void loadEndpointConfigFromEnvironment()
8791
String password = System.getenv("ADITO_PASSWORD");
8892
if (password != null && !password.isEmpty())
8993
this.aditoPassword = password;
94+
String aditoExternalUrl = System.getenv("ADITO_EXTERNAL_URL");
95+
if (aditoExternalUrl != null && !aditoExternalUrl.isEmpty())
96+
this.aditoExternalUrl = aditoExternalUrl;
9097
}
9198

92-
private void loadEndpointConfigFromSpring(String springAditoBaseUrl, String springAditoUser, String springAditoPassword)
99+
private void loadEndpointConfigFromSpring(String springAditoBaseUrl, String springAditoUser, String springAditoPassword, String springAditoExternalUrl)
93100
{
94101
logger.info("Loading core connection configuration from spring application json");
95102
if (springAditoBaseUrl != null && !springAditoBaseUrl.isEmpty())
@@ -98,6 +105,8 @@ private void loadEndpointConfigFromSpring(String springAditoBaseUrl, String spri
98105
this.aditoUser = springAditoUser;
99106
if (springAditoPassword != null && !springAditoPassword.isEmpty())
100107
this.aditoPassword = springAditoPassword;
108+
if (springAditoPassword != null && !springAditoPassword.isEmpty())
109+
this.aditoExternalUrl = springAditoExternalUrl;
101110
}
102111

103112
public String get(String url, MultiValueMap<String, String> queryParams, Map<String,String> headers)
@@ -118,5 +127,4 @@ protected String get(String url)
118127
{
119128
return get(url, null, null);
120129
}
121-
122130
}

modules/flowable-ui-modeler/flowable-ui-modeler-rest/src/main/java/org/flowable/ui/modeler/rest/app/DeploymentResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public ProcessDeployment deployProcess(@PathVariable String modelId)
2929
}
3030

3131
@GetMapping(value = "/rest/adito-process-definition-url", produces = "text/plain")
32-
public String getAditoProcessDefinitionUrl ()
32+
public String getAditoProcessDefinitionUrl()
3333
{
3434
return aditoDeploymentService.getProcessDefinitionUrl();
3535
}

0 commit comments

Comments
 (0)