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

Community Tip - You can change your system assigned username to something more personal in your community settings. X

I need help with the Create-Link Webject.

mdorobantu
2-Explorer

I need help with the Create-Link Webject.

Hi all,

I'm having some trouble creating a EPMReferenceLink using an InfoEngien task. The task is as follows:

<?xml version="1.0" standalone="yes"?>

<%@page language="java" access="http|internal"%>

<%@taglib uri="http://www.ptc.com/infoengine/taglib/core" prefix="ie"%>

<ie:webject name="Start-Session" type="ACT">

    <ie:param name="INSTANCE" data="$(@FORM[]supporting-adapter[*])" delim=";" valueSeparator=";" default="<%=com.infoengine.au.NamingService.getVMName()%>"/>

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

</ie:webject>

<ie:webject name="Start-Transaction" type="ACT">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  </ie:webject>

  <ie:webject name="Query-Objects" type="OBJ">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

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

  <ie:param name="TYPE" data="wt.epm.EPMDocument"/>

  <ie:param name="WHERE" data="${@FORM[]Names[]}"/>

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

</ie:webject>

<ie:webject name="Query-Objects" type="OBJ">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

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

  <ie:param name="TYPE" data="wt.epm.EPMDocument"/>

  <ie:param name="WHERE" data="${@FORM[]Names1[]}"/>

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

</ie:webject>

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

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="OBJECT_REF" data="$(roleA[0]obid[])"/>

</ie:webject>

<ie:webject name="Create-Links" type="ACT">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="FROM_OBJECT_REF" data="$(roleA[0]obid[])"/>

  <ie:param name="TO_OBJECT_REF" data="$(roleB[0]obid[])"/>

  <ie:param name="TYPE" data="wt.epm.structure.EPMReferenceLink"/>

</ie:webject>

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

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="OBJECT_REF" data="$(roleA[0]obid[])"/>

</ie:webject>

<ie:webject name="Commit-Transaction" type="ACT">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

</ie:webject>

<ie:webject name="End-Session" type="ACT">

    <ie:param name="INSTANCE" data="$(session[]instance[])"/>

    <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

</ie:webject>

<ie:webject name="Return-Groups" type="GRP">

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

</ie:webject>

When i execute the task i get the following error:

"wt.epm.util.EPMOperationVetoException: The object CAD Part - InvPart.ipt, A.1 is owned by Workgroup Manager, which will not permit changes by the current application"

Dose anyone have any suggestions as to how to prevent the Workgroup Manager from Vetoing me?

Cheers,

Merch.

1 REPLY 1

This error is because you have not set the application. Add this to your task.

<%

Group group1 = getGroup("roleA");

try {

  wt.epm.EPMContextHelper.setApplication(wt.epm.EPMApplicationType.getEPMApplicationTypeDefault());

}

catch (WTPropertyVetoException e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

  }

%>

Also make sure that you are creating link on working copy.

<ie:webject name="Create-Links" type="ACT">

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="FROM_OBJECT_REF" data="$(workingCopy[0]obid[])"/>

  <ie:param name="TO_OBJECT_REF" data="$(roleB[0]obid[])"/>

  <ie:param name="TYPE" data="wt.epm.structure.EPMReferenceLink"/>

</ie:webject>

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

  <ie:param name="INSTANCE" data="$(session[]instance[])"/>

  <ie:param name="SESSION_ID" data="$(session[]session_id[])"/>

  <ie:param name="OBJECT_REF" data="$(workingCopy[0]obid[])"/>

</ie:webject>

Hope it helps.

Binesh Kumar

Medtronic - MITG

Announcements


Top Tags