Dear all,

i am using YAWL quite since a while. I am building a system which composes the configuration of a surgical operating theatre based on the Task execution on the YAWL engine.
For every task is am using decompositions holding output variables with the name of the subsequent tasks that are allowed and populate the output variables through my Custom service connected to the decomposition.

What i do is using my custom service to check for tasks allowed to be executed in the future. Then i check in the according work item and set the output variables with the name of the subsequent tasks to true. This means that it can happen that there are multiple output variables of a decomposition defined but i only check in one of them.

When i execute this workflow i am getting errors similar to this one:
<failure><reason>Problem with process model. Schema validation failed
Task [fixed_mode_robot_2]
XQuery [null]
Document []
Schema for Expected [<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
<xs:element name="fixed_mode_robot1">
<xs:complexType>
<xs:sequence>
<xs:element name="telemanipulation_bimanual" type="xs:boolean" />
<xs:element name="handson_mode_robot_2" type="xs:boolean" />
<xs:element name="handson_mode_robot_1" type="xs:boolean" />
<xs:element name="trocar_inside_outside_detection_1" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>]
But received [<fixed_mode_robot1>
<telemanipulation_bimanual>false</telemanipulation_bimanual>
<handson_mode_robot_1>true</handson_mode_robot_1>
<handson_mode_robot_2>false</handson_mode_robot_2>
<trocar_inside_outside_detection_1>false</trocar_inside_outside_detection_1>
</fixed_mode_robot1>]
Validation error message [Error: 3:25: cvc-complex-type.2.4.a: Invalid content was found starting with element 'handson_mode_robot_1'. One of '{handson_mode_robot_2}' is expected.
]</reason></failure>

In this example i have am checkin in a work item using the decomposition fixed_mode_robot1 with the variables telemanipulation_bimanual, handson_mode_robot_2, handson_mode_robot_1 and trocar_inside_outside_detection_1.

From the error i can see that obviously the ordering of the output variables is of relevance. However i did not understand why the ordering of the variables in this scope is relevant and how i can fix this error. Is it the duty of the Custom Service to check in all variables of a workitem and i am using the mechanisms wrong when i simply checkin one variable? Does the Custom service have to know which are the available output variables by design or is there a way to allow the custom service to query the necessary output variables from the engine?

Thank you in advance,

Tim

I didn't have the time to look at your topic in more depth. The only thing that struck me was that your XSD complex type is a sequence and the order of robot1 and robot2 are not specified in the same order as in your XML value. That might explain the error. You could probably use xs:all instead of xs:sequence to fix that.

Thank you for your answer. This seams to be exactly he problem. In fact i didn't implement the sequence by hand but used the YAWL editor for this task (2.3.5). Is there a way to define the outpute variables in the editor as xs:all instead of xs:sequence? (i recently ported to YAWL-3.0.1)
Thank you in advance,

Tim

to clarify
When i add output variables to the editor they have an order in the editor.
In the .yawl file this is represented using an index. Obviously every decomposition is interpreted as complex type with an included sequence using the ordering of the variables in the yawl file. The question is: how can i make the engine neglect the ordering?

thank you,
Tim

i now solved the problem by using a single variable where i put comma seperated values and use the XPATH query contains to check which results in a cleaner set of task variables, net variables and a lower number of decompositions. Thank you for your help

I am glad you could solve the problem. Your project sounds interesting. When it is in the right state and if you are able to say something about it, we would be glad to mention this in our project section of the forum.