Skip to main content

Any ideas why Workspace is telling me that there is an error on my Process... It says "Smartobject is empty"

 

I'm using K2 Studio with a simple Workflow to access a Smartobject as follows:

 

Smartobject Name: Tester1

Method: Read

Input: ItemID (text), UserID (text), Acceptedby (text)

Return: String (Text)

 

I've populated all these in my Workflow with datafields and have checked that the input items all are populated, but it still fails with "Smartobject is empty"...

 

What am i doing wrong?

 

 

Hi, a read or a load will normally just take the Primary Key (ID) as input, which is a single value, not 2.

 

Also, K2 Studio is datatype sensitive so you could try using an Inline function converter to convert the ItemID (text) to Integer and let that be the only input. 

 

 


The input needs the ItemID and the UserID for input, these two fields are what get updated by the read method....

 

If i send an empty field to to the UserID input, there are no errors. If i send a UserID, thats when i get the error.

 

P.S. This is using a Webservice Method


Can you test this smartobject with the Smartobject tester and get a value? If you can get a value with the tester and not in K2 studio then I would suggest you raise a support ticket with K2, but if you cannot get a value with the SmartObject tester then maybe you should look at the web service again. 

 

Have you tested the web service on it's own to verify you are getting the right values?


Hi Latte, firstly thanks for your replies

 

I've done some more testing.

 

1) The web service tests are fine and it works. It returns a value of true

 

2) The SM ObjectTester returns no property

 

3) I delved a bit deeper and have found that (using K2 form and Workflow) if the web service RETURNS an empty string, that is what causes the error

If the RETURN string contains something, then it works...

 

Why would K2 say the Smartobject is Empty in this case? Why does it insist on their being a value in the RETURN string?

 

I spoke with the Web Service dev guy, he said it is common to have a return value of "empty" if the web service process was fine, a return string only contains anything if there is an error.

 

So why can't K2 handle an empty return string from a Web Service???? it says in Workspace "smartobject is empty"

 

 

 

 


Not sure why K2 is doing this but I've found sometimes that I need to add data to return fields for the SMO to work, again don't ask me why. 

 

You could set the return field to a default value and use this value as the 'other' value for your web service. If the SMO call returns a value then your default value will be overwritten, that could work. 


Hi Latte,

 

I asked the Web Service guys to put a default value in for when its empty, but they refuse to, because the web service will be used elsewhere.

Why isn't K2 able to handle an empty return value?

 

This is the first time i've used a web service and its proving to be a right nightmare.

 

Is there a way to intercept the return web value and if its NULL, change it to a text value such as "success" from the K2 side?

 

P.S. The Webservice was created as a Dynamic Web Service in K2 Workspace, could that have any bearing?


Hi, you would normally add it as a Dynamic Webservice. How did you create the SMO from the Service object, was it from the SMO Tester or with K2 Designer or K2 Studio? 

 

Does the Output string appear as a return property or as an Input property or does it appear twice? Can you send a screenshot of the Service Object Bindings? 

 

 


Think i managed to get it working. I altered the smartobject and k2 allowed me to change it from a Read Method to List method.

No error now, seems to work.

 

Thanks all


Reply