Skip to content

This is an adapter which implements the binding of the VanillaBP SPI in order to run business processes using Camunda 7.

License

Notifications You must be signed in to change notification settings

camunda-community-hub/vanillabp-camunda7-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compatible with: Camunda Platform 7

Maven Central Apache License V.2

VanillaBP

Camunda 7 adapter

This is an adapter which implements the binding of the VanillaBP SPI in order to run business processes using Camunda 7.

If you are interested in migrating to Camunda 8 then checkout the drop-in replacement adapter for Camunda 8 as well as the documentation of migration scenarios.

Runtime environments

Currently, only Spring Boot is supported by including this Maven dependency:

<dependency>
  <groupId>org.camunda.community.vanillabp</groupId>
  <artifactId>camunda7-spring-boot-adapter</artifactId>
</dependency>

To learn about details of the adapter checkout the module's README.

How it looks like

This is a section of a taxi ride workflow and should give you an idea of how the VanillaBP SPI is used in your business code. To learn more about VanillaBP checkout the SPI documentation.

Section of a taxi ride workflow
Screenshot of Camunda Modeler

@Service
@WorkflowService(workflowAggregateClass = Ride.class)
@Transactional(noRollbackFor = TaskException.class)
public class TaxiRide {
    
    @Autowired
    private ProcessService<Ride> processService;
    
    public String rideBooked(
            final Location pickupLocation,
            final OffsetDateTime pickupTime,
            final Location targetLocation) {
        
        final var ride = new Ride();
        ...
        // start the workflow by correlation of the message start event
        return processService
                .correlateMessage(ride, "RideBooked")
                .getRideId();
    }
    
    @WorkflowTask
    public void determinePotentialDrivers(
            final Ride ride) {
        
        final var parameters = new DriversNearbyParameters()
                .longitude(ride.getPickupLocation().getLongitude())
                .latitude(ride.getPickupLocation().getLatitude());

        final var potentialDrivers = driverService
                .determineDriversNearby(parameters);

        ride.setPotentialDrivers(
                mapper.toDomain(potentialDrivers, ride));
    }

    @WorkflowTask
    public void requestRideOfferFromDriver(
            final Ride ride,
            @MultiInstanceIndex("RequestRideOffer")
            final int potentialDriverIndex) {
        
        final var driver = ride.getPotentialDrivers().get(potentialDriverIndex);
        
        driverService.requestRideOffer(
                driver.getId(),
                new RequestRideOfferParameters()
                        .rideId(ride.getRideId())
                        .pickupLocation(mapper.toApi(ride.getPickupLocation()))
                        .pickupTime(ride.getPickupTime())
                        .targetLocation(mapper.toApi(ride.getTargetLocation())));
        
    }
    ...

Noteworthy & Contributors

VanillaBP was developed by Phactum with the intention of giving back to the community as it has benefited the community in the past.

Phactum

License

Copyright 2022 Phactum Softwareentwicklung GmbH

Licensed under the Apache License, Version 2.0

About

This is an adapter which implements the binding of the VanillaBP SPI in order to run business processes using Camunda 7.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •  

Languages