[
https://issues.apache.org/jira/browse/NIFI-5137?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17775814#comment-17775814
]
Anna Nys commented on NIFI-5137:
--------------------------------
I order to test this, I made a random controller service stateful. For
example, take CSVRecordLookupService and do the following:
1. Add class-level annotation:
@Stateful(scopes = Scope.LOCAL, description = "store some state")
2. Create some state in the onEnabled method:
StateManager sm = getStateManager();
Map<String, String> stateMap = Map.of("key", "value");
sm.setState(stateMap, Scope.LOCAL);
3. Add imports:
import org.apache.nifi.annotation.behavior.Stateful;
import org.apache.nifi.components.state.Scope;
import org.apache.nifi.components.state.StateManager;
import org.apache.nifi.components.state.StateMap;
4. build the nifi-lookup-services-nar
(nifi-nar-bundles/nifi-standard-services/nifi-lookup-services-bundle/nifi-lookup-services-nar)
and drop into the installation dir/lib directory and restart nifi.
5. The manage state icon should appear in the controller service grid.
> Cannot clear state of a controller service
> ------------------------------------------
>
> Key: NIFI-5137
> URL: https://issues.apache.org/jira/browse/NIFI-5137
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core UI
> Affects Versions: 1.6.0
> Reporter: Joe Percivall
> Assignee: Anna Nys
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> To reproduce:
> # Start with a controller service that is stopped with some state stored
> # Go to the state manager for that controller service
> # Attempt to click on the "clear state" text but notice that it is disabled
> and doesn't do anything
> Workaround:
> * Start at step 2 (in the state manager)
> * Inspect the page using browser web tools
> * Notice the "class" of the span is "link disabled"
> * Remove the "disabled" class from the span
> * It now behaves as expected
--
This message was sent by Atlassian Jira
(v8.20.10#820010)