Skip to content

Commit

Permalink
[JBPM-9900] RequestInfo.owner is null even if org.kie.executor.id is …
Browse files Browse the repository at this point in the history
…defined
  • Loading branch information
elguardian committed Oct 8, 2021
1 parent b83fb68 commit 845abf6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kie-api/src/build/revapi-config.json
Expand Up @@ -32,8 +32,17 @@
"methodName": "setAccumulateNullPropagation",
"elementKind": "method",
"justification": "configuration switch for allowing null propagation in accumulate"
},
{
"code": "java.method.addedToInterface",
"new": "method java.util.List<org.kie.api.executor.RequestInfo> org.kie.api.executor.ExecutorStoreService::loadRequestsOlderThan(long)",
"package": "org.kie.api.executor",
"classSimpleName": "ExecutorStoreService",
"methodName": "loadRequestsOlderThan",
"elementKind": "method",
"justification": "[JBPM-9900] RequestInfo.owner is null even if org.kie.executor.id is defined"
}
]
]
}
}
}
Expand Down
Expand Up @@ -22,6 +22,7 @@
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;

import org.kie.api.runtime.manager.RuntimeManagerFactory.Factory;
import org.kie.api.runtime.query.QueryContext;
Expand Down Expand Up @@ -49,6 +50,8 @@ public interface ExecutorService {
*/
public static final String EXECUTOR_ID = IdProvider.get();

public static final Supplier<String> EXECUTOR_ID_GET = () -> IdProvider.get();

List<RequestInfo> getQueuedRequests(QueryContext queryContext);

List<RequestInfo> getCompletedRequests(QueryContext queryContext);
Expand Down Expand Up @@ -135,6 +138,11 @@ public static String get() {
return EXECUTOR_ID;
}

public static synchronized void reset() {
initialized = false;
EXECUTOR_ID = null;
}

private static synchronized String create() {
initialized = true;
String idSystemProperty = System.getProperty("org.kie.executor.id", "default-executor");
Expand Down
Expand Up @@ -30,6 +30,13 @@ public interface ExecutorStoreService {

List<RequestInfo> loadRequests();

/**
* load request that the scheduled timer are older that a certain amount in time units time
* @param olderThan
* @return a list of jobs overdue by certain amount of time
*/
List<RequestInfo> loadRequestsOlderThan(long olderThan);

void persistError(ErrorInfo error);

void updateError(ErrorInfo error);
Expand Down

0 comments on commit 845abf6

Please sign in to comment.