Work Item Modify Close Service - Inputs

Command type

  • Close — Work item is closed. The Command type needs to be set to ‘Modify’, and the entity command qualifier needs to be ‘Close’.
            <Command type="Modify">
          	<Workitem commandqualifier="Close" etype="Entity">  
            <Command type="Modify">
          <Workitem commandqualifier="Close" etype="Entity" execmode="SYNCHR">
            <Command type="Modify">
           <Workitem commandqualifier="Close" etype="Entity" execmode="ASYNCHR">
  • Close/Approve — Work item is approved. The approval data can be specified using custom input parameters. If the 'result' custom parameter is specified, it is ignored.
             <Command type="Modify">
           	<Workitem commandqualifier="Close/Approve" etype="Entity"> 
  • Close/Reject — Work item is rejected. The rejected data can be specified using custom input parameters. If the 'result' custom parameter is specified, it is ignored.
             <Command type="Modify">
             	<Workitem commandqualifier="Close/Reject" etype="Entity"> 

The work items are closed one by one. If any of the work items cannot be closed, it is ignored. The number of closed work items is reported in the results along with the list of errors.

Besides, the ‘Close’ command qualifier, you can also specify the following command qualifiers:

  • CloseAll — Closes all work items based on the specified search criteria. All work items selected using the search criterion are considered for closing. Similar to ‘Close’ , any inputs to actionable work items can be supplied. All closed work items receive same parameters, such as mass approval or rejections.
              <Command type="Modify">
              	<Workitem commandqualifier="CloseAll" etype="Entity">  
  • CloseAll/Approve — Approves all work items based on the specified search criteria except the FormResult custom parameter. If the FormResult custom parameter is specified, it is ignored.
            <Command type="Modify">
            	<Workitem commandqualifier="CloseAll/Approve" etype="Entity"> 
  • CloseAll/Reject — Rejects all work items based on the specified search criteria except the FormResult custom parameter. If the FormResult custom parameter is specified, it is ignored.
             <Command type="Modify">
             	<Workitem commandqualifier="CloseAll/Reject" etype="Entity"> 

The <MaxCount> refers to the number of closed work items, which limits the total number of closed work items. The default MaxCount is 20. For example,

         <Command type="Modify">
         	   <MaxCount>10</MaxCount>
          	  <Workitem commandqualifier="CloseAll" etype="Entity"> 
Note: If Close or CloseAll command qualifier is used, the FormResult parameter is required for actionable work items. As the FormResult parameter is deprecated, do not use Close and CloseAll for actionable work items; instead use Close/Approve, Close/Reject, CloseAll/Approve, or CloseAll/Reject.

Execution mode

The execmode can be set to either SYNCHR or ASYNCHR. For more information, refer to Execution Modes.

Query Directives

NONE.

External Keys

The external keys are used to locate a work item.

Key Meaning Required
WORKITEMREFENCE
A reference ID for work item. This is usually available as a result of the work item query service. Mandatory.

Accept/Reject and Comment

While closing a work item, you can indicate if the work item is accepted or rejected. Specify a comment for the rejection or acceptance. For example:

<EntityData>
  <Comment etype="Attribute" type="string"> description</Comment>
  <FormResult etype="Attribute" type="string">Reject</FormResult>
  <SendForCorrections etype="Attribute" type="string">N</SendForCorrections>
</EntityData>

You can specify a list of work items in the request, and each of them will be closed. However, each work item needs to be in its own transaction, that is, separated by Transaction sections. You can close a work item inspite of errors or rejections. Ensure that close is not called in such situations. You can inquire about errors, warnings, and rejections using the GET WORKITEM web service.

Custom User Inputs

While closing work items, you can specify additional custom inputs. This data is added to the workflow request document and processed using the workflow forms.

Example 1:

Consider a scenario where you need to enter a LaunchDate for a set of records in a work item form. The date can later be used in the workflow. Specify the custom inputs as shown in the following example:

<EntityData>
  <Comment etype="Attribute" type="string">Reject through Web Service MASS APPROVAL</Comment>
  <FormResult etype="Attribute" type="string">Reject</FormResult>
    <SendForCorrections etype="Attribute" type="string">N</SendForCorrections>
    <!-- The following custom fields are captured as part of the work item form -->
   <LaunchDate eType="Attribute" type="date">2006 10 12</LaunchDate>
</EntityData>

The LaunchDate custom input is later included in the output document of the work item activity.

Example 2:

The custom attributes are used to pass in additional information to the application so that the values of these attributes can be used to update the workflow XML document (mlXML). An XPATH expression entry is created in the specific UI form on how to access these attributes from the request XML. These extracted values are used to populate the work flow document.

<EntityData>
   <Comment etype="Attribute" type="string">Reject through Web Service MASS APPROVAL</Comment>
   <FormResult etype="Attribute" type="string">Reject</FormResult>
   <SendForCorrections etype="Attribute" type="string">N</SendForCorrections>
   <!-- The following custom fields are captured as part of the work item form -->
   <raiseAlarm eType="Attribute" type="string">alarm1</raiseAlarm>
</EntityData>
  • When the FormResult value is Accept, the value of SendForCorrections is not considered.
  • When the FormResult value is Reject, the value of SendForCorrections is considered.
    Note: Since release 8.2.0 onwards, the <FormResult etype="Attribute" type="string">Reject</FormResult> is deprecated.
    Note: Specify all custom attributes in the $MQ_HOME/common/standard/forms/fm26ca.xml file with the XPath as //Field/ID[text()=CustomAttribute]/../OutputTo.