Skip to content

Commit

Permalink
Merge 856985f into 6abbc34
Browse files Browse the repository at this point in the history
  • Loading branch information
Edvard Fonsell committed May 22, 2019
2 parents 6abbc34 + 856985f commit 5675394
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 26 deletions.
35 changes: 19 additions & 16 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

**Highlights**
- Added `started` timestamp to workflow instance table (requires database update)
- Deprecated WorkflowInstanceInclude.STARTED enum value
- Deprecated `AbstractWorkflowExecutorListener`, use `WorkflowExecutorListener` instead

**Details**
- `nflow-engine`
- Add started timestamp to workflow instance table. This makes the instance queries much faster when instances have lots of actions, as there is no need to join the nflow_workflow_action table to the query anymore.
- Deprecated WorkflowInstanceInclude.STARTED enum value. This is not needed anymore, since the started timestamp is always read from the database when the instance is loaded.
- Moved default implementations for `WorkflowExecutorListener` interface methods from the abstract class to the interface.

## 5.6.0 (2019-05-21)

Expand All @@ -15,9 +18,9 @@

**Details**
- Dependency and plugin updates:
- spring 5.1.6.RELEASE
- reactor.netty 0.8.6.RELEASE
- jetty 9.4.17.v20190418
- spring 5.1.6.RELEASE
- reactor.netty 0.8.6.RELEASE
- jetty 9.4.17.v20190418
- `nflow-engine`
- Retry workflow state processing until all steps in nFlow-side are executed successfully. This will prevent workflow instances from being locked in `executing` status, if e.g. database connection fails after locking the instance and before querying the full workflow instance information (`WorkflowStateProcessor`).
- Fix #306: create empty ArrayList with default initial size.
Expand Down Expand Up @@ -57,19 +60,19 @@ This release introduced issue #306 which may cause OutOfMemory errors while fetc
Earlier lodash versions had this security vulnerability: https://nvd.nist.gov/vuln/detail/CVE-2018-16487
- Use select distinct when getting preserved actions while cleaning workflow instance history
- Dependency and plugin updates:
- slf4j 1.7.26
- spring 5.1.5.RELEASE
- hamcrest 2.1
- reactor.netty 0.8.5.RELEASE
- swagger 1.5.22
- mockito 2.24.5
- io.dropwizard.metrics 4.0.5
- mysql-connector-java 8.0.15
- mssql-jdbc 7.2.1.jre8
- hikaricp 3.3.1
- maven-surefire 2.22.1
- jetty 9.4.15.v20190215
- h2 1.4.199
- slf4j 1.7.26
- spring 5.1.5.RELEASE
- hamcrest 2.1
- reactor.netty 0.8.5.RELEASE
- swagger 1.5.22
- mockito 2.24.5
- io.dropwizard.metrics 4.0.5
- mysql-connector-java 8.0.15
- mssql-jdbc 7.2.1.jre8
- hikaricp 3.3.1
- maven-surefire 2.22.1
- jetty 9.4.15.v20190215
- h2 1.4.199
- Fix workflow history cleanup to keep the actions that hold the latest values of state variables
- nFlow Explorer: Custom content to workflow definition and workflow instance pages.
- nFlow Explorer: Executors page to use standard time formatting in tooltips
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import io.nflow.engine.internal.workflow.StateExecutionImpl;
import io.nflow.engine.internal.workflow.WorkflowInstancePreProcessor;
import io.nflow.engine.internal.workflow.WorkflowStateMethod;
import io.nflow.engine.listener.AbstractWorkflowExecutorListener;
import io.nflow.engine.listener.ListenerChain;
import io.nflow.engine.listener.WorkflowExecutorListener;
import io.nflow.engine.listener.WorkflowExecutorListener.ListenerContext;
Expand Down Expand Up @@ -347,7 +346,7 @@ public NextAction next(ListenerContext context) {
}
}

private class ProcessingExecutorListener extends AbstractWorkflowExecutorListener {
private class ProcessingExecutorListener implements WorkflowExecutorListener {
private final WorkflowInstance instance;
private final AbstractWorkflowDefinition<? extends WorkflowState> definition;
private final StateExecutionImpl execution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
/**
* AbstractWorkflowExecutorListener implement WorkflowExecutorListener with no-op/defaults
* method implementations. A subclasses can override just the methods it is interested in.
* @deprecated Implement WorkflowExecutorListener (which has default implementations) instead.
*/
@Deprecated
public abstract class AbstractWorkflowExecutorListener implements WorkflowExecutorListener {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/**
* WorkflowExecutorListener is a global, stateless listener for workflow
* executors.
* executors. The interface contains default (no-op) method implementations.
* <p>
* Same instance of WorkflowExecutorListener is used for all workflow
* state executions: all state must be stored in <code>ListenerContext.data</code>.
Expand Down Expand Up @@ -82,7 +82,9 @@ public ListenerContext(AbstractWorkflowDefinition<?> definition, WorkflowInstanc
* affect workflow processing.
* @param listenerContext The listener context.
*/
void beforeProcessing(ListenerContext listenerContext);
default void beforeProcessing(ListenerContext listenerContext) {
// no-op
}

/**
* Processing chain.
Expand All @@ -104,20 +106,27 @@ public ListenerContext(AbstractWorkflowDefinition<?> definition, WorkflowInstanc
* @param chain The listener chain.
* @return NextAction
*/
NextAction process(ListenerContext listenerContext, ListenerChain chain);
default NextAction process(ListenerContext listenerContext, ListenerChain chain) {
return chain.next(listenerContext);
}

/**
* Executed after state has been successfully processed and before persisting
* state. Exceptions are logged but they do not affect workflow processing.
* @param listenerContext The listener context.
*/
void afterProcessing(ListenerContext listenerContext);
default void afterProcessing(ListenerContext listenerContext) {
// no-op
}

/**
* Executed after state processing has failed and before persisting state.
* Exceptions are logged but they do not affect workflow processing.
* @param listenerContext The listener context.
* @param throwable The exception thrown by the state handler method.
*/
void afterFailure(ListenerContext listenerContext, Throwable throwable);
default void afterFailure(ListenerContext listenerContext, Throwable throwable) {
// no-op
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.codahale.metrics.Timer.Context;

import io.nflow.engine.internal.dao.ExecutorDao;
import io.nflow.engine.listener.AbstractWorkflowExecutorListener;
import io.nflow.engine.listener.WorkflowExecutorListener;

/**
* Compute following metrics on per state basis
Expand All @@ -19,8 +19,7 @@
* <li>Retry count histograms</li>
* </ul>
*/
public class MetricsWorkflowExecutorListener extends
AbstractWorkflowExecutorListener {
public class MetricsWorkflowExecutorListener implements WorkflowExecutorListener {
private static final String EXECUTION_KEY = "nflow-metrics-execution";
private final MetricRegistry metricRegistry;
private final String nflowExecutorGroup;
Expand Down

0 comments on commit 5675394

Please sign in to comment.