[ 
https://issues.apache.org/jira/browse/NIFI-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16257093#comment-16257093
 ] 

ASF GitHub Bot commented on NIFI-4615:
--------------------------------------

Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2276#discussion_r151706697
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
 ---
    @@ -1083,13 +1083,15 @@ public ProcessorStatusDTO 
createProcessorStatusDto(final ProcessorStatus procSta
             dto.setGroupId(procStatus.getGroupId());
             dto.setName(procStatus.getName());
             dto.setStatsLastRefreshed(new Date());
    +        dto.setRunStatus(procStatus.getRunStatus().toString());
    --- End diff --
    
    You cannot just set target.setRunStatus(toMerge.getRunStatus) in case 
target is invalid. I believe you have two options...
    
    1) Duplicate the isValid check
    
            if (RunStatus.Invalid.name().equals(toMerge.getRunStatus())) {
                target.setRunStatus(RunStatus.Invalid.name());
            }
    
    2) Copy the calculated runStatus from the aggregate snapshot
    
            target.setRunStatus(target.getAggregateSnapshot().getRunStatus());


> Processor status is not reported with the API
> ---------------------------------------------
>
>                 Key: NIFI-4615
>                 URL: https://issues.apache.org/jira/browse/NIFI-4615
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Configuration Management
>    Affects Versions: 1.4.0
>            Reporter: Sébastien Bouchex Bellomié
>
> * Start a processor
> * Request its status with the Processor/get/{id] API
> Issue : ProcessorEntity.status.runStatus is always null
> Note : DtoFactory.createProcessorStatusDto do not set the processor status



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to