Package org.enhydra.shark.api.client.wfservice

Examples of org.enhydra.shark.api.client.wfservice.PackageAdministration


        try {

            sc = connect();

            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);

            WMEntity entity = null;
            //update package
            if (packageId != null && packageId.trim().length() > 0) {

                // update package
                entity = pa.updatePackage(sessionHandle, packageId, processDefinitionData);

            } else {
                entity = pa.uploadPackage(sessionHandle, processDefinitionData);
            }
            pa.synchronizeXPDLCache(sessionHandle);

            if (entity != null) {
                instanceId = entity.getId();
            }
View Full Code Here


                    LogUtil.info(getClass().getName(), " -- Could not delete process " + instanceId + ": " + e.toString());
                }
            }

            // unload
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            pa.closePackage(sessionHandle, packageId, version);



        } catch (Exception ex) {
View Full Code Here

            // delete process instances
            LogUtil.info(getClass().getName(), "Deleting all running processes for " + packageId);
            Shark shark = Shark.getInstance();
            ExecutionAdministration ea = shark.getExecutionAdministration();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            WAPI wapi = shark.getWAPIConnection();
            WfProcessIterator wpi = sc.get_iterator_process();
            ProcessFilterBuilder fb = shark.getProcessFilterBuilder();
            WMFilter filter = fb.addPackageIdEquals(sessionHandle, packageId);
            wpi.set_query_expression(fb.toIteratorExpression(sessionHandle, filter));
            WfProcess[] procs = wpi.get_next_n_sequence(0);
            for (int i = 0; i < procs.length; i++) {
                String instanceId = procs[i].key();
                if (procs[i].state().startsWith(SharkConstants.STATEPREFIX_OPEN)) {
                    wapi.terminateProcessInstance(sessionHandle, instanceId);
                    LogUtil.info(getClass().getName(), " -- Terminated open process " + instanceId);
                }
                ea.deleteProcesses(sessionHandle, new String[]{instanceId});
                LogUtil.info(getClass().getName(), " -- Deleted process " + instanceId);
            }

            // unload
            pa.closeAllPackagesForId(sessionHandle, packageId);



        } catch (Exception ex) {
View Full Code Here

        }
    }

    protected PackageAdministration getSharkPackageAdmin(WMSessionHandle sessionHandle) throws Exception {
        Shark shark = Shark.getInstance();
        PackageAdministration pa = shark.getPackageAdministration();

        // check for changed profile
        String currentProfile = DynamicDataSourceManager.getCurrentProfile();
        boolean profileChanged = (currentProfile != null && !currentProfile.equals(previousProfile));
        previousProfile = currentProfile;
        if (profileChanged) {
            // clear process definition cache
            synchronized (this) {
                pa.clearXPDLCache(sessionHandle);
            }
        }

        return pa;
    }
View Full Code Here

TOP

Related Classes of org.enhydra.shark.api.client.wfservice.PackageAdministration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.