Features

Overview

The goal of this section is to provide the developer with a reference of the APIs provided by the WEX Framework. All of the resources listed here can be included as dependencies by connecting with our online repository and are periodically updated.

Make sure you use the latest version of wex-parent in order to get the most recent upgrades.

@WexComponent annotation

The @WexComponent annotation is the Kernel's way of identifying the declaration of a feature to be registered. Its presence annotating the class is a requierement for every feature in the below list except when especifically noted.

@WexComponent(uid = "component-id", description = "Component description")

uid must be unique to the Extension.

Items

Class

The below features are class declared.

Listener

Allows the definition of a Windchill Event Listener.

@WexComponent(uid = "wex-watermark-adv-pub-listener", description = "Watermark Advanced Publish istener")
@WexWtListener({
    @WexWtEventKey(eventClass = PublishServiceEvent.class, keys = PublishServiceEvent.PUBLISH_SUCCESSFUL, supported
            = {WTDocument.class, EPMDocument.class, WTPart.class})})

public class ListenerClass implements IWexWtListener<Object> {

    @Override
    public void onEvent(KeyedEvent event, String key, Object target) throws Exception {

    }
Kernel Ready Listener

Allows to execute code when Kernel has finished initializing.

@WexComponent(uid = "id", description = "")
public class WexKernelReadyListener implements IWexKernelsReadyListener {

    public void onReady(WexKernelManager manager) {

    }

}
Method Server Ready Listener

Allows to execute logic on Method Server ready.

@WexComponent(uid = "comp-id", description = "Description")
public class DoStartUps implements IWexMethodServerReadyListener {

    @Override
    public void onMethodServerReady() throws Exception {

    }

}
Package Listener

Allows to listen for WEX Package events. Will execute on package deployment and undeployment.

@WexComponent(uid = "id", description = "")
public class WexPackageListener implements IWexPackageListener {

    @Override
    public void onInitialized(WexKernelPackage wkp) {

    }

    @Override
    public void onTerminate(WexKernelPackage wkp) {

    }

}

Class Feature

Used to define a class feature. This is usefull for defining Bean classes that will be accessed in a JSP usign the "bean" tag library definition in "wex-kernel.tld".

@WexComponent(uid = "component-id", description = "")
@WexClass
public class Class {

}

Command

Allows to define commandline command that can be execute from Windchill Shell.

@WexComponent(uid = "wex-cmd", description = "Command")
public class RemoveCommand implements Serializable, RemoteAccess, IWexCommandLine {

    @Override
    public int execute(String[] args) throws Exception {
        // execution code
    }
}

Data Utility

Allows to define new Data Utilities.

@WexDataUtility(value = "id", available = @WexAvailableAttribute(types = {"wt.part.WTPart"}, label = "column-id"))
@WexComponent(uid = "component-id", description = "Column")
public class CNResultingDataUtility extends AbstractDataUtility {

    @Override
    public Object getDataValue(String string, Object o, ModelContext mc) throws WTException {
        // 
    }

}

Enumeration Info Provider

@WexComponent(uid = "enum-info-provider", description = "Enumeration Info Provider")
public class EnumerationInfoProvider extends WexAbstractEnumerationInfoProvider {

    @Override
    public EnumerationInfo getEnumerationInfo() {

    }

    @Override
    public void initialize(String params) {

    }
}

Object Form Processor

Dynamically registers a Form Processor, which is actually a delegate of the base WexObjectFormProcessor.

@WexComponent(uid = "ExampleWizardFormProcessor", description = "Example form processor")
public class ExampleWizardFormProcessor extends DefaultObjectFormProcessor {

    @Override
    public FormResult doOperation(NmCommandBean ncb, List<ObjectBean> list) throws WTException {

    }        
}

Object Form Processor Delegate

Dynamically registers a Form Processor Delegate.

@WexComponent(uid = "ExampleWizardFormProcessorDelegate", description = "Example form processor")
public class ExampleWizardFormProcessorDelegate extends WexObjectFormProcessorDelegate {

    @Override
    public FormResult doOperation(NmCommandBean ncb, List<ObjectBean> list) throws WTException {

    }        
}

Populator

Allows to define a populator for a new custom feature.

@WexComponent(uid = "populator", description = "Populator")
public class WexWindchillPopulator implements IWexFeaturesPopulator {

    @Override
    public void populate(WexKernelManager manager, WexKernelPackage wex, WexRegistry registry, IWexRegistered registered) {

    }

}

Resource Bundle

Allows adding resource bundle information.

@WexComponent(uid = "com.wincomplm.wex.extension.resources.WexResources", description = "Resource bundle")
@RBUUID("id")
@RBNameException
public class WexResources extends WTListResourceBundle {

}

Service

Allows defining an internal WEX Service.

@WexComponent(uid = "id", description = "Description")
@WexService(TargetClass.class)
public class Executor {

}

WtService

Allows adding/modifying Windchill services.

@WtService(file = "com/ptc/windchill/uwgm/cadx.properties", service = JSTableTaskSubmitHelper.class, selector = "SaveAsTaskSubmitHelper")
@WexComponent(uid = "id", description = "")
public class WtService  {

}

Spring Aware Feature

Allows extension to execute code and accessing Spring Context.

@WexComponent(uid = "id", description = "Description")
public class SAFeature implements IWexSpringAwareDelegate {

}

Suggestable

Used to annotate a Suggestable class for the UI.

@WexComponent(uid = "id", description = "Description")
@WexSuggestable(selectors = "selectors")
public class Feature implements Suggestable {

 @Override
    public Collection<SuggestResult> getSuggestions(SuggestParms sp) {
        ArrayList<SuggestResult> result = new ArrayList<>();

        return result;
    }
}

Validator

Allows adding validators to Windchill.

@WexValidator({"exampleManager"})
@WexComponent(uid = "wex-example-ui.validator", description = "Menu validator")
public class WexMenuAdminUIValidator extends WexAdminUIValidator { 

    @Override
    public UIValidationStatus preValidateAction(UIValidationKey uivk, UIValidationCriteria uivc) {

    }//preValidateAction

}

BeanFeature

Allows defining/overriding existing Spring Beans.

@WexComponent(uid = "id", description = "Description")
@WexBean("id")
public class BeanFeature {

}

JMXBeanFeature

Use to define Bean that can be used for JVM communication using JMX.

@WexComponent(uid = "id", description = "Description")
public class JMXBeanFeature implements WexJmxMBean {

}

Shared Cache

@WexComponent(uid = "id", description = "Description")
@WexSharedCache("id")
public class SharedCacheFeature extends WexChildCache{

}

Method

The below features are method declared and scoped.

Wex Method

Allows defining a method that will be accesible via WexInvoke.

@WexComponent(uid = "methods", description = "Invokable methods")
public class WexMethods {

    @WexMethod(name = "id", description = "")
    public String method() throws Exception {

    }

}

Action Method

Allows to define logic that needs to be executed for a Windchill action.

@WexComponent(uid = "action-methods", description = "Action methods")
public class ActionMethods {

    @WexActionMethod("action-id")
    public static Object actionMethod(NmCommandBean ncb) {
    }

Shell Method

Used to define method available in the WEX Shell.

@WexComponent(uid = "admin", description = "Wex example shell commands")
public class WexExampleShell {

    @WexShellMethod(alias = "ec", description = "Example Command")
    public void list() throws Exception {
        System.out.println("Shell result");
    }
}