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

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


            }
        }
    }

    public void assignmentForceComplete(String processDefId, String processId, String activityId, String username) {
        SharkConnection sc = null;

        try {
            sc = connect();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            WfAssignment wfa = getWfAssignmentByActivityId(sc, activityId);
            WfResource res = sc.getResource(username);

            if (res == null) {
                CustomWfResourceImpl.createResource(sessionHandle, username);
                res = sc.getResource(username);
            }

            if (wfa.assignee() == null || (wfa.assignee() != null && !res.resource_key().equals(wfa.assignee().resource_key()))) {
                wfa.set_assignee(res);
            }
View Full Code Here


     * @param variableName
     * @param variableValue
     */
    public void assignmentVariable(String activityId, String variableName, String variableValue) {

        SharkConnection sc = null;

        try {

            sc = connect();

View Full Code Here

     * @param processInstanceId
     * @param activityDefId
     * @return
     */
    protected String getPerformer(String processId, String activityDefId) {
        SharkConnection sc = null;

        try {

            sc = connect();

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

            WfProcess process = sc.getProcess(processId);

            if (process != null) {
                if (activityDefId.equals(WorkflowUtil.ACTIVITY_DEF_ID_RUN_PROCESS)) {
                    return admin.getProcessRequesterUsername(sessionHandle, processId);
                } else {
View Full Code Here

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

        SharkConnection sc = null;

        try {

            sc = connect();

View Full Code Here

     * @param processInstanceId
     * @param activityInstanceId
     * @return
     */
    public List<String> getAssignmentResourceIds(String processId, String processInstanceId, String activityInstanceId) {
        SharkConnection sc = null;
        List<String> resourceIds = null;
        try {

            sc = connect();
            WMSessionHandle shandle = sc.getSessionHandle();
            resourceIds = CustomWfActivityWrapper.getAssignmentResourceIds(shandle, processId, processInstanceId, activityInstanceId);

        } catch (Exception ex) {
            LogUtil.error(getClass().getName(), ex, "");
        } finally {
View Full Code Here

     * Connect to the Shark engine using the current username.
     * @return
     * @throws Exception
     */
    protected SharkConnection connect(String username) throws Exception {
        SharkConnection sConn = Shark.getInstance().getSharkConnection();
        if (username == null) {
            username = getWorkflowUserManager().getCurrentUsername();
        }
        WMConnectInfo wmconnInfo = new WMConnectInfo(username, username, "WorkflowManager", "");
        sConn.connect(wmconnInfo);
        return sConn;
    }
View Full Code Here

    /**
     * Populates the 'participant' property for each assignment in the Collection based on the XPDL definition.
     * @param assignmentList
     */
    protected void participantsForAssignment(Collection<WorkflowAssignment> assignmentList) {
        SharkConnection sc = null;

        try {
            sc = connect();

            Shark shark = Shark.getInstance();
            AdminMisc admin = shark.getAdminMisc();
            XPDLBrowser xpdlBrowser = shark.getXPDLBrowser();
            for (Iterator<WorkflowAssignment> i = assignmentList.iterator(); i.hasNext();) {
                WorkflowAssignment assignment = (WorkflowAssignment) i.next();


                // get activity and process
                WMSessionHandle sessionHandle = sc.getSessionHandle();
                WMEntity activityEntity = admin.getActivityDefinitionInfo(sessionHandle, assignment.getProcessId(), assignment.getActivityId());

                // get performer
                WMFilter filter = new WMFilter("Name", WMFilter.EQ, "Performer");
                filter.setFilterType(XPDLBrowser.SIMPLE_TYPE_XPDL);
View Full Code Here

        long intervalInMillis = deadlineCheckerIntervalValue * 1000;
        DeadlineThreadManager.startThread(intervalInMillis);
    }

    public void internalCheckDeadlines(int instancesPerTransaction, int failuresToIgnore) {
        SharkConnection sc = null;

        try {
            sc = connect();

            WMSessionHandle shandle = sc.getSessionHandle();
            Shark shark = Shark.getInstance();
           
            shark.getExecutionAdministration().checkDeadlinesWithFiltering(shandle, null);
        } catch (Exception ex) {
            LogUtil.error(getClass().getName(), ex, "");
View Full Code Here

            }
        }
    }
   
    public Collection<String> getRunningProcessIds() {
        SharkConnection sc = null;
        Collection<String> runningProcesseIds = new ArrayList<String>();
       
        try {
            sc = connect();
           
            WfProcessIterator pi = sc.get_iterator_process();

            String sharkExpression = "stateequals.(\"open.running\")";
            String sqlExpression = "State = (SELECT oid FROM SHKProcessStates WHERE Name = 'open.running')";

            String query_expression = "(" + sharkExpression + ")" + " /*sql (" + sqlExpression + ") sql*/ ";
View Full Code Here

        }
        return runningProcesseIds;
    }
   
    public boolean internalCheckDeadlines(String[] pids) {
        SharkConnection sc = null;
        boolean success = false;
       
        try {
            sc = connect();
            WMSessionHandle shandle = sc.getSessionHandle();
            Shark shark = Shark.getInstance();
           
            shark.getExecutionAdministration().checkDeadlinesForProcesses(shandle, pids);
            success = true;
        } catch (Exception ex) {
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.