Search code examples
javamaximo

Customize MAXIMO purchase contract to be multi-vendor


I'm try to customize a Maximo distribution by editing the java classes.

The business would like to insert a purchase contract with multi-vendor capability. The problem is I'll have to authorize all the vendor on the contract on the single site when selecting the action "Authorize Sites" but I cannot find when nor where that action is called.

Inside the Contract class I thought the method would be this:

public void copySitesToContractAuth(SiteSetRemote siteSetRemote) throws MXException, RemoteException

{
for (int i = 0; i < selectedSites.size(); ++i) {
                MboRemote selectedSite = (MboRemote) selectedSites.elementAt(i);
                MboRemote contractAuth = contractAuthSet.add();

                try {
                    contractAuth.setValue("authsiteid", selectedSite.getString("siteid"), 2L);
                } catch (MXApplicationException var8) {
                    contractAuth.delete();
                    throw var8;
                }
            }
}

but it's not since it's not called.

Does anyone have an idea of the correct method that must be override?


Solution

  • I've solved this issue by implementing a crontask that will update the CONTRACTAUTH table. The tricky part was getting the sequential number (contractauthid) right and update the stored maximo reference at runtime.

    Not really an elegant solution but it does the job.