Populating Data Item Values in the Data Item XML
In Part 1, we discussed the structure of data into Solution Data Items, Process Data Items and Data Models. In Part 2, we reviewed the Start Process Window and how to select a Runtime Environment and Starting Activity.
In order to populate values to your Data Items, you must update the Data Item XML field in the Start Process window. The structure of the XML is the same for every Process:
<Data>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/" />
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/" />
</Data>
where {Solution ID} is the Unique Identifier of the Solution and {Process ID} is the Unique Identifier of the Process.
The easiest way to determine the {Solution ID} and {Process ID} is to click the [Start Process] button and copy the values from the automatically generated Data Item XML.
For a Solution and Process without Data Models or Collections, the basic structure of the XML is:
<Data>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">
<SolutionDataItem1>[Value1]</SolutionDataItem1>
<SolutionDataItem2>[Value2]</SolutionDataItem2>
…
<SolutionDataItemN>[ValueN]</SolutionDataItemN>
</DataItems>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/">
<ProcessDataItem1>[Value1]</ProcessDataItem1>
<ProcessDataItem2>[Value2]</ProcessDataItem2>
…
<ProcessDataItemN>[ValueN]</ProcessDataItemN>
</DataItems>
</Data>
When you have Data Models, you must then specify an XML Namespace for each component of the Data Model, as displayed in Solution Explorer, where the XML Namespace is defined within the Start Process window as the Solution namespace, i.e. xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/. You must also provide the XML Namespace for the Data Model itself, where the XML Namespace corresponds to the Data Item as either a Process or Solution Data Item.
So, for our previous example of a Process Data Item: SalesPersonRole associated with Data Model: Salesperson, the XML would be:
<Data>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/solution/5f9bdf48-67ce-45c1-8a4a-0e9abeed25b8/" />
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/process/398ab4c7-ffbd-45e7-839f-6f9846230982/">
<SalesPersonRole>
<Salesperson xmlns="http://schema.bluespringsoftware.com/2010/process/398ab4c7-ffbd-45e7-839f-6f9846230982/">
<Email xmlns="http://schema.bluespringsoftware.com/2010/solution/5f9bdf48-67ce-45c1-8a4a-0e9abeed25b8/">donald.langston@bluespringsoftware.com</Email>
<Name xmlns="http://schema.bluespringsoftware.com/2010/solution/5f9bdf48-67ce-45c1-8a4a-0e9abeed25b8/">Donald Langston</Name>
</Salesperson>
</SalesPersonRole>
<SalesPersonRole>
<Salesperson xmlns="http://schema.bluespringsoftware.com/2010/process/398ab4c7-ffbd-45e7-839f-6f9846230982/">
<Email xmlns="http://schema.bluespringsoftware.com/2010/solution/5f9bdf48-67ce-45c1-8a4a-0e9abeed25b8/">jill.russell@bluespringsoftware.com</Email>
<Name xmlns="http://schema.bluespringsoftware.com/2010/solution/5f9bdf48-67ce-45c1-8a4a-0e9abeed25b8/">Jill Russell</Name>
</Salesperson>
</SalesPersonRole>
</Data>
Hence, the structure defines:
(1) A <Data> element for the entire Process's initiation
(2) A <DataItems> element for the Process Data Items
(3) A <SalesPersonRole>element for the Process Data Item: SalesPersonRole
a. Note: the XML element for the Data Item does not require an XML Namespace
(4) A <Salesperson> element including the XML Namespace for Process Data Items for the Data Model: Salesperson associated with the Process Data Item: SalesPersonRole
(5) The components of the Data Model: SalesPersonRole, including the XML Namespace for Solution Data Items
a. <Email>
b. <Name>
In general, then, the structure of a more complex XML is:
<Data>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">
<SolutionDataItem1>
<DataModel1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModel1>
</SolutionDataItem1>
<SolutionDataItem2>
<DataModel2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModel2>
</SolutionDataItem2>
…
<SolutionDataItemN>
<DataModelN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModelN>
</SolutionDataItemN>
</DataItems>
<DataItems xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/">
<ProcessDataItem1>
<DataModel1 xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModel1>
</ProcessDataItem1>
<ProcessDataItem2>
<DataModel2 xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModel2>
</ProcessDataItem2>
…
<ProcessDataItemN>
<DataModelN xmlns="http://schema.bluespringsoftware.com/2010/process/{Process ID}/">
<DataModelComponent1 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue1]</DataModelComponent1>
<DataModelComponent2 xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValue2]</DataModelComponent2>
…
<DataModelComponentN xmlns="http://schema.bluespringsoftware.com/2010/solution/{Solution ID}/">[ComponentValueN]</DataModelComponentN>
</DataModelN>
</ProcessDataItemN>
</DataItems>
</Data>
Again, the structure defines:
· A <Data> element for the entire Process's initiation
o A <DataItems> element for the Solution Data Items
§ <SolutionDataItem> elements for the Solution Data Items, without an XML Namespace
· <DataModel> elements for the Data Models associated with Solution Data Items, including the XML Namespace for the Solution
o <DataModelComponent> elements for the components of the Data Model, including the XML Namespace for the Solution.
o A <DataItems> element for the Process Data Items
§ <ProcessDataItem> elements for the Solution Data Items, without an XML Namespace
· <DataModel> elements for the Data Models associated with Solution Data Items, including the XML Namespace for the Process
o <DataModelComponent> elements for the components of the Data Model, including the XML Namespace for the Solution.
To provide multiple values for a Collection, include multiple different <DataItems> elements within the XML, for either Solution or Process Data Items.
Once you have correctly created an XML Document, paste the entire document into the Data Item XML field of the Start Process Window, as a replacement for the automatically generated value, and click [Start] to initiate a Process from BPM Designer with values populated for your Data Items.