cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

change attribute value without new iteration

rvanveerdeghem
10-Marble

change attribute value without new iteration

Hello,

We have a soap request from our ERP software to change some attributes in windchill. Every time you change a value we get a new

iteration on that part. Is it possible to change the value of an attribute without getting a new iteration?

We want to see the stock of a part in windchill. So everytime the stock changes we want to do an update on the attribute. So that means

that the iteration would come to fast.

Thanks in advance

kind regards

3 REPLIES 3

Ruben Vanveerdeghem wrote:

Hello,

We have a soap request from our ERP software to change some attributes in windchill. Every time you change a value we get a new

iteration on that part. Is it possible to change the value of an attribute without getting a new iteration?

See this post:

How to link WTPart to EPMDocument without checkout of WTPart

and this post:

Re: Java Code to add Windchill IBA Values to WTPart Object

Hi Randy,

Thanks for the information, but I can't find the solution for us.

This is what we do with a webject.

    <% logger.debug("-->CheckOut-Objects"); %>

    <ie:webject name="CheckOut-Objects" type="ACT">

      <ie:param name="INSTANCE" data="${session[]INSTANCE[0]}"/>

      <ie:param name="ATTRIBUTE" data="obid" delim=","/>

      <ie:param name="OBJECT_REF" data="${PART[0]obid[0]}"/>

      <ie:param name="GROUP_OUT" data="PART"/>

      <ie:param name="BLOB_COUNT" data="0"/>

    </ie:webject>

    <% logger.debug("-->Update-Objects"); %>

    <% logger.debug("-field: " + value); %>

    <ie:webject name="Update-Objects" type="ACT">

      <ie:param name="INSTANCE" data="${session[]INSTANCE[0]}"/>

      <ie:param name="SESSION_ID" data="${session_id[]SESSION_ID[]}"/>

      <ie:param name="AUTHORIZATION" data="${@server[]authorization[0]}"/>

      <ie:param name="GROUP_OUT" data="PART"/>

      <ie:param name="OBJECT_REF" data="${PART[0]obid[0]}"/>

      <ie:param name="BLOB_COUNT" data="0"/>

      <%for(int i=0;i<vAttribObjs.size();i++){%>

      <%AttributeObject aAttribObj = (AttributeObject)vAttribObjs.elementAt(i);%>

      <%logger.debug("attribute name " + aAttribObj.getAttributeName());%>

      <%logger.debug("attribute value " + aAttribObj.getAttributeValue());%>

      <%String sAttrib = aAttribObj.getAttributeName() + "='" + aAttribObj.getAttributeValue() + "'";%>

      <%logger.debug("attribute value " + sAttrib);%>

      <ie:param name="FIELD" data="<%=sAttrib%>"/>

      <%}%>

    </ie:webject>

    <% logger.debug("-->CheckIn-Objects"); %>

    <ie:webject name="CheckIn-Objects" type="ACT">

      <ie:param name="INSTANCE" data="${session[]INSTANCE[0]}"/>

      <ie:param name="AUTHORIZATION" data="${@server[]authorization[0]}"/>

      <ie:param name="OBJECT_REF" data="${PART[0]obid[0]}"/>

      <ie:param name="GROUP_OUT" data="PART"/>

      <ie:param name="SESSION_ID" data="${session[]SESSION_ID[0]}"/>

      <ie:param name="BLOB_COUNT" data="0"/>

      <ie:param name="ATTRIBUTE" data="*"/>

    </ie:webject> 

So now we do this with checkout en checkin. What do I need to change so that we don't need to checkout and get a higher iteration?

I'm very new in this webject code and infoengine.

Thanks

Hi

I have use the below code for modifying the attribute values without checkout in EPMDocument

public boolean setNormalizedAttribute(Persistable obj, String attributeName, Object ibaValue) throws Exception, IBADefinitionException, NotAuthorizedException, RemoteException, WTException, WTPropertyVetoException {

boolean isUpdated=false;
try
{
IBAHolder ibaholder = (IBAHolder) obj;
ibaholder = IBAValueHelper.service.refreshAttributeContainer(ibaholder, null, null, null);
DefaultAttributeContainer defaultattributecontainer = (DefaultAttributeContainer) ibaholder.getAttributeContainer();
System.out.println(defaultattributecontainer.toString());
AttributeDefDefaultView addv = IBADefinitionHelper.service.getAttributeDefDefaultViewByPath(attributeName);
AbstractValueView aabstractvalueview[] = defaultattributecontainer.getAttributeValues(addv);
if (aabstractvalueview.length < 1) {
StringValueDefaultView svdobj = new StringValueDefaultView((StringDefView)addv, (String) ibaValue);
defaultattributecontainer.addAttributeValue(((AbstractValueView) (svdobj)));
}
else{
for (int k = 0; k < aabstractvalueview.length; k++){
((StringValueDefaultView)aabstractvalueview[k]).setValue((String) ibaValue);
defaultattributecontainer.updateAttributeValue(aabstractvalueview[k]);
}
}
StandardIBAValueService.theIBAValueDBService.updateAttributeContainer(ibaholder, null, null, null);
isUpdated=true;
}
catch(Exception e)
{
e.getMessage();

e.printStackTrace();
}
return isUpdated;
}
Announcements

Top Tags