类中的变量值未正确加载

时间:2017-07-10 14:04:45

标签: java string variables global-variables

下面是我的代码片段,这段代码将从具有所需输入参数的工作项调用。我遇到的问题是ExcpStatus变量的值未正确加载,我的工作项有时会失败并且值finalOpStatus将失败,使得ExcpStatus的值为YES。如果我第二次调用此代码(在ExcpStatus更改为YES之后),则应将ExcpStatus的值重新加载为NO,但它需要先前更改的值YES ... Can有人帮助我......

     public abstract class SampleWorkItemHandler implements WorkItemHandler {

                public SampleWorkItemHandler()
                    {
                        this.sb_serviceTaskName="default";
                    }

                    public SampleWorkItemHandler(String taskName)
                    {
                        this.sb_serviceTaskName=taskName;
                    }
                    protected String ExcpStatus="NO";
                    protected String loggerCorrelationId = "";
                    private String  startLoggerInsertStr="";
               public void executeWorkItem(WorkItem workitem, WorkItemManager manager) {
            try{
                logger.info("the exception staus is::"+ExcpStatus);
                logger.info("the loggerCorrelationId is::"+loggerCorrelationId);
                String finalOpStatus=SyntBotsBPMOutputValidatorUtil.validateResponse(handlerResponseParams);
                if(finalOpStatus.equalsIgnoreCase("Fail"))
                {
                    ExcpStatus="YES";
                }
              }catch(Exception e){
              System.out.println("Exception Stack Trace:::"+e.getMessage());
       }
   }

0 个答案:

没有答案