Skip to content

Commit

Permalink
TypeScript API improvements - make optional params, add exchange prop…
Browse files Browse the repository at this point in the history
…erty APIs (#4226)

* make really optional API params which are optional

Signed-off-by: Iliyan Velichkov <[email protected]>

* add exchange property APIs for IntegrationMessage

Signed-off-by: Iliyan Velichkov <[email protected]>

* reduce logging

Signed-off-by: Iliyan Velichkov <[email protected]>

* reduce logging

Signed-off-by: Iliyan Velichkov <[email protected]>

* BPMStarterTemplateIT.java add waitUntilProcessIdDeployed

Signed-off-by: Iliyan Velichkov <[email protected]>

* rename

Signed-off-by: Iliyan Velichkov <[email protected]>

---------

Signed-off-by: Iliyan Velichkov <[email protected]>
  • Loading branch information
iliyan-velichkov authored Aug 14, 2024
1 parent 11d36a4 commit 77d8d6a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void afterPropertiesSet() throws Exception {
*
* @return the BPM engine object
*/
public static final Object getEngine() {
public static final BpmProviderFlowable getEngine() {
return BpmFacade.get()
.getBpmProviderFlowable();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export function getProductName(datasourceName) {
return productName;
};

export function getConnection(datasourceName: string | undefined) : Connection {
export function getConnection(datasourceName?: string | undefined) : Connection {
var native;
if (datasourceName) {
native = DatabaseFacade.getConnection(datasourceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
const HttpClientFacade = Java.type("org.eclipse.dirigible.components.api.http.HttpClientFacade");

export class HttpClient {
get(_url, options) {
get(_url, options?) {
let url = buildUrl(_url, options);
let opts = '{}';
if (options) {
Expand Down Expand Up @@ -111,4 +111,4 @@ export const put = httpClient.put;
export const patch = httpClient.patch;
export const head = httpClient.head;
export const trace = httpClient.trace;
export const del = httpClient.delete;
export const del = httpClient.delete;
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@ public Map<String, Object> getHeaders() {
return message.getHeaders();
}

public Object getHeader(String headerName) {
return message.getHeader(headerName);
}

public void setExchangeProperty(String propertyName, Object propertyValue) {
message.getExchange()
.setProperty(propertyName, propertyValue);
}

public Object getExchangeProperty(String propertyName) {
return message.getExchange()
.getProperty(propertyName);
}

public Map<String, Object> getExchangeProperties() {
return message.getExchange()
.getProperties();
}

/**
* Sets the headers.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.eclipse.dirigible.integration.tests.ui.tests;

import ch.qos.logback.classic.Level;
import org.eclipse.dirigible.components.api.bpm.BpmFacade;
import org.eclipse.dirigible.tests.FormView;
import org.eclipse.dirigible.tests.IDE;
import org.eclipse.dirigible.tests.WelcomeView;
Expand Down Expand Up @@ -82,6 +83,8 @@ void testCreateProjectFromTemplate() {
workbench.clickPublishAll();
ide.assertPublishedAllProjectsMessage();

waitUntilProcessIsDeployed();

browser.openPath(TRIGGER_PROCESS_FORM_PATH);
browser.enterTextInElementById(PARAM_1_ID, PARAM_1_VALUE);
browser.enterTextInElementById(PARAM_2_ID, PARAM_2_VALUE);
Expand All @@ -91,4 +94,14 @@ void testCreateProjectFromTemplate() {
.until(() -> consoleLogAsserter.containsMessage(EXPECTED_TASK_LOGGED_MESSAGE, Level.INFO));
}

private void waitUntilProcessIsDeployed() {
await().atMost(25, TimeUnit.SECONDS)
.until(() -> BpmFacade.getEngine()
.getProcessEngine()
.getRepositoryService()
.createDeploymentQuery()
.deploymentKeyLike("%" + TEST_PROCESS + "%")
.count() == 1);
}

}
2 changes: 2 additions & 0 deletions tests/tests-integrations/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@
</root>

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

</configuration>

0 comments on commit 77d8d6a

Please sign in to comment.