Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching response through system settings API #8

Draft
wants to merge 3 commits into
base: cbrelease-3.0.1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/org/sunbird/workflow/config/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ public class Configuration {
@Value("${sunbird.user.search.endpoint}")
private String lmsUserSearchEndpoint;

@Value("${workflow.config.endpoint}")
private String workflowConfigEndpoint;

public String getWorkflowConfigEndpoint() {
return workflowConfigEndpoint;
}

public void setWorkflowConfigEndpoint(String workflowConfigEndpoint) {
this.workflowConfigEndpoint = workflowConfigEndpoint;
}

public Integer getDefaultLimit() {
return defaultLimit;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,11 @@ public Response getApplicationHistoryOnWfId(String rootOrg, String wfId, String
public Response getNextActionForState(String rootOrg, String org, String serviceName, String state) {
Response response = new Response();
try {
Workflow workFlow = wfRepo.getWorkFlowForService(rootOrg, org, serviceName);
StringBuilder builder = new StringBuilder();
String endPoint = configuration.getWorkflowConfigEndpoint();
builder.append(configuration.getLexCoreServiceHost()).append(endPoint);
Map<String, Object> configResponse = (Map<String, Object>) requestServiceImpl.fetchResultUsingGet(builder);
Workflow workFlow = (Workflow) configResponse;
WorkFlowModel workFlowModel = mapper.readValue(workFlow.getConfiguration(), WorkFlowModel.class);
WfStatus wfStatus = getWfStatus(state, workFlowModel);
List<HashMap<String, Object>> nextActionArray = new ArrayList<>();
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,5 @@ notify.service.path=v1/notification/send/sync
portal.departmentupdate.path=portal/updateuserroledept

sunbird.learner.service.host=http://learner-service:9000/
sunbird.user.search.endpoint=private/user/v1/search
sunbird.user.search.endpoint=private/user/v1/search
workflow.config.endpoint=api/data/v1/system/settings/get/workFlowConfig