AnsweredAssumed Answered

Regarding CustomResult

Question asked by chandarvr on Apr 17, 2015
Latest reply on May 15, 2015 by chandarvr

I am using a custom result option from evaluate expression [other than success and failure] based on some condition after evaluation

 

My preexecution is code is pasted below ,where in am trying to validate few variables and i need to call different operators based on two conditions

 

1) If requestuser is not present i will be update a file

2) else i will update a db

3) else if no errors call runssh operator

In the customport i added the expression (Process.errorlog == true) .


When i execute the process i am seeing that both paths are getting executed


1) Operator linked to Custom port created

2) runssh operator

 

[code]

Process.errorFlag=true;

Process.FailureMessage="";

Process.errorlog=false;


if (!Process.requestuser){

  Process.FailureMessage ="common";

  Process.errorlog=true;

  setOperatorStatus("success", 0, Process.FailureMessage);

}else{

  if (!Process.Name){

  Process.FailureMessage +="Name is missing\n";

  Process.errorFlag=false;

  }

  if ((Process.FailureMessage != "") && (Process.errorlog!=true)){

     setOperatorStatus("Failure", 4, Process.FailureMessage);

  }

}

[/code]

Outcomes