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

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


     * @param version
     * @return
     */
    public byte[] getPackageContent(String packageId, String version) {

        SharkConnection sc = null;
        byte[] data = null;

        try {

            sc = connect();

            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            data = pa.getPackageContent(sessionHandle, packageId, version);


        } catch (Exception ex) {
View Full Code Here


     * @param packageId
     * @param version
     * @return
     */
    public WorkflowPackage getPackage(String packageId, String version) {
        SharkConnection sc = null;
        WorkflowPackage workflowPackage = null;
        try {
            sc = connect();

            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            WMEntity entity = pa.getPackageEntity(sessionHandle, packageId, version);
            workflowPackage = new WorkflowPackage();
            workflowPackage.setPackageId(packageId);
            workflowPackage.setPackageName(entity.getName());
View Full Code Here

     * @param packageId
     * @return null if the package is not available.
     */
    public String getCurrentPackageVersion(String packageId) {

        SharkConnection sc = null;
        String packageVersion = null;
        try {
            sc = connect();

            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            packageVersion = pa.getCurrentPackageVersion(sessionHandle, packageId);

        } catch (Exception ex) {
            //comment out the log because of exception will always throw when new package deploy
View Full Code Here

     * @param packageId Optional, to show only processes with the specified package ID
     * @param version Optional, to show only for the specified version
     * @return
     */
    public Collection<WorkflowProcess> getProcessList(String packageId, String version) {
        SharkConnection sc = null;
        Collection<WorkflowProcess> processList = new ArrayList<WorkflowProcess>();
        Map<String, WorkflowProcess> processMap = new TreeMap<String, WorkflowProcess>();
        try {
            sc = connect();

            WfProcessMgrIterator pmi = sc.get_iterator_processmgr();

            //filter by package Id
            if (packageId != null && packageId.trim().length() > 0) {
                String sql = " /*sql PackageId='" + packageId + "'";
                if (version != null && version.trim().length() > 0) {
                    sql += " AND ProcessDefinitionVersion='" + version + "'";
                }
                sql += " sql*/";
                pmi.set_query_expression(sql);
            }
            WfProcessMgr[] processMgrs = pmi.get_next_n_sequence(0);
            Shark shark = Shark.getInstance();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            AdminMisc admin = shark.getAdminMisc();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            for (int i = 0; i < processMgrs.length; i++) {
                WfProcessMgr pm = processMgrs[i];
                WMEntity ent = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processMgrs[i].name());
View Full Code Here

     * @param instanceId
     * @return
     */
    public String getProcessDefIdByInstanceId(String instanceId) {

        SharkConnection sc = null;
        String processDefId = null;

        try {

            sc = connect();

            WfProcess wfProcess = sc.getProcess(instanceId);
            processDefId = (wfProcess != null ? wfProcess.manager().name() : null);


        } catch (Exception ex) {

View Full Code Here

     * @param processDefId
     * @return
     */
    public WorkflowProcess getProcess(String processDefId) {

        SharkConnection sc = null;
        WorkflowProcess wp = null;


        try {

            sc = connect();

            Shark shark = Shark.getInstance();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            AdminMisc admin = shark.getAdminMisc();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);

            WfProcessMgr pm = sc.getProcessMgr(processDefId);
            WMEntity ent = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);

            if (pm != null && ent != null) {
                wp = new WorkflowProcess();
                wp.setId(pm.name());
View Full Code Here

     * @return
     */
    public Collection<WorkflowActivity> getProcessActivityDefinitionList(String processDefId) {
        Collection<WorkflowActivity> activityList = new ArrayList<WorkflowActivity>();

        SharkConnection sc = null;

        try {

            sc = connect();

            Shark shark = Shark.getInstance();
            AdminMisc admin = shark.getAdminMisc();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            getSharkPackageAdmin(sessionHandle); // invoke this to clear xpdl cache

            WMEntity ent = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
            XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
            WMEntity[] activities = WMEntityUtilities.getAllActivities(sessionHandle, xpdlBrowser, ent);
View Full Code Here

     * @return
     */
    public Map<String, WorkflowParticipant> getParticipantMap(String processDefId) {
        Map<String, WorkflowParticipant> participantMap = new SequencedHashMap();

        SharkConnection sc = null;

        try {
            sc = connect();

            Shark shark = Shark.getInstance();
            XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
            AdminMisc admin = shark.getAdminMisc();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);

            // get package participants
            WMEntity ent = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
            WMEntity packageEntity = pa.getPackageEntity(sessionHandle, ent.getPkgId(), ent.getPkgVer());
View Full Code Here

     * @return
     */
    public Collection<WorkflowVariable> getProcessVariableDefinitionList(String processDefId) {
        Collection<WorkflowVariable> variableList = new ArrayList<WorkflowVariable>();

        SharkConnection sc = null;

        try {

            sc = connect();

            Shark shark = Shark.getInstance();
            AdminMisc admin = shark.getAdminMisc();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            PackageAdministration pa = getSharkPackageAdmin(sessionHandle);
            WMEntity processEntity = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
            WMEntity packageEntity = pa.getPackageEntity(sessionHandle, processEntity.getPkgId(), processEntity.getPkgVer());
            XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();

View Full Code Here

     * @return
     */
    public Collection<WorkflowTool> getProcessToolDefinitionList(String processDefId) {
        Collection<WorkflowTool> toolList = new ArrayList<WorkflowTool>();

        SharkConnection sc = null;

        try {

            sc = connect();

            Shark shark = Shark.getInstance();
            AdminMisc admin = shark.getAdminMisc();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            WMEntity processEntity = admin.getProcessDefinitionInfoByUniqueProcessDefinitionName(sessionHandle, processDefId);
            XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
            WMEntity[] applications = WMEntityUtilities.getAllApplications(sessionHandle, xpdlBrowser, processEntity);
            for (int i = 0; i < applications.length; i++) {
                WMEntity entity = applications[i];
View Full Code Here

TOP

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

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.