Solved

Using a "previous operation commandline output" as input for decision is it acceptable?

  • 14 June 2021
  • 2 replies
  • 76 views

Badge

I want to use a command output of previous operation as condition in decision block instead of exit code.

if Command out put is a string value “No jobs to display”,i want to proceed for next operation,if not i want to close workflow with a append in jobdescription

 

But in decission making when i use a string value it always returns false

 

Log:

 

5206 CommandActivity         : [LastJob (LastJob_1)] command succeeded with result [No jobs to display.]
5206 WorkflowStep            : [LastJob (LastJob_1)] completing activity with status [COMPLETED], outputs [<LastJob_1><system><startTime>1623636233</startTime><endTime></endTime><status>RUNNING</status><timedOut>false</timedOut></system><instance></instance><backupSet>defaultBackupSet</backupSet><subClient>default</subClient><jobStatus></jobStatus><exitCode>0</exitCode><commandOutput>No jobs to display.</commandOutput></LastJob_1>]
5226 SetActivityInputs       : [Decision (Decision_1)] starting activity with inputs [<inputs><expression>xpath:{/workflow/LastJob_1/commandOutput} == "No jobs to display."</expression><scriptType>JAVA</scriptType></inputs>]
5243 DecisionActivity        : [Decision (Decision_1)] result of decision expression is [false]
5243 DecisionActivity        : [Decision (Decision_1)] taking transition [UpdateJobDescription_2] because result [false] matches inputed condition

 

 

Could anyone help me on this

icon

Best answer by Chris Sunderland 14 June 2021, 14:59

View original

2 replies

Userlevel 3
Badge +6

With Java, you need to use the equals method for comparing strings

xpath:{/workflow/LastJob_1/commandOutput}.equals("No jobs to display.")

 

 

Userlevel 5
Badge +8

Hi, 

To really help you will need to upload the xml of the workflow to see what you are trying to pass through. From the log lines it looks as though you want to report of completed jobs only but the job is running so giving a false and thus not displaying the job details.

Blaine

Reply