Skip to content

Commit

Permalink
Merge pull request #26 from hisanhunais/subscription-workflow-fix
Browse files Browse the repository at this point in the history
[1.1.x branch] Fix Workflow Issue When Subscribing to a Monetization Enabled API
  • Loading branch information
chamindias authored Jun 2, 2021
2 parents 57d961f + 9853167 commit 6b40eb0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</repositories>

<properties>
<carbon.apimgt.version>6.6.163</carbon.apimgt.version>
<carbon.apimgt.version>6.7.206</carbon.apimgt.version>
<commons.lang.version>2.6</commons.lang.version>
<stripe.version>9.8.0</stripe.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,17 @@ public List<WorkflowDTO> getWorkflowDetails(String workflowStatus) throws Workfl
@Override
public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException {

SubscriptionWorkflowDTO subsWorkflowDTO = (SubscriptionWorkflowDTO) workflowDTO;
workflowDTO.setProperties("apiName", subsWorkflowDTO.getApiName());
workflowDTO.setProperties("apiVersion", subsWorkflowDTO.getApiVersion());
workflowDTO.setProperties("subscriber", subsWorkflowDTO.getSubscriber());
workflowDTO.setProperties("applicationName", subsWorkflowDTO.getApplicationName());
super.execute(workflowDTO);
workflowDTO.setStatus(WorkflowStatus.APPROVED);
WorkflowResponse workflowResponse = complete(workflowDTO);
super.publishEvents(workflowDTO);

return new GeneralWorkflowResponse();
return workflowResponse;
}

/**
Expand Down Expand Up @@ -474,6 +479,8 @@ public MonetizationPlatformCustomer createMonetizationPlatformCutomer(Subscriber
@Override
public WorkflowResponse complete(WorkflowDTO workflowDTO) throws WorkflowException {

workflowDTO.setUpdatedTime(System.currentTimeMillis());
super.complete(workflowDTO);
ApiMgtDAO apiMgtDAO = ApiMgtDAO.getInstance();
try {
apiMgtDAO.updateSubscriptionStatus(Integer.parseInt(workflowDTO.getWorkflowReference()),
Expand Down

0 comments on commit 6b40eb0

Please sign in to comment.