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

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


     * @param processId
     * @return
     */
    public int getActivitySize(String processId) {

        SharkConnection sc = null;
        int size = 0;
        try {

            sc = connect();

            Shark shark = Shark.getInstance();
            WfActivityIterator ai = sc.get_iterator_activity();
            ActivityFilterBuilder aieb = shark.getActivityFilterBuilder();
            WMSessionHandle sessionHandle = sc.getSessionHandle();

            WMFilter filter = new WMFilter();

            if (processId != null && processId.trim().length() > 0) {
                filter = aieb.addProcessIdEquals(sessionHandle, processId);
View Full Code Here


     * @param activityId
     * @return
     */
    public WorkflowActivity getActivityById(String activityId) {

        SharkConnection sc = null;
        WorkflowActivity workflowActivity = new WorkflowActivity();
        try {
            if (activityId == null || activityId.trim().length() == 0) {
                return null;
            }

            sc = connect();

            Shark shark = Shark.getInstance();
            AdminMisc admin = shark.getAdminMisc();
            WfActivityIterator ai = sc.get_iterator_activity();
            ActivityFilterBuilder aieb = shark.getActivityFilterBuilder();
            WMSessionHandle sessionHandle = sc.getSessionHandle();

            WMFilter filter = new WMFilter();

            if (activityId != null && activityId.trim().length() > 0) {
                filter = aieb.addIdEquals(sessionHandle, activityId);
View Full Code Here

     * @param variableId
     * @return
     */
    public String getProcessVariable(String processInstanceId, String variableId) {

        SharkConnection sc = null;

        try {
            if (processInstanceId == null || processInstanceId.trim().length() == 0) {
                return null;
            }

            sc = connect();

            WfProcess wfProcess = sc.getProcess(processInstanceId);

            if (wfProcess != null) {
                Map varMap = wfProcess.process_context();
                LogUtil.debug(getClass().getName(), "varMap: " + varMap);

View Full Code Here

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

        SharkConnection sc = null;

        try {

            sc = connect();

            WfActivityIterator ai = sc.get_iterator_activity();
            Shark shark = Shark.getInstance();
            ActivityFilterBuilder aieb = shark.getActivityFilterBuilder();
            WMSessionHandle sessionHandle = sc.getSessionHandle();
            WMFilter filter = aieb.addIdEquals(sessionHandle, activityId);
            ai.set_query_expression(aieb.toIteratorExpression(sessionHandle, filter));
            WfActivity[] acts = ai.get_next_n_sequence(0);

            if (acts.length > 0) {
View Full Code Here

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

        SharkConnection sc = null;

        try {

            sc = connect();

            WfProcess wfProcess = sc.getProcess(processId);

            if (wfProcess != null) {
                Map varMap = wfProcess.process_context();
                LogUtil.debug(getClass().getName(), "varMap: " + varMap);
                for (Iterator i = varMap.keySet().iterator(); i.hasNext();) {
View Full Code Here

     * @param processInstanceId
     * @return
     */
    public WorkflowProcess getRunningProcessInfo(String processInstanceId) {

        SharkConnection sc = null;

        try {
            if (processInstanceId == null || processInstanceId.trim().length() == 0) {
                return null;
            }

            sc = connect();

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

            WfProcessIterator pi = sc.get_iterator_process();
            ProcessFilterBuilder pfb = shark.getProcessFilterBuilder();

            XPDLBrowser xpdl = shark.getXPDLBrowser();

            WMFilter filter = new WMFilter();
View Full Code Here

     * Returns activity monitoring info (eg date creation, limit, due (creation + limit), delay and completion) for a process instance ID.
     * @param activityInstanceId
     * @return
     */
    public WorkflowActivity getRunningActivityInfo(String activityInstanceId) {
        SharkConnection sc = null;

        WorkflowActivity wfAct = new WorkflowActivity();

        try {

            if (activityInstanceId == null || activityInstanceId.trim().length() == 0) {
                return null;
            }

            sc = connect();

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

            WfActivityIterator ai = sc.get_iterator_activity();
            ActivityFilterBuilder aieb = shark.getActivityFilterBuilder();

            WMFilter filter = new WMFilter();

            if (activityInstanceId != null && activityInstanceId.trim().length() > 0) {
View Full Code Here

        return wfAct;
    }

    public Map getActivityInstanceByProcessIdAndStatus(String processId, Boolean accepted) {

        SharkConnection sc = null;
        Map processMap = new HashMap();

        try {

            sc = connect();

            WfAssignment[] wItems = sc.getResourceObject().get_sequence_work_item(0);
            if (wItems != null) {
                for (int i = 0; i < wItems.length; ++i) {
                    String tempProcessId = wItems[i].activity().container().manager().name().split("#")[2];
                    if (processId.equals(tempProcessId)) {
                        WfAssignment wfa = wItems[i];
View Full Code Here

     * @param variableId
     * @param variableValue
     */
    public void activityVariable(String activityInstanceId, String variableId, Object variableValue) {

        SharkConnection sc = null;

        try {
            if (activityInstanceId == null || activityInstanceId.trim().length() == 0) {
                return;
            }

            sc = connect();

            Shark shark = Shark.getInstance();
            WfActivityIterator ai = sc.get_iterator_activity();
            ActivityFilterBuilder aieb = shark.getActivityFilterBuilder();
            WMSessionHandle sessionHandle = sc.getSessionHandle();

            WMFilter filter = new WMFilter();

            if (activityInstanceId != null && activityInstanceId.trim().length() > 0) {
                filter = aieb.addIdEquals(sessionHandle, activityInstanceId);
View Full Code Here

     * @param variableId
     * @param variableValue
     */
    public void processVariable(String processInstanceId, String variableId, Object variableValue) {

        SharkConnection sc = null;

        try {
            if (processInstanceId == null || processInstanceId.trim().length() == 0) {
                return;
            }

            sc = connect();

            Shark shark = Shark.getInstance();
            WfProcessIterator pi = sc.get_iterator_process();
            ProcessFilterBuilder pfb = shark.getProcessFilterBuilder();
            WMSessionHandle sessionHandle = sc.getSessionHandle();

            WMFilter filter = new WMFilter();

            if (processInstanceId != null && processInstanceId.trim().length() > 0) {
                filter = pfb.addIdEquals(sessionHandle, processInstanceId);
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.