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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

odata function to get distribution target publishing and transaction status

JD_8606834
10-Marble

odata function to get distribution target publishing and transaction status

Hi all,

I have te requirement to get the status (no/sucess/failure) of a specific distribution target by calling a odata service.

 

JD_8606834_0-1678278640649.png

There can be more then one.

 

Does anyone know, how to get the highlighted values above by using odata?

 

Thanks,

Jürgen

8 REPLIES 8

Hi @JD_8606834 

The help center can be useful. use a RestAPI

 

GET Windchill/servlet/odata/ESI/DistributionTargets

 

DistributionTargetsAssoWithContext

 

Hope this can help

PetrH

Hi PetrH,

thanks for your reply.

 

if I understand it correctly, the functions that you are mentioning are kind of general functions, not in the context of a part.

I need a service, to which I can pass a part id/number and it will return the status of the transaction for exactly that particular part.

 

All the part related odata services that I tried do return a lot of attributes but not the status of the transactions related to every assigned distribution target.

 

Thanks,

Jürgen

Hi @JD_8606834 

If you have gone through others sections in the help you would find this>

example_esi_retrieve_DistributionTargetsAssoWithWCObjects

 

Hope this can help.

 

PetrH

Hi PetrH,

thanks, sorry, I missed that service in the help.

I tried the call mentioned in help and it does return a lot of information regarding the assigned distribution targets but I can't find the transaction status (failed, pending, succeeded). Do I miss something again?
Here is the result of calling Windchill/servlet/odata/ESI/GetAssignedDistributionTargets?$expand=DistributionTargets

