<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Throw Warning Message in Custom Listener in Windchill Customization</title>
    <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1033267#M10427</link>
    <description>&lt;P&gt;I think we can use&amp;nbsp;FormProcessingStatus.NON_FATAL_ERROR. This gives warning and proceeds with rest of the tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously I had the same requirement and achieved the result with this.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Sep 2025 15:31:07 GMT</pubDate>
    <dc:creator>LT_12699133</dc:creator>
    <dc:date>2025-09-10T15:31:07Z</dc:date>
    <item>
      <title>Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031171#M10347</link>
      <description>&lt;P&gt;Version: Windchill 13.0&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;Description: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;We have customized a PRE_WORKSPACE_CHECKIN listener to process an attachment file and populate attributes on the associated CAD document during the check-in process. It works great, but sometimes users forget to add the attachment, which results in none of the necessary attributes being populated. Is there a way to throw a warning (or error that can then be bypassed) to the user during check-in to tell them they are missing the attachment? Ideally I would like to call this in the custom listener.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;public void notifyVetoableEvent(Object event) throws Exception{
	if(!(event instanceof KeyedEvent)) {
		return;
	}
	//Object target = ((KeyedEvent) event).getEventTarget();
	Object type = ((KeyedEvent) event).getEventType();
	if(type.equals(EPMWorkspaceManagerEvent.PRE_WORKSPACE_CHECKIN))
	{
		EPMWorkspaceManagerEvent wsEvent = (EPMWorkspaceManagerEvent) event;
		WTSet workingCopies = ((WTKeyedMap) ((EPMWorkspaceManagerEvent) event).getWIPMap()).wtKeySet();
		WTCollection epmDocs = workingCopies.subCollection(EPMDocument.class);
		Iterator docItr = epmDocs.persistableIterator(EPMDocument.class, true);
		while (docItr.hasNext()) {
			EPMDocument epmDoc = (EPMDocument) docItr.next();
			wt.fc.Persistable pers = (wt.fc.Persistable) epmDoc;
			com.ptc.core.meta.common.TypeIdentifier tiObj = wt.type.ClientTypedUtility.getTypeIdentifier(pers);
			String objType = tiObj.toString();
			if( objType.endsWith("VOCCADDocument")) {
				QCheckHelper qChecker = new QCheckHelper(epmDoc);
				
				// WARNING THROW SHOULD HAPPEN HERE, PSUEDO CODE INCLUDED FOR REFERENCE 
				if (qChecker.hasQCFile() == false) {
					new FeedBackMessage("Missing QC File! Continue check-in without adding?");
					// IF USER CLICKS "PROCEED" BELOW CODE EXECUTES AND POPULATES WITH BLANK VALUES
					// IF USER CLICKS "CANCEL" THE CHECK-IN IS ABORTED
				}
				// END OF PSUEDO CODE, REMAINING CODE WORKS AS EXPECTED
				
				Map&amp;lt;String, String&amp;gt; attr_value_map = new HashMap&amp;lt;String, String&amp;gt;(7);
				attr_value_map.put("QC_ACTACTION", qChecker.getActAction());
				attr_value_map.put("QC_ASSESSMENT", qChecker.getAssessment());
				attr_value_map.put("QC_CHECK_DATE", qChecker.getCheckDate());
				attr_value_map.put("QC_CHECK_TIME", qChecker.getCheckTime());
				attr_value_map.put("QC_CHECK_USER", qChecker.getCheckUser());
				attr_value_map.put("QC_PROFILE_NAME", qChecker.getProfileName());

				WTKeyedMap keyed_map = new WTKeyedHashMap(1);
				keyed_map.put(epmDoc, attr_value_map);

				EPMWorkspaceHelper.manager.setAttributes(wsEvent.getWorkspace() , keyed_map);
			}
		}
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Aug 2025 23:00:49 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031171#M10347</guid>
      <dc:creator>marshall_brock</dc:creator>
      <dc:date>2025-08-26T23:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031343#M10356</link>
      <description>&lt;P&gt;Related to your other linked message, I did this on a rename listener by throwing a WTException&lt;/P&gt;
&lt;PRE&gt;throw new WTException("Rename for Part " + master.getNumber() + " rejected since name length exceeds 40 characters for SAP");&lt;/PRE&gt;
&lt;P&gt;though WTException is a hard no bypass way which might not work in your situation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 18:22:38 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031343#M10356</guid>
      <dc:creator>avillanueva</dc:creator>
      <dc:date>2025-08-27T18:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031393#M10357</link>
      <description>&lt;P&gt;Thanks for the response, but you are correct that this would produce a hard error with no bypass which is undesirable in my situation. This is what I plan to use as a last resort. I was hoping to find a solution using either the conflict manager (ConflictElement/Resolution API) or FeedbackMessage, but I'm not very familiar with either.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 00:09:23 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031393#M10357</guid>
      <dc:creator>marshall_brock</dc:creator>
      <dc:date>2025-08-28T00:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031420#M10358</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/597484"&gt;@marshall_brock&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I wrote, it it more complicated.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here is an example how to create message with options for the error message&lt;/P&gt;
&lt;LI-CODE lang="java"&gt;ArrayList&amp;lt;String&amp;gt; incorrectMessages = new ArrayList&amp;lt;&amp;gt;();
incorrectMessages.add("Delete WTP case ProcessPlan error!");

WTPDeleteMessage errorTitle = new WTPDeleteMessage("!!!! WARNING !!!!: ", "35", new Object[]{incorrectMessages});

ConflictType cType = WTPDeleteConflictType.DELETE_WTP_NOT_ALLOWED;
ResolutionType rType = ResolutionType.RETRY;
ResolutionType sType = ResolutionType.SKIP;
ConflictElement conflictElement = new ConflictElement(cType, new ResolutionType[]{sType, rType}, sType, errorTitle, wtp);
ConflictException conflict = new ConflictException(new ConflictElement[]{conflictElement});

ResolutionType resolutionList = ConflictServerHelper.getResolution(wtp, cType); // VERY IMPORTANT API TO GET RESOLUTION OPTIONS

if (resolutionList == null)
{
	throw conflict;
} else
{
	String option = resolutionList.getDisplay(Locale.US);

	if (option.equals("Retry"))
	{
		logger.info(String.format("WTPart linked to Process Plan is deleted. WTPart: %s, Process Plan: %s User %s", wtp.getNumber(), plan.getNumber(), user.getName()));
	} else
	{
		throw conflict;
	}
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ptc.com/en/support/article/CS104731" target="_blank" rel="noopener"&gt;API to override conflict on EPMWorkspaceHelper.manager.checkout&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;You have to create own conflict type&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In my example I used own class &lt;STRONG&gt;WTPDeleteConflictType&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;How to create RbInfo file&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.ptc.com/en/support/article/CS36017" target="_blank" rel="noopener"&gt;How to create a drop down list in a workflow instance task detail page of Windchill PDMLink&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also I created own &lt;STRONG&gt;WTPDeleteMessage&amp;nbsp;&lt;/STRONG&gt;based on&amp;nbsp;WTMessage.class&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this can help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PetrH&lt;/P&gt;</description>
      <pubDate>Thu, 28 Aug 2025 06:51:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031420#M10358</guid>
      <dc:creator>HelesicPetr</dc:creator>
      <dc:date>2025-08-28T06:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031716#M10375</link>
      <description>&lt;P&gt;Thank you for the response with an example! I will give this a try.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Aug 2025 18:28:19 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031716#M10375</guid>
      <dc:creator>marshall_brock</dc:creator>
      <dc:date>2025-08-29T18:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1032816#M10408</link>
      <description>&lt;P&gt;Hello &lt;SPAN style="background: var(--ck-color-mention-background); color: var(--ck-color-mention-text);"&gt;&lt;a href="https://www.ptcusercommunity.com/t5/user/viewprofilepage/user-id/597484"&gt;@marshall_brock&lt;/a&gt;&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you have some &lt;A href="https://community.ptc.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1031420#M10358" target="_blank"&gt;responses&lt;/A&gt; from some community members. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Vivek N.&lt;BR /&gt;Community Moderation Team.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Sep 2025 06:15:55 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1032816#M10408</guid>
      <dc:creator>vnamboodheri</dc:creator>
      <dc:date>2025-09-08T06:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1033267#M10427</link>
      <description>&lt;P&gt;I think we can use&amp;nbsp;FormProcessingStatus.NON_FATAL_ERROR. This gives warning and proceeds with rest of the tasks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Previously I had the same requirement and achieved the result with this.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 15:31:07 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1033267#M10427</guid>
      <dc:creator>LT_12699133</dc:creator>
      <dc:date>2025-09-10T15:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: Throw Warning Message in Custom Listener</title>
      <link>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1033970#M10441</link>
      <description>&lt;P&gt;Do you have any examples of how you achieved this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Sep 2025 17:34:44 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/Windchill-Customization/Throw-Warning-Message-in-Custom-Listener/m-p/1033970#M10441</guid>
      <dc:creator>marshall_brock</dc:creator>
      <dc:date>2025-09-15T17:34:44Z</dc:date>
    </item>
  </channel>
</rss>

