Skip to main content
Solved

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


Forum|alt.badge.img

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

Best answer by Chris Sunderland

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

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

 

 

View original
Did this answer your question?

2 replies

Forum|alt.badge.img+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


Forum|alt.badge.img+6

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

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

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings