Skip to content

Commit 77d8d6a

Browse files
TypeScript API improvements - make optional params, add exchange property APIs (#4226)
* make really optional API params which are optional Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> * add exchange property APIs for IntegrationMessage Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> * reduce logging Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> * reduce logging Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> * BPMStarterTemplateIT.java add waitUntilProcessIdDeployed Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> * rename Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com> --------- Signed-off-by: Iliyan Velichkov <velichkov.iliyan@gmail.com>
1 parent 11d36a4 commit 77d8d6a

File tree

6 files changed

+38
-4
lines changed

6 files changed

+38
-4
lines changed

components/api/api-bpm/src/main/java/org/eclipse/dirigible/components/api/bpm/BpmFacade.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public void afterPropertiesSet() throws Exception {
5353
*
5454
* @return the BPM engine object
5555
*/
56-
public static final Object getEngine() {
56+
public static final BpmProviderFlowable getEngine() {
5757
return BpmFacade.get()
5858
.getBpmProviderFlowable();
5959
}

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/db/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export function getProductName(datasourceName) {
8484
return productName;
8585
};
8686

87-
export function getConnection(datasourceName: string | undefined) : Connection {
87+
export function getConnection(datasourceName?: string | undefined) : Connection {
8888
var native;
8989
if (datasourceName) {
9090
native = DatabaseFacade.getConnection(datasourceName);

components/api/api-modules-javascript/src/main/resources/META-INF/dirigible/modules/src/http/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
const HttpClientFacade = Java.type("org.eclipse.dirigible.components.api.http.HttpClientFacade");
1818

1919
export class HttpClient {
20-
get(_url, options) {
20+
get(_url, options?) {
2121
let url = buildUrl(_url, options);
2222
let opts = '{}';
2323
if (options) {
@@ -111,4 +111,4 @@ export const put = httpClient.put;
111111
export const patch = httpClient.patch;
112112
export const head = httpClient.head;
113113
export const trace = httpClient.trace;
114-
export const del = httpClient.delete;
114+
export const del = httpClient.delete;

components/engine/engine-camel/src/main/java/org/eclipse/dirigible/components/engine/camel/invoke/IntegrationMessage.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,25 @@ public Map<String, Object> getHeaders() {
6666
return message.getHeaders();
6767
}
6868

69+
public Object getHeader(String headerName) {
70+
return message.getHeader(headerName);
71+
}
72+
73+
public void setExchangeProperty(String propertyName, Object propertyValue) {
74+
message.getExchange()
75+
.setProperty(propertyName, propertyValue);
76+
}
77+
78+
public Object getExchangeProperty(String propertyName) {
79+
return message.getExchange()
80+
.getProperty(propertyName);
81+
}
82+
83+
public Map<String, Object> getExchangeProperties() {
84+
return message.getExchange()
85+
.getProperties();
86+
}
87+
6988
/**
7089
* Sets the headers.
7190
*

tests/tests-integrations/src/test/java/org/eclipse/dirigible/integration/tests/ui/tests/BPMStarterTemplateIT.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
package org.eclipse.dirigible.integration.tests.ui.tests;
1212

1313
import ch.qos.logback.classic.Level;
14+
import org.eclipse.dirigible.components.api.bpm.BpmFacade;
1415
import org.eclipse.dirigible.tests.FormView;
1516
import org.eclipse.dirigible.tests.IDE;
1617
import org.eclipse.dirigible.tests.WelcomeView;
@@ -82,6 +83,8 @@ void testCreateProjectFromTemplate() {
8283
workbench.clickPublishAll();
8384
ide.assertPublishedAllProjectsMessage();
8485

86+
waitUntilProcessIsDeployed();
87+
8588
browser.openPath(TRIGGER_PROCESS_FORM_PATH);
8689
browser.enterTextInElementById(PARAM_1_ID, PARAM_1_VALUE);
8790
browser.enterTextInElementById(PARAM_2_ID, PARAM_2_VALUE);
@@ -91,4 +94,14 @@ void testCreateProjectFromTemplate() {
9194
.until(() -> consoleLogAsserter.containsMessage(EXPECTED_TASK_LOGGED_MESSAGE, Level.INFO));
9295
}
9396

97+
private void waitUntilProcessIsDeployed() {
98+
await().atMost(25, TimeUnit.SECONDS)
99+
.until(() -> BpmFacade.getEngine()
100+
.getProcessEngine()
101+
.getRepositoryService()
102+
.createDeploymentQuery()
103+
.deploymentKeyLike("%" + TEST_PROCESS + "%")
104+
.count() == 1);
105+
}
106+
94107
}

tests/tests-integrations/src/test/resources/logback-test.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,7 @@
7171
</root>
7272

7373
<logger name="org.eclipse.dirigible.components.base.synchronizer.BaseSynchronizer" level="INFO"/>
74+
<logger name="org.eclipse.dirigible.components.base.logging.TenantConverter" level="INFO"/>
75+
<logger name="org.eclipse.dirigible.components.base.spring.BeanProvider" level="INFO"/>
7476

7577
</configuration>

0 commit comments

Comments
 (0)