Common Sections

Some sections that are common across many Record and Work Item web services are ResultList, TransactionResult, Comment History, and Work Item Locking.

ResultList

The <ResultList> element captures the results of the web service. A ‘ResultList’ contains one or more errors, warnings or informational messages. The <ResultList> element can contain one or more <Result> entries. For example:

<ResultList highestSeverity="Error" reference="UOM">
    	<Result severity="Error" code="CAT-1292">
       		<Description lang="en">The UOM is not a valid         value</Description>
     	</Result>
     	<Result severity="Error" code="CAT-1293">
         		<Description lang="en">The UOM has to be a           decimal</Description>
     	</Result>
</ResultList>

In the example, the attribute ‘UOM’ has 2 errors. Each ‘Result’ in the ‘ResultList’ has a ‘code’, ‘severity’ and ‘description’.

Code – is the error code associated with the error.

Severity – can be ‘Error’, ‘Info’ or ‘Warning’.

Description – provides the user a readable description of the error.

TransactionResult

The <TransactionResult> element captures the status of a transaction to let the caller know if the command succeeded or failed.

  • SuccessCount: indicates the number of records successfully processed. A ‘Success’ here does not translate into the successful completion of the command. However, a failure here does mean that the command was aborted. The <TransactionResult> element also captures details such as EventID, EventState, Action, and so on.
  • TotalCount: indicates the total number of records that met the search criteria of the request. This is useful since the user gets only a subset of the actual result set. If you do not specify the search criteria in the request, the total count is not populated, however, the <TotalCount> tag is still displayed in the response.
    <TransactionResult result="Completed">
    	<SuccessCount>1</SuccessCount>
    	<TotalCount>1</TotalCount>
    </TransactionResult>

The following is a sample of the TransactionResult when the execmode is set to SYNCHR.

  • If the workflow is again suspended in another step, that is, another work item:
    <TransactionResult result="Completed">
       <SuccessCount>1</SuccessCount>
       <EventID>115018</EventID>
       <EventStatus>
           <Code>INPROGRESS</Code>
           <Description lang="en">In Progress</Description>
       </EventStatus>
       <EventState>
           <Code>PRODUCTADDINTERNALAPPROVAL</Code>
           <Description lang="en">Internal Approval</Description>
       </EventState>
       <Action>InternalEditWorkItem</Action>
    </TransactionResult>
  • If the workflow completes:
    <TransactionResult result="Completed">
        <SuccessCount>1</SuccessCount>
        <EventID>521859</EventID>
        	<EventStatus>
            <Code>SUCCESS</Code>
            <Description lang="en">Success</Description>
        </EventStatus>
        <EventState>
             <Code>DONE</Code>
            <Description lang="en">Done</Description>
        </EventState>
        <Action>SetStatusToSuccess</Action>
    </TransactionResult>

Comment History

The result also contains the comment history within the workflow, of which the work item is a part. The comment history is represented as an array of comments (‘marray’).

Work Item Locking

For more information, refer to Work Item Lock Service.