Enhydra Shark

Written by

in

To embed and configure Enhydra Shark (now known as Together Workflow Server) in a modern Java environment, you must treat it as a pluggable POJO library, configure its engine properties manually via java.util.Properties, and wrap its execution within contemporary frameworks like Spring Boot or Jakarta EE. Because Enhydra Shark relies strictly on the Workflow Management Coalition (WfMC) and XPDL specifications, modernization requires bypassing its legacy CORBA, EJB, and Ant-based components in favor of direct dependency management. 📦 1. Modern Dependency Setup

Enhydra Shark is not regularly updated on Maven Central. You must install its core JARs (sharkkernel.jar, sharkapi.jar) into your local or private repository (such as Sonatype Nexus or Apache Archiva), or load them as local file dependencies. Maven Configuration (pom.xml)

org.enhydra.shark shark-kernel 6.4-1 org.enhydra.shark shark-api 6.4-1 jakarta.xml.bind jakarta.xml.bind-api 4.0.1 com.sun.xml.bind jaxb-impl 4.0.1 Use code with caution. ⚙️ 2. Core Engine Configuration

Shark uses a highly modular internal architecture managed by SharkEngineManager. You configure the engine by building a Properties object programmatically or mapping a modern YAML/properties file to it.

import java.util.Properties; import org.enhydra.shark.Shark; public class SharkEngineConfig { public static void initializeShark() { Properties props = new Properties(); // Database and Persistence Plugin Settings props.setProperty(“DatabaseManagerClassName”, “org.enhydra.shark.database.StandardDatabaseManager”); props.setProperty(“Database.Driver”, “org.postgresql.Driver”); props.setProperty(“Database.URL”, “jdbc:postgresql://localhost:5432/shark_db”); props.setProperty(“Database.User”, “postgres”); props.setProperty(“Database.Password”, “securepassword”); // Transaction and Repository Plug-ins props.setProperty(“TransactionManagerClassName”, “org.enhydra.shark.transaction.StandardTransactionManager”); props.setProperty(“RepositoryManagerClassName”, “org.enhydra.shark.repository.StandardRepositoryManager”); // Define XPDL directory path for process storage props.setProperty(“RepositoryManager.XPDLFolder”, “./workflows/xpdl”); // Engine Initialization Shark.configure(props); } } Use code with caution. 🚀 3. Initializing and Executing Processes

Once configured, you access the engine through its main interface singleton to load your Together Workflow Editor (JaWE) generated XPDL maps, instantiate processes, and complete activities.

import org.enhydra.shark.api.client.wfservice.SharkConnection; import org.enhydra.shark.SharkEngineManager; public class WorkflowService { private SharkConnection connection; public void runWorkflow() throws Exception { // Open POJO-based connection connection = SharkEngineManager.getInstance().getSharkConnection(); connection.connect(“admin”, “password”, “”, “”); // 1. Upload the XPDL workflow package String packageId = SharkEngineManager.getInstance() .getPackageAdmin() .uploadPackage(new java.io.File(“./workflows/leave_request.xpdl”).getAbsolutePath()); // 2. Instantiate the workflow process String processDefinitionId = “LeaveRequestProcess”; String processInstanceId = connection.createProcessInstance(processDefinitionId); connection.startProcessInstance(processInstanceId); System.out.println(“Workflow started successfully with Instance ID: ” + processInstanceId); } } Use code with caution. 🛡️ 4. Overcoming Compatibility Pitfalls

Because Enhydra Shark was authored during older generations of Java, observe the following constraints when deploying to modern environments:

Bypassing Legacy Persistence: Shark natively shipped with DODS (Data Object Design Studio). Swap this out for standard JDBC or standard Hibernate implementations in Shark.conf / Properties.

Java Module System (JPMS): Shark utilizes reflection heavily across internal components. When running on modern JVMs (Java ⁄21+), you must append the following JVM arguments to prevent InaccessibleObjectException:

–add-opens java.base/java.lang=ALL-UNNAMED –add-opens java.base/java.util=ALL-UNNAMED Use code with caution.

XML Parser Overrides: Shark’s embedded XPDL parsing engine can conflict with modern Spring Boot XML configurations. Explicitly configure your dependency management to exclude legacy xerces or xml-apis JARs if they are pulled transitively.

If you would like to tailor the implementation further, please share: Study of WFMS Interoperability Based on EnHydra Shark

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *