pp108 : SendEvent

SendEvent

This Web service operation is the replacement for the deprecated SOAP API ConsumeEvent. The SendEvent allows the user to send a business event to a particular Case instance. If the event is received, the response will provide the details of the current active states of the Case instance. If the Case instance does not accept the sent event, the response specifies the reason for not accepting the event.

SOAP Request

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <SendEvent xmlns="http://schemas.cordys.com/casemanagement/execution/1.0">
            <caseinstanceid>001A6BFA-F5BF-11E0-F0F0-830AA70A1211</caseinstanceid>
            <event source="001A6BFA-F5BF-11E0-F14F-6F39292979F0">SendToVerification</event>
        </SendEvent>
    </SOAP:Body>
</SOAP:Envelope>
Request Parameters

Parameter

Description

Mandatory

Accepted Input Values

caseinstanceid

Refers to the instance ID of the Case model to which the events must be sent. The Case instance ID can be obtained from any of the following:

  • The response of the CreateCase API
  • The Workflow.getCaseInstanceId API that is invoked from a human task of the Case instance

Yes

event

Refers to the name of the event which must be sent

Yes

source

Refers to the ID of the activity on which the event must be raised. The activity ID is available in the GetTask SOAP API response. If an event is raised from a particular activity, this parameter will be useful for the transitions between the states.

No

SOAP Response

When the event is accepted by Case instance

<SendEventResponse
    xmlns="http://schemas.cordys.com/casemanagement/execution/1.0" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <result success="true"/>
    <activestates>
        <state id="final_state" name=""/>
    </activestates>
</SendEventResponse>

When the event is not accepted by Case instance

<SendEventResponse
    xmlns="http://schemas.cordys.com/casemanagement/execution/1.0" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <result success="false">
        <info>The Event 'SendToVerification' could not be consumed by any of the currently active states.</info>
    </result>
    <activestates>
        <state id="001A6BFA-F5BF-11E0-EEDF-4A9718091BD3" name="Main State">001A6BFA-F5BF-11E0-EEF4-C2484E285020</state>
        <state id="001A6BFA-F5BF-11E0-EE94-EC915D957F96" name="A">001A6BFA-F5BF-11E0-EEF4-C2484E289020</state>
        <state id="RootCaseModelState" name="">001A6BFA-F5BF-11E0-EEF4-C2484E283020</state>
    </activestates>
</SendEventResponse>
Response Parameters

Parameter

Description

success

Contains values true or false. If the event is accepted, the value will be true.

activestates

Contains the details of all the active states of the Case instance