Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X
Hi Community,
I created a new flow by clicking new template from the templates page. But the flow gets stuck at the first step and gives an error that it should not give, what could be the reason for this? Even though I defined all the parameters correctly, nothing changed.
Code:
wt.doc.WTDocument doc = (wt.doc.WTDocument) primaryBusinessObject;
docNumber=doc.getNumber();
docName=doc.getName();
Error:
wt.workflow.engine.FailedExpressionException: wt.util.WTException: java.lang.NullPointerException
Nested exception is: java.lang.NullPointerException
Nested exception is: wt.util.WTException: java.lang.NullPointerException
Nested exception is: java.lang.NullPointerException
Hi @smcvr
You should be sure that the primaryBusinessObject is not null and also is the correct type.
PetrH
Hi @HelesicPetr
Yes, I am sure. When I try it with another previously created workflow, it does not give these errors. I think I'm getting this error because I created this with a new template.
Hi @smcvr
In your code something is null(empty, without value), and you need to find what it is.
PetrH
I checked but it still doesn't work.
I'm trying the same type in a different stream, in an existing stream.
The code does not cause the same problem, it works.
When I look at the two streams I don't see any difference.
Is it difficult to create a flow with New Template?
It doesn't import the above attribute values in the newly created stream.
Hi @smcvr
It depands how you configure the template.
In my case I put to the AV CODE value and it is populated during creation.
in your case there can be one very important consequence, where workflow is run before the new document is persisted so the values are not saved that moment. So you could try to add some wait robot at the start of workflow wait for 2 seconds and you would see if the value is persisted or not (saved in DB).
PetrH