cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Workflow Creation Error

smcvr
14-Alexandrite

Workflow Creation Error

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

 

5 REPLIES 5
HelesicPetr
22-Sapphire I
(To:smcvr)

Hi @smcvr 

You should be sure that the primaryBusinessObject is not null and also is the correct type.

 

PetrH

smcvr
14-Alexandrite
(To:HelesicPetr)

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.

HelesicPetr
22-Sapphire I
(To:smcvr)

Hi @smcvr 

In your code something is null(empty, without value), and you need to find what it is. 

PetrH

smcvr
14-Alexandrite
(To:HelesicPetr)

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?

 

smcvr_0-1700575967071.png

It doesn't import the above attribute values in the newly created stream.

HelesicPetr
22-Sapphire I
(To:smcvr)

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. 

HelesicPetr_0-1700578122322.png

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

Top Tags