Skip to content

Commit

Permalink
Autowire process service
Browse files Browse the repository at this point in the history
  • Loading branch information
wcgunter committed Feb 16, 2024
1 parent 2f310e0 commit abb2a46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cws-tasks/src/main/java/jpl/cws/task/CwsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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

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

@Autowired private ProcessService cwsProcessService;

public static final String UNEXPECTED_ERROR = "unexpectedError";

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

0 comments on commit abb2a46

Please sign in to comment.