{
    "@odata.context""$metadata#Releasables",
    "value": [
        {
            "CreatedOn""2017-03-25T10:13:26Z",
            "ID""OR:wt.part.WTPart:185873979",
            "LastModified""2022-09-01T01:08:01Z",
            "Name""O-RING",
            "Number""6342151-SPK",
            "ObjectType""Service Part Kit",
            "DistributionTargets": [
                {
                    "@odata.type""#PTC.ESI.SOAPService",
                    "AllocationTypes""PRODUCED",
                    "CreatedOn""2021-05-29T06:05:34Z",
                    "DefaultForContext"false,
                    "Description""Distribution Target for Technet using Biztalk Service",
                    "ESIBOMAlternateFlag"false,
                    "ESIBOMCoProductFlag"null,
                    "ESIBOMComponentPartFlag"true,
                    "ESIBOMConfigurationSpecification"null,
                    "ESIBOMDeltaFlag"true,
                    "ESIBOMDocumentFlag"true,
                    "ESIBOMLineNumberFlag"true,
                    "ESIBOMMultiLevelFlag"9999999,
                    "ESIBOMPartFlag"true,
                    "ESIBOMPublishProductionBOMFlag"true,
                    "ESIBOMReferenceDesignatorFlag"false,
                    "ESIBOMSavedFilter""OR:wt.filter.NavigationCriteria:68207449",
                    "ESIBOMSubstituteFlag"true,
                    "ESIECNAlternateFlag"false,
                    "ESIECNBOMPartFlag"true,
                    "ESIECNCoProductFlag"null,
                    "ESIECNComponentPartFlag"true,
                    "ESIECNConfigurationSpecification"null,
                    "ESIECNDeltaFlag"true,
                    "ESIECNDocumentFlag"false,
                    "ESIECNLineNumberFlag"true,
                    "ESIECNMultiLevelFlag"1,
                    "ESIECNPPBOMPartFlag"true,
                    "ESIECNPPOperatedOnPartFlag"true,
                    "ESIECNPPPartLinkFlag"true,
                    "ESIECNPPResourceFlag"true,
                    "ESIECNPPSequenceFlag"true,
                    "ESIECNPPStandardProcedureFlag"true,
                    "ESIECNPPSuboperationDepth"1,
                    "ESIECNPublishProductionBOMFlag"true,
                    "ESIECNReferenceDesignatorFlag"true,
                    "ESIECNSavedFilter""Default",
                    "ESIECNSubstituteFlag"true,
                    "ESIECNUseSavedFilterForPPPartLinksFlag"true,
                    "ESIECNWorkInstructionsFlag"false,
                    "ESIEPMDocumentContentSelection"null,
                    "ESIEPMDocumentDeltaFlag"true,
                    "ESIEPMDocumentMultiLevelFlag"0,
                    "ESIEPMDocumentRepresentationCollectionFilter"null,
                    "ESIEPMDocumentSavedFilter""Default",
                    "ESIEPMDocumentUseDefaultRepresentations"null,
                    "ESIEPMReferenceDocumentFlag"false,
                    "ESIPPAlternateFlag"true,
                    "ESIPPBOMPartFlag"true,
                    "ESIPPComponentPartFlag"true,
                    "ESIPPConfigurationSpecification"null,
                    "ESIPPControlCharacteristicFlag"false,
                    "ESIPPDeltaFlag"true,
                    "ESIPPDocumentFlag"true,
                    "ESIPPLineNumberFlag"true,
                    "ESIPPMultiLevel"1,
                    "ESIPPOperatedOnPartFlag"true,
                    "ESIPPPartLinkFlag"true,
                    "ESIPPPublishProductionBOMFlag"true,
                    "ESIPPReferenceDesignatorFlag"true,
                    "ESIPPResourceFlag"true,
                    "ESIPPSavedFilter""Default",
                    "ESIPPSequenceFlag"true,
                    "ESIPPStandardProcedureFlag"true,
                    "ESIPPSuboperationDepth"1,
                    "ESIPPSubstituteFlag"true,
                    "ESIPPUseSavedFilterForPPPartLinksFlag"true,
                    "ESIPPWorkInstructionsFlag"false,
                    "ESIPartAlternateFlag"false,
                    "ESIPartControlCharacteristicFlag"false,
                    "ESIPartDocumentFlag"true,
                    "ESIResourceDeltaFlag"true,
                    "ESIResourceDocumentFlag"true,
                    "ESIResourceMultiLevelFlag"0,
                    "ESIResourceSavedFilter""Default",
                    "ESIResponseOutputFormat": {
                        "Value""ESI_RESPONSE_FORMAT_ESI_XML",
                        "Display""ESI XML"
                    },
                    "EffectivityFormat""yyyy-MM-dd HH:mm:ss",
                    "ID""OR:com.ptc.windchill.esi.tgt.ESITarget:68199590",
                    "LastModified""2021-10-09T04:36:26Z",
                    "Name""TECHNET-SPC",
                    "Number""TECHNET-SPC",
                    "ObjectType""SOAP Service",
                    "Status""active",
                    "System"null,
                    "ExtFmcEndpoint""******",
                    "ExtFmcXSLResult""/ext/fmc/integrations/outbound/SOAP_RESULT.xsl",
                    "ExtFmcXSLURL""/ext/fmc/integrations/outbound/SOAP_SERVICE.xsl"
                }
            ]
        }
    ],
    "@PTC.AppliedContainerContext.LocalTimeZone""UTC"
}

 

 

Thanks,

Jürgen

 

I executed the call again for a part, which has a different transaction status (pending<->succeeded) and I compared the results.

Only some part specific attributes in the header (like id, last modified etx.) aredifferent.
All the values regarding the distribution targets are exactly the same

Hi @JD_8606834 

 

I don't have experience with the result of the rest api method, but there can be explanation.

 

DistributionTarget status

1- is connected to the master (the iteration does not matter)

2- is connect to the revision (the revision matters)

3- is connected to the iteration (this is not your result so I guess it is not connected to the iteration)

 

You need to experiment with the method what kind of results you can get and so on. 

 

I've just found the api you asked for. 

 

PetrH

Hi PetrH,

thanks again, I will try different parameters and see, if there is a valid response.

 

Thanks,

Jürgen

Hi All,

the solution, that PetrH suggest was close to what I need, but even with trying different IDs, I don't see the transaction status.

Maybe, there is another navigation, that I can expand like "Transactions" or something like this, but I don't see any.

Does anybody know, how I could expand further?

Thanks,

Jürgen

Announcements


Top Tags