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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

OData - CompleteWorkitem returns the error "This task cannot be updated..."

xolomon
14-Alexandrite

OData - CompleteWorkitem returns the error "This task cannot be updated..."

Dear all,

 

I have a question regarding completing the work items. I have a work item which includes a custom EnumeratedType attribute "MySize". 

 

xolomon_0-1702374258679.png

When I try to complete the activity using the OOTB Endpoint from Workflow Domain, I am getting an error that the enumerated type is not supported like below:

 

"This task cannot be updated.Variable type ext.dropdown.MySize is  not supported."

 

xolomon_1-1702374687893.png

URL: {{baseUrl}}/WorkItems('{{WorkItemId}}')/PTC.Workflow.CompleteWorkitem

Request Body: 

{
    "AutomateFastTrack"false,
    "UserEventList": ["Yes"],
    "VoteAction""",
    "WorkitemComment""Dummy",
     "Variables":[{
        "Name":"MySize",
        "Value":"Small",
        "TypeName":"ext.dropdown.MySize",
        "DisplayName":"MySize"
    }]
}
Does anybody have a solution / workaround regarding this? 

 

Thanks in advance!

ACCEPTED SOLUTION

Accepted Solutions
HelesicPetr
22-Sapphire I
(To:xolomon)

Hi @xolomon 

I can see just only one workaround.

extends existing site, with own custom REST API function that does exactly what you need.

PetrH

View solution in original post

13 REPLIES 13
HelesicPetr
22-Sapphire I
(To:xolomon)

Hi @xolomon 

Be careful if you use display value or the internal value of the enumeration. 

I guess that you should use the internal value.

And the question of the day, Is the internal value real;y "Small" ? 

PetrH 

xolomon
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr,

 

thanks for the remark, I have been trying with both internal and external values. But unfortunately this is not the main problem.  It seems that OOTB only allows primitive, string and date variables in this area. 

 

Cheeers,

Xolomon

HelesicPetr
22-Sapphire I
(To:xolomon)

@xolomon 

Then it seams that the RestApi method do not support the custom enumerations,

PetrH

xolomon
14-Alexandrite
(To:HelesicPetr)

Does anybody have similar use case and any workaround idea?

HelesicPetr
22-Sapphire I
(To:xolomon)

Hi @xolomon 

I can see just only one workaround.

extends existing site, with own custom REST API function that does exactly what you need.

PetrH

xolomon
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr,

 

I have prepared already the custom endpoint in parallel for this purpose, but I would like know if someone had an idea without custom endpoint. My intention is to avoid customizations but if this is the only way then I have to provide the solution with the customization. We might report this as a product idea because it is such a basic functionality which could be supported with OOTB endpoints... 

 

Thanks.  

HelesicPetr
22-Sapphire I
(To:xolomon)

Hi @xolomon 

I understand your view to do not customize system, but in many situations it is not possible. 

For example customer needs a solution today not next year or in next five years

 

An IDEA is good way but it is long way and you are not sure if the idea would be implemented next year or next decade.

 

PetrH 

We wanted to add dropdown lists on a task in the past. I believe there was some PTC license restriction that prevents it OOTB. 

Hi @joe_morton 

This is first time, I hear that PTC restricts customization by some licence. 

I believe that ext.dropdown.MySize is a wokrkflow variable that is set to use dropdown values by article CS36017 - How to create a drop down list in a workflow instance task detail page of Windchill 

So this is supported customization. 

 

PetrH

xolomon
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr and @joe_morton,

 

thanks for your messages. The example that I have provided was exactly based on the article mentioned by @HelesicPetr for the discussion. The real life example is similar to the example but with customer specific enumeration. I also think that it is a supported customization as the example was provided us by the technical support. 

 

HelesicPetr
22-Sapphire I
(To:xolomon)

Yes, it is supported,

But the RestAPI method does not allow you to set that custom variable. 

Try to close the task without the variable definition. 

PetrH

xolomon
14-Alexandrite
(To:HelesicPetr)

Hi @HelesicPetr,

 

the use case is not only about closing the task. This information has to be set from Thingworx for the further processes. So I don't see any other option than implementing the custom REST Endpoint. 

 

Thanks for your contributions. 

HelesicPetr
22-Sapphire I
(To:xolomon)

I understand. 

As I've written, If the function does not work as you expect you need to customize it. 

PetrH

Announcements

Top Tags