<< Fare clic per visualizzazione il sommario >> Percorso: Il linguaggio OEL > Funzioni > ProjectionDataSet |
Proietta una lista di dati strutturati in un nuovo dato strutturato. La funzione è utile quando si vuole ottenere un dato strutturato (insieme di elementi chiave/valore), a partire da una lista di elementi (DataSetValue) formati a loro volta da un campo che contiene la chiave, un altro campo che contiene il valore, e altri campi che vanno ignorati; se invece nel risultato vanno inclusi tutti i campi, il "valore" nel dato strutturato risultato sarà a sua volta un DataSetValue che contiene tutte le coppie chiave/valore del dato strutturato della lista tranne quello indicato come campo chiave.
Funzione
DataSetValue ProjectionDataSet(IList list, string keyFieldName, string valueFieldName)
Input |
|||
Nome |
Descrizione |
Tipo |
Opzionale |
list |
Lista di elementi di tipo IDataSet. |
|
|
keyFieldName |
Nome del campo contenente le chiavi nel dato strutturato di origine presente in list. |
String |
|
valueFieldName |
Nome del campo contenente i valori nel dato strutturato di origine presente in list. E' possibile passare valore null. |
String |
|
Output |
|||
Nome |
Descrizione |
Tipo |
Opzionale |
returnValue |
Dato strutturato proiettato. |
DataSetValue |
|
Commenti
Restituisce |
Condizione |
DataSetVaue contenenti tutti i campi del dato strutturato di origine ad eccezione del campo chiave. |
Se valueFieldName è null o vuoto e i dati strutturati in list contengono più di due campi. |
Esempio1
Data una lista costituita dai dati strutturati DS1 e DS2 così costituiti (chiave,valore)
DS1(A,1,B,2,C,3)
DS2(D,1,A,2,B,3,C,4)
Si richiede la ProjectionDataSet della lista con keyFieldName pari ad A e valueFieldName pari a C. Il dato strutturato che si ottiene come risultato DS3 è così formato:
DS3(1,3,2,4)
Si richiede la ProjectionDataSet della lista con keyFieldName pari ad A e valueFieldName pari a valore vuoto ''. Il dato strutturato che si ottiene come risultato DS3 è così formato:
DS3(1,DS4(B,2,C,3),2,DS5(D,1,B,3,C,4))
Esempio2
Data una lista così costituita:
<ArrayValue xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openworkbpm.com/schema">
<DefaultElement i:nil="true" />
<Elements>
<Item i:type="DataSetValue">
<Fields>
<Item>
<Key>Start Date</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>Start Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">3:00:00 PM</Val>
</Item>
<Item>
<Key>End Date</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>End Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string" />
</Item>
<Item>
<Key>Event Title</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Social Studies Dept. Meeting</Val>
</Item>
<Item>
<Key>All Day Event</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>No End Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Y</Val>
</Item>
<Item>
<Key>Event Description</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Department meeting</Val>
</Item>
<Item>
<Key>Contact</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Chris Gallagher</Val>
</Item>
<Item>
<Key>Contact Email</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">cgallagher@schoolwires.com</Val>
</Item>
<Item>
<Key>Contact Phone</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">814-555-5179</Val>
</Item>
<Item>
<Key>Location</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">High School</Val>
</Item>
<Item>
<Key>Category</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">2</Val>
</Item>
<Item>
<Key>Mandatory</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>Registration</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>Maximum</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">25</Val>
</Item>
<Item>
<Key>Last Date To Register</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/2/2011</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</Item>
<Item i:type="DataSetValue">
<Fields>
<Item>
<Key>Start Date</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>Start Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">6:00:00 PM</Val>
</Item>
<Item>
<Key>End Date</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>End Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">8:00:00 PM</Val>
</Item>
<Item>
<Key>Event Title</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Curriculum Meeting</Val>
</Item>
<Item>
<Key>All Day Event</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>No End Time</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>Event Description</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Curriculum Meeting</Val>
</Item>
<Item>
<Key>Contact</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">Chris Gallagher</Val>
</Item>
<Item>
<Key>Contact Email</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">cgallagher@schoolwires.com</Val>
</Item>
<Item>
<Key>Contact Phone</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">814-555-5179</Val>
</Item>
<Item>
<Key>Location</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">High School</Val>
</Item>
<Item>
<Key>Category</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">2</Val>
</Item>
<Item>
<Key>Mandatory</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>Registration</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">N</Val>
</Item>
<Item>
<Key>Maximum</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">25</Val>
</Item>
<Item>
<Key>Last Date To Register</Key>
<Val xmlns:d6p1="http://www.w3.org/2001/XMLSchema" i:type="d6p1:string">9/2/2011</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</Item>
</Elements>
</ArrayValue>
Si richiede la ProjectionDataSet della lista con keyFieldName pari ad 'Event Title' e valueFieldName pari a 'Contact Email'. Il dato strutturato che si ottiene come risultato è così formato:
<DataSetValue xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openworkbpm.com/schema">
<Fields>
<Item>
<Key>Social Studies Dept. Meeting</Key>
<Val xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">cgallagher@schoolwires.com</Val>
</Item>
<Item>
<Key>Curriculum Meeting</Key>
<Val xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">cgallagher@schoolwires.com</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</DataSetValue>
Si richiede la ProjectionDataSet della lista con keyFieldName pari ad 'Event Title' e valueFieldName pari a null. Il dato strutturato che si ottiene come risultato è così formato:
<DataSetValue xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.openworkbpm.com/schema">
<Fields>
<Item>
<Key>Social Studies Dept. Meeting</Key>
<Val i:type="DataSetValue">
<Fields>
<Item>
<Key>Start Date</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>Start Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">3:00:00 PM</Val>
</Item>
<Item>
<Key>End Date</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>End Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string" />
</Item>
<Item>
<Key>All Day Event</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>No End Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">Y</Val>
</Item>
<Item>
<Key>Event Description</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">Department meeting</Val>
</Item>
<Item>
<Key>Contact</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">Chris Gallagher</Val>
</Item>
<Item>
<Key>Contact Email</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">cgallagher@schoolwires.com</Val>
</Item>
<Item>
<Key>Contact Phone</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">814-555-5179</Val>
</Item>
<Item>
<Key>Location</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">High School</Val>
</Item>
<Item>
<Key>Category</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">2</Val>
</Item>
<Item>
<Key>Mandatory</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>Registration</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>Maximum</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">25</Val>
</Item>
<Item>
<Key>Last Date To Register</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/2/2011</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</Val>
</Item>
<Item>
<Key>Curriculum Meeting</Key>
<Val i:type="DataSetValue">
<Fields>
<Item>
<Key>Start Date</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>Start Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">6:00:00 PM</Val>
</Item>
<Item>
<Key>End Date</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/5/2011</Val>
</Item>
<Item>
<Key>End Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">8:00:00 PM</Val>
</Item>
<Item>
<Key>All Day Event</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>No End Time</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>Event Description</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">Curriculum Meeting</Val>
</Item>
<Item>
<Key>Contact</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">Chris Gallagher</Val>
</Item>
<Item>
<Key>Contact Email</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">cgallagher@schoolwires.com</Val>
</Item>
<Item>
<Key>Contact Phone</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">814-555-5179</Val>
</Item>
<Item>
<Key>Location</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">High School</Val>
</Item>
<Item>
<Key>Category</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">2</Val>
</Item>
<Item>
<Key>Mandatory</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>Registration</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">N</Val>
</Item>
<Item>
<Key>Maximum</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">25</Val>
</Item>
<Item>
<Key>Last Date To Register</Key>
<Val xmlns:d7p1="http://www.w3.org/2001/XMLSchema" i:type="d7p1:string">9/2/2011</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</Val>
</Item>
</Fields>
<ModelReference i:nil="true" />
</DataSetValue>