markW - Tuesday, September 18, 2007 6:18 PM:
I am trying to update the generation property through the IOM. It seems I am not allowed to do this. My purpose is that I have a Container Item which has a relationship to a Counter Item. The relationship is set to "Hard Fixed". This is because I want the container to track a specifc generation/version properties of an item. So, when the Item is edited (through one of my programs) I create a new relationship from a second Container Item to the new Generation / Version. My versioning is set to "Manual Version".
However, I can change the major_rev value through the IOM, but not the generation. This property change is just ignored:
string whereString = "[mw_C_Vtest].name='c1' and [mw_C_Vtest].is_current='1'";
IOM.Item demoContainer = Inn.newItem("mw_C_Vtest", "edit");
demoContainer.setAttribute("where", whereString);
demoContainer.setProperty("generation", "3");
demoContainer.setProperty("major_rev", "C");
IOM.Item result = demoContainer.apply();
textBox1.Text = result.dom.InnerXml;
OUTPUT:
- <Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <Body>
- <Result>
- <Item type="mw_C_Vtest" typeId="28AB36BF9F6E4656B9614ED1C4343D7B" id="5AE10D3C1C0B4B229B1F74D44A6667A5" page="1" pagemax="1" itemmax="1">
<effective_date>09/18/2007 11:26:57 PM</effective_date>
<id keyed_name="9694987B100540D7B6801F1EF8990947" type="mw_C_Vtest">5AE10D3C1C0B4B229B1F74D44A6667A5</id>
<current_state name="Released" keyed_name="Released" type="Life Cycle State">C363ABDADF8D485393BB89877DBDCFD0</current_state>
<property1>hhh</property1>
<modified_by_id keyed_name="Innovator Admin" type="User">30B991F927274FA3829655F50C99472E</modified_by_id>
<generation>2</generation>
<release_date>09/18/2007 11:26:57 PM</release_date>
<is_released>1</is_released>
<created_by_id keyed_name="Innovator Admin" type="User">30B991F927274FA3829655F50C99472E</created_by_id>
<created_on>09/18/2007 11:24:43 PM</created_on>
<keyed_name>9694987B100540D7B6801F1EF8990947</keyed_name>
<state>Released</state>
<config_id keyed_name="9694987B100540D7B6801F1EF8990947" type="mw_C_Vtest">9694987B100540D7B6801F1EF8990947</config_id>
<new_version>0</new_version>
<is_current>1</is_current>
<not_lockable>0</not_lockable>
<permission_id keyed_name="World Can Get" type="Permission">93AB06D37FC84328A314324DC45DB574</permission_id>
<modified_on>09/18/2007 11:38:03 PM</modified_on>
<name>c1</name>
<major_rev>C</major_rev>
</Item>
</Result>
- <Message>
<event name="ids_modified" value="5AE10D3C1C0B4B229B1F74D44A6667A5" />
</Message>
</Body>
</Envelope>
My scenario can be done manually through the Innovator Client.
I can use the 'Version' function in the right click pull down menu and the generation and verison will update. The original relationship remains pointing to the older generation / version.
So, is there an IOM feature that does the 'Version' function? That would solve my problem (I think).
Regards,
Mark
RobMcAveney - Tuesday, September 18, 2007 6:59 PM:
Hi Mark -
It seems like what you want to do is a manual version through IOM. This is actually pretty easy -- just use code like:
Item tempItem = Inn.newItem("myItem","version");
tempItem.setID(myId);
Item resultItem = tempItem.apply();
resultItem will then contain the new version of the item. I'm pretty sure you need to use the id for the version action (as opposed to a where clause), so you may need to do a get first in order to find the id. For future reference, if you can do something in the UI it is usually pretty easy to figure out how it's done. Just turn Tools->Admin->Save Requests, perform the operation, then check your working directory for the requests needed to do it.
Regards -
Rob
markW - Tuesday, September 18, 2007 8:00 PM:
Thanks Rob! It worked fine. I was guessing there was probably a simple way to do it. Thanks for the tip about the Save Requests, I think that will be quite useful.
Regards,
Mark