Provisioning Schema::when


Element that checks for the presence of an element, attribute, or value (of an element or attribute) in a procedure's select node. The associated execution block is executed whenever the condition in the when node evaluates to true. This element is part of the provisioning schema of Microsoft® Provisioning Framework (MPF).

Parents

execute, queue, transform

Attributes

Note  Use either the source and sourcePath attributes or the select and case attributes, but not both.

case
Optional. This attribute must be specified with select attribute.
select
Optional. Name of one of the select nodes previously defined in the scope of the executing procedure.
source
Optional. Context node for locating the sourcePath node in the request XML:
  • "data" (the request's data node)
  • "procedureData" (the called procedure's procedureData node)
  • Name of a previously-defined forEach node.
sourcePath
Optional. XPath for the element and attribute to check. 

Example

<request>
  <data>
	<organizations>
	<organization name="tailspintoys.com">
		<count>1</count> 
		<users /> 
	</organization>
	<organization name="wideworldimporters.com">
		<count>1</count> 
	</organization>
	</organizations>
	<service>myHosting</service> 
  </data>
  <procedure>
	<!--  Select type of service organization to provision. --> 
	<select name="service" source="data" sourcePath="service" defaultCase="4" ifNullCase="4">
	<where value="myHosting" case="1" /> 
	<where value="myInbox" case="2" /> 
	<where value="myCalendar" case="3" /> 
	<where value="myProfile" case="3" /> 
	</select>
	<!-- Execute procedure when service name is myHosting. Execute procedure multiple times based on count. --> 
	<execute namespace="Test Namespace" procedure="Read Request">
	<forEach root="data" path="organizations/organization" name="org" /> 
	<repeat source="org" sourcePath="count" /> 
	<executeData service="myHosting" /> 
	<when select="service" case="1" /> 
	<after source="executeData" destination="data" /> 
	</execute>
	<!-- Execute procedure when service name is myInbox. --> 
	<execute namespace="Test Namespace" procedure="Read Request">
	<executeData service="myInbox" /> 
	<when select="service" case="2" /> 
	<after source="executeData" destination="data" />
	</execute>
	<!-- Execute procedure only when users are present for the organization. -->
	<execute namespace="Test Namespace" procedure="Read Request">
	<forEach root="data" path="organizations/organization" name="org" />
	<when source="org" sourcePath="users" />
	<after source="executeData" destination="data" />
	</execute>
  </procedure>
</request>

See also

Customization, XML Schema for Procedures


Up Top of Page
© 1999-2002 Microsoft Corporation. All rights reserved.