You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the flow for using the content field of an LHTaskException is confusing and hard to discover for new users.
Using LHTaskExceptioncontent
First, throw an LHTaskException in a given Task when necessary with an argument for content:
@LHTaskMethod("my-task")
publicStringmyTask() {
// ...VariableValuemyContent = LHLibUtil.objToVarVal("Some content that you want to pass around into other Tasks")
thrownewLHTaskException("task-failed", "Human readable message", myContent);
}
Now, within your workflow definition, add an exception handler which does something with that content:
NodeOutputmyTaskOutput = wf.execute("my-task");
wf.handleException(myTaskOutput,
"task-failed",
handler -> {
// You have to define a variable with a specific name to access that contentWfRunVariablecontent = handler.declareStr(WorkflowThread.HANDLER_INPUT_VAR);
// Now you can pass that content into other Tasks and do things with it from within this threadhandler.execute("another-task", content);
}
);
Possible Improvements
Users have to convert the LHTaskException content to a VariableValue on their own.
Remedy: We can add another method signature that takes in an Object for the content field and converts it internally
Users have to discover the HANDLER_INPUT_VAR variable on their own and declare a variable for it
Remedy: Unknown
Users may be confused that their human-readable LHTaskException.message is different than the LHTaskException.content
Remedy: If content isn't passed in, can we use the message as the content as well?
We can also improve documentation to improve the UX around this feature.
Opening the discussion
How can we improve UX of using LHTaskException content within an Exception Handler?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, the flow for using the
content
field of anLHTaskException
is confusing and hard to discover for new users.Using
LHTaskException
content
First, throw an
LHTaskException
in a given Task when necessary with an argument forcontent
:Now, within your workflow definition, add an exception handler which does something with that content:
Possible Improvements
LHTaskException
content to aVariableValue
on their own.Object
for the content field and converts it internallyHANDLER_INPUT_VAR
variable on their own and declare a variable for itLHTaskException.message
is different than theLHTaskException.content
content
isn't passed in, can we use themessage
as thecontent
as well?We can also improve documentation to improve the UX around this feature.
Opening the discussion
How can we improve UX of using LHTaskException content within an Exception Handler?
Beta Was this translation helpful? Give feedback.
All reactions