Hi Shenavi,

>
>
>
>
>
>
> *String resourcePath =
> requestContext.getResourcePath().getPath();Association[] associations = new
> Association[0];GovernanceArtifact governanceArtifact =
> GovernanceUtils.retrieveGovernanceArtifactByPath(requestContext.getSystemRegistry(),resourcePath);GovernanceArtifactManager
> governanceArtifactManager = new
> GovernanceArtifactManager(requestContext.getSystemRegistry(),"application/vnd.wso2-restservice+xml","overview_name",null,"metadata","http://www.wso2.org/governance/metadata
> <http://www.wso2.org/governance/metadata>","/trunk/restservices/@{overview_version}/@{overview_name}",associations);*
>

Try using GenericArtifactManager instead of GovernanceArtifactManager as
below,

GenericArtifactManager genericArtifactManager = new
GenericArtifactManager(gov, "restservice");
genericArtifactManager.updateGenericArtifact(governanceArtifact);

Please check executor samples [1][2] for more information.

1.
https://github.com/wso2/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.registry.extensions/src/org/wso2/carbon/governance/registry/extensions/executors/apistore/ServiceToAPIExecutor.java#L139-L147
2.
https://github.com/wso2/carbon-governance/blob/master/components/governance/org.wso2.carbon.governance.registry.extensions/src/org/wso2/carbon/governance/registry/extensions/executors/apistore/RestServiceToAPIExecutor.java#L131-L135


>
>
> *governanceArtifact.setAttribute("uritemplate_urlPattern","/test/wso2");governanceArtifactManager.updateGovernanceArtifact(governanceArtifact);*
>
> [2016-09-29 17:16:15,598] ERROR {org.wso2.carbon.commonAPI.lif
> ecycleManager.APILifecycleExecutor} -  Error updating
> [2016-09-29 17:16:15,601] ERROR {org.wso2.carbon.commonAPI.lif
> ecycleManager.APILifecycleExecutor} -  org.wso2.carbon.governance.ap
> i.exception.GovernanceException: No artifact found for the artifact id
> :67dbd592-0533-4133-a372-5408d2f839e0.
> [2016-09-29 17:16:15,766]  INFO 
> {org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService}
> -  Configured Registry in 2ms
> [2016-09-29 17:16:15,890] ERROR {rxt.asset} -  Failed to invoke action:
> Promote for the asset of id: "67dbd592-0533-4133-a372-5408d2f839e0".The
> following exception was thrown: JavaException:
> org.wso2.carbon.registry.core.exceptions.RegistryException: The
> transaction is already rollbacked, you can not commit a transaction already
> rollbacked, nested depth: 1.
> [2016-09-29 17:16:15,892] ERROR 
> {JAGGERY.extensions.assets.default.apis.asset:jag}
> -  org.wso2.carbon.registry.core.exceptions.RegistryException: The
> transaction is already rollbacked, you can not commit a transaction already
> rollbacked, nested depth: 1.
>

Thanks
-- 

*Danesh Kuruppu*
Senior Software Engineer | WSO2

Email: [email protected]
Mobile: +94 (77) 1690552
Web: WSO2 Inc <https://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to