Skip to content

Commit

Permalink
Remake context?
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgunter committed Feb 16, 2024
1 parent d4cbdac commit b6b5eee
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cws-tasks/src/main/java/jpl/cws/task/CwsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

import jpl.cws.core.service.ProcessService;
import jpl.cws.core.service.SpringApplicationContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;

/**
* Abstract base class for all CWS built-in (and custom user-added) task
Expand All @@ -22,8 +20,6 @@
*/
public abstract class CwsTask implements JavaDelegate {

@Autowired
ApplicationContext context;
public static final String UNEXPECTED_ERROR = "unexpectedError";

protected final CwsTaskLogger log = new CwsTaskLogger(this.getClass().getName());
Expand Down Expand Up @@ -123,7 +119,8 @@ private void notifyWorkerOfFailedProcess() {
// complete in Camunda before we can look at Camunda's records
// to get the true status of the process instance.
TimeUnit.SECONDS.sleep(2);
ProcessService cwsProcessService = (ProcessService) context.getBean("cwsProcessService");
SpringApplicationContext applicationContext = new SpringApplicationContext();
ProcessService cwsProcessService = (ProcessService) SpringApplicationContext.getBean("cwsProcessService");
cwsProcessService.sendProcEventTopicMessageWithRetries(null, null, null, null, "sync");
} catch (InterruptedException e) {
e.printStackTrace();
Expand Down

0 comments on commit b6b5eee

Please sign in to comment.