pp108 : PlanActivities

PlanActivities

 

This Web service operation is used to plan a set of activities for a case instance. If a free follow-up activity is planned for the case instance, which is in the current executing state, the activity is released immediately. If the activity is in a different state, it is released only when the case execution moves into that state. The PlanActivity is a part of the Method Set Case Instance Execution 4.2 Web service interface with the namespace http://schemas.cordys.com/casemanagement/execution/1.0.

SOAP Request

To plan an activity with name and state:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <PlanActivities xmlns="http://schemas.cordys.com/casemanagement/execution/1.0">
            <caseinstanceid>{2I0C054B-E0FB-4DB4-B031-601EA31853AF}</caseinstanceid>
            <planactivities>
                <activity allowmultiplan="true" name="DiscussProblems" state="Diagnosis">
                    <activityinstanceid>101_John_25052011_DiscussProblems</activityinstanceid>
                </activity>
            </planactivities>
        </PlanActivities>
    </SOAP:Body>
</SOAP:Envelope>

To plan an activity with name, state, and activity definition details to override the default values:

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <PlanActivities xmlns="http://schemas.cordys.com/casemanagement/execution/1.0">
            <caseinstanceid>001A6BFA-F5BF-11E0-F0EC-2FBA246BB211</caseinstanceid>
            <planactivities xmlns="http://schemas.cordys.com/casemanagement/execution/1.0">
                <activity name="DiscussProblems" state="Diagnosis">
                    <activityinstanceid>1012_John_25052011_DiscussProblems</activityinstanceid>
                    <case:activity
                        id="001A6BFA-F5BF-11E0-F0BE-968A46539DF5"
                        name="DiscussProblems" type="HUMANTASK" xmlns:case="http://schemas.cordys.com/casemanagement             /1.0">
                        <HumanInteraction xmlns="http://schemas.cordys.com/notification/workflow/1.0">
                            <HumanTaskModelId>001A6BFA-F5BF-11E0-F063-231A8F93DB34</HumanTaskModelId>
                            <Subject>DiscussProblems</Subject>
                            <SendTo>
                                <Target type="user">
                                    <Assignee dynamic="false">cn=alice,cn=organizational users,
                   o=system,cn=cordys,cn=defaultInst,o=myorg.com</Assignee>
                                </Target>
                            </SendTo>
                            <DueDate dynamic="false">P0Y0M0DT2H0M0S</DueDate>
                        </HumanInteraction>
                        <case:messages>
                            <case:input>
                                <case:message
                                    name="DiscussProblemsDeliveryModel_IP" ns="http://schemas.cordys.com/1.0/xforms/processapi"/>
                            </case:input>
                            <case:output>
                                <case:message
                                    name="DiscussProblemsDeliveryModel_OP" ns="http://schemas.cordys.com/1.0/xforms/processapi"/>
                            </case:output>
                        </case:messages>
                        <case:associatedevents/>
                        <case:duedate dynamic="true" type="duration">sm:data[@name='case:casevariables']/case:casevariables/case:DueTimeSLA</case:duedate>
                        <case:escalation/>
                    </case:activity>
                </activity>
            </planactivities>
        </PlanActivities>
    </SOAP:Body>
</SOAP:Envelope>
Request Parameters

Parameter

Description

Mandatory

caseinstanceid

Refers to the instance ID of the case model. The case instance ID can be obtained from any of the following:

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

Yes

planactivities

Contains activities that are planned for execution

Yes

activity

Contains the ID, name, and state of the activity. The attribute ID is the activity model ID and name is the name of the activity that is planned for the execution. The state indicates the state in which the planned activity exists. You can either use one parameter or use both name and state as the input parameters.

An activity can be planned for a multiple number of times in the same state by setting the value of allowmultiplan parameter to true . If the activity is already planned, then the allowmultiplan = false parameter will not allow the case engine to plan it again.

Yes

activityinstanceid

This is the unique identifier of the activity which is used to create the instance of the activity. This ID can be used to retrieve the details of the planned activity from the GetActivityInstance SOAP API.

No

activity

This element must contain the details of the activity.

Note: The namespace of this activity element is different from the namespace of its parent activity element. This element is required only when there is a need to overwrite the default values. For example, changing the due date of the activity configured in design time. The details of the activity definition can be obtained from the definition node of the GetCaseActivity SOAP API response.

No

SOAP Response

<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP:Body>
        <PlanActivitiesResponse xmlns="http://schemas.cordys.com/casemanagement/execution/1.0">
            <activestates>
                <state id="{5E019655-709E-4CF0-BD3B-FA3E066EF8F4}" name="Diagnosis">{2S0C054B-E0FB-4DB4-B031-601EA31853AF}</state>
            </activestates>
        </PlanActivitiesResponse>
    </SOAP:Body>
</SOAP:Envelope>
Response Parameters

Parameter

Description

activestates

Contains the existing active states of the case model

state

Refers to the name and ID of the active state