Skip to content

Conversation

@stiv03
Copy link
Contributor

@stiv03 stiv03 commented Oct 1, 2025

No description provided.

@stiv03 stiv03 force-pushed the fix-add-service-offering-name-and-plan branch from b18b2f4 to 65a8b56 Compare October 2, 2025 10:36
@stiv03 stiv03 changed the title fix serviceBindingToDelete collection in undeploy-app.bpmn fix null value from get existing offering and service plan during binding failure Oct 2, 2025
@stiv03 stiv03 force-pushed the fix-add-service-offering-name-and-plan branch from 65a8b56 to 74d2380 Compare October 2, 2025 10:57
CloudControllerClient client = context.getControllerClient();

String serviceInstanceName = context.getVariable(Variables.SERVICE_TO_UNBIND_BIND);
if (serviceInstanceName == null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract into a new method whole logic related with getting service instance name and avoid setting finalServiceInstanceName because it is little bit confusing to have 2 variables for the same thing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed! Done!


return serviceBindingJob -> context.getStepLogger()
.error(buildErrorMessage(app, serviceInstance, serviceInstanceName, serviceBindingJob));
CloudServiceInstance serviceInstance = (serviceInstanceName != null) ? client.getServiceInstance(serviceInstanceName, false) : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brackets can be omitted

Copy link
Contributor Author

@stiv03 stiv03 Oct 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed!

if (serviceInstanceName == null) {
CloudServiceBinding serviceBinding = context.getVariable(Variables.SERVICE_BINDING_TO_DELETE);
if (serviceBinding != null) {
serviceInstanceName = client.getServiceInstanceName(serviceBinding.getServiceInstanceGuid());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice up until now that this actually perform another call to the cf api, can you search for another way to retrieve service instance name, from different variable or pass service instance name from different process diagram. We are trying to avoid unnecessary http calls to the cf api because this increase chances to hit rate limit at user level.

@Yavor16 Yavor16 merged commit 58376c5 into cloudfoundry:master Oct 6, 2025
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants