1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
package com.vci.client.workflow.delegate;
 
import java.util.Date;
import com.vci.client.ClientSession;
import com.vci.client.common.objects.UserEntityObject;
import com.vci.client.framework.delegate.ClientBaseDelegate;
import com.vci.client.framework.delegate.UserEntityClientDelegate;
import com.vci.client.ui.exception.VCIException;
import com.vci.client.workflow.editor.TaskDescCObject;
import com.vci.client.workflow.editor.TaskRevokeCObject;
import com.vci.client.workflow.template.object.NodeHideObject;
import com.vci.client.workflow.template.object.ProcessCategoryObject;
import com.vci.client.workflow.template.object.ProcessDefinitionObject;
import com.vci.client.workflow.template.object.TasksAssignedObject;
import com.vci.common.objects.QueryParam;
import com.vci.common.objects.QueryResult;
import com.vci.corba.common.VCIError;
import com.vci.corba.workflow.data.QueryParamInfo;
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.workflow.data.FlowApproveHistoryInfo;
import com.vci.corba.workflow.data.FlowInstanceInfo;
import com.vci.corba.workflow.data.FlowObjectInfo;
import com.vci.corba.workflow.data.FlowTaskInfo;
import com.vci.corba.workflow.data.MapTransfersInfo;
import com.vci.corba.workflow.data.NodeHideInfo;
import com.vci.corba.workflow.data.PlwfinstancetemplateInfo;
import com.vci.corba.workflow.data.PlwfpersonsetInfo;
import com.vci.corba.workflow.data.ProcessCategoryInfo;
import com.vci.corba.workflow.data.ProcessDefinitionInfo;
import com.vci.corba.workflow.data.ProcessTaskInfo;
import com.vci.corba.workflow.data.SubprocessTemInfo;
import com.vci.corba.workflow.data.TaskDescInfo;
import com.vci.corba.workflow.data.TaskRevokeInfo;
import com.vci.corba.workflow.data.TasksAssignedInfo;
import com.vci.corba.workflow.WorkflowService.GetTasksAssignedByPageingResult;
 
public class ProcessCustomClientDelegate extends ClientBaseDelegate {
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
    public ProcessCustomClientDelegate() {
    }
 
    public ProcessCustomClientDelegate(UserEntityObject userEntityObject) {
        super(userEntityObject);
    }
 
    public ProcessCategoryObject[] getProcessCategories(String parentId) throws VCIException {
        try {
            ProcessCategoryInfo[] infos = ClientSession.getWorkflowService().getProcessCategories(parentId);
            return this.convertProcessCategoryInfosToProcessCategoryObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    //start  by zhangxg  流程模板自定义
    public boolean savePlwfinstancetemplateclient(PlwfinstancetemplateInfo obj,PlwfpersonsetInfo[] obj1) throws VCIError{
        try{
            boolean res = ClientSession.getWorkflowService().savePlwfinstancetemplate(obj,obj1);
            return res;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411116", new String[] {});
        }
    }
    public PlwfinstancetemplateInfo getPlwfinstancetemplateById(String pid) throws VCIError {
        try{
            PlwfinstancetemplateInfo list = ClientSession.getWorkflowService().getPlwfinstancetemplateById(pid);
            return list;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411117", new String[] {});
        }
    }
    public PlwfinstancetemplateInfo[] getPlwfinstancetemplateByClassAndDefault(String plclass, String plisdefault) throws VCIError {
        try{
            PlwfinstancetemplateInfo[] list = ClientSession.getWorkflowService().getPlwfinstancetemplateByClassAndDefault(plclass, plisdefault);
            return list;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411117", new String[] {});
        }
    }
    public PlwfinstancetemplateInfo[] getPlwfinstancetemplate() throws VCIError {
        try{
            PlwfinstancetemplateInfo[] list = ClientSession.getWorkflowService().getPlwfinstancetemplate();
            return list;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411117", new String[] {});
        }
    }
    public boolean deletePlwfinstancetemplate(PlwfinstancetemplateInfo obj) throws VCIError{
        try{
            boolean res = ClientSession.getWorkflowService().deletePlwfinstance(obj);
            return res;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411118", new String[] {});
        }
    }
    public PlwfpersonsetInfo[] getPlwfpersonset(String tid) throws VCIError {
        try{
            PlwfpersonsetInfo[] list = ClientSession.getWorkflowService().getPlwfpersonset(tid);
            return list;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411117", new String[] {});
        }
    }
    public boolean deletePlwfpersonset(PlwfpersonsetInfo obj) throws VCIError{
        try{
            boolean res = ClientSession.getWorkflowService().deletePlwfpersonset(obj);
            return res;
        } catch(Exception e){
            e.printStackTrace();
            throw new VCIError("411118", new String[] {});
        }
    }
    //end
    /**
     * 添加、保存 ProcessCategory 对象
     * 
     * @param info
     *            ProcessCategoryInfo 对象
     */
    public String saveProcessCategory(ProcessCategoryObject object) throws VCIError {
        ProcessCategoryInfo info = this.convertProcessCategoryObjectToProcessCategoryInfo(object);
        return ClientSession.getWorkflowService().saveProcessCategory(info, userEntityInfo);
    }
 
    public boolean updateProcessCategory(ProcessCategoryObject object) throws VCIError {
        ProcessCategoryInfo info = this.convertProcessCategoryObjectToProcessCategoryInfo(object);
        return ClientSession.getWorkflowService().updateProcessCategory(info, userEntityInfo);
    }
 
    public boolean existProcessCategory(String id, String name) throws VCIError {
        return ClientSession.getWorkflowService().existProcessCategory(id, name);
    }
 
    public boolean deleteProcessCategory(String id) throws VCIException {
        try {
            return ClientSession.getWorkflowService().deleteProcessCategory(id, userEntityInfo);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public boolean moveDefinition( String deploymentId , String categoryId) throws VCIException{
        try {
            return ClientSession.getWorkflowService().moveDefinition(deploymentId, categoryId);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public boolean deployProcess(byte[] jbmpImage, String jbmpXml, String graphXml, String processCategoryId, ProcessTaskInfo[] processTaskInfos) throws VCIError {
        return ClientSession.getWorkflowService().deployProcess(jbmpImage, jbmpXml, graphXml, processCategoryId, processTaskInfos, userEntityInfo);
    }
 
    public boolean updateProcess(byte[] jbmpImage, String jbmpXml, String graphXml, String processCategoryId, ProcessTaskInfo[] processTaskInfos,String deployId) throws VCIError {
        return ClientSession.getWorkflowService().updateProcess(jbmpImage, jbmpXml, graphXml, processCategoryId, processTaskInfos, userEntityInfo,deployId);
    }
    
    public boolean deleteProcessDefinition(String deployId, String pdId) throws VCIException {
        try {
            return ClientSession.getWorkflowService().deleteProcessDefinition(deployId, pdId, userEntityInfo);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public boolean startProcessInstanceByKey(String processDefinitionKey, FlowInstanceInfo flowVariablesInfo, String[] objId,String[] userName,String outcome) throws VCIError {
        try{
            return ClientSession.getWorkflowService().startProcessInstanceByKey(processDefinitionKey, flowVariablesInfo, objId, userEntityInfo,userName,outcome);
        }catch (VCIError e) {
            throw e;
        }
    }
    public String startPocessByPLM(String processDefinitionKey, FlowInstanceInfo flowVariablesInfo, String[] objId,String[] userName,String outcome,String[] tasknames, String[][] taskUserNames,MapTransfersInfo[] mapTransfersInfos) throws VCIError {
        try{
            return ClientSession.getWorkflowService().startPocessByPLM(processDefinitionKey, flowVariablesInfo, objId, userEntityInfo, userName, outcome, tasknames, taskUserNames, mapTransfersInfos);
        }catch (VCIError e) {
            throw e;
        }
    }
    public String startPocessByPLM_v1(String processDefinitionKey, FlowInstanceInfo flowVariablesInfo, String[] objId,String[] userName,String outcome,String[] tasknames, String[][] taskUserNames,MapTransfersInfo[] mapTransfersInfos, String[] objectProperty, String[][] objectPropertyValues) throws VCIError {
        try{
            return ClientSession.getWorkflowService().startPocessByPLMv1(processDefinitionKey, flowVariablesInfo, objId, userEntityInfo, userName, outcome, tasknames, taskUserNames, mapTransfersInfos,objectProperty, objectPropertyValues);
        }catch (VCIError e) {
            throw e;
        }
    }
    
    public String startProcessAndExecuteFirstNode(String processDefinitionKey,
            FlowInstanceInfo flowVariablesInfo, String[] objId, UserEntityObject userEntity,
            String[] userName, String outcome, String[] tasknames,
            String[][] taskUserNames, MapTransfersInfo[] mapTransfersInfos,
            String[] objectProperty, String[][] objectPropertyValues)
            throws VCIError {
        UserEntityInfo loginUserEntityInfo = UserEntityClientDelegate.changeUserEntityToInfo(userEntity);
        try {
            return ClientSession.getWorkflowService()
                    .startProcessAndExecuteFirstNode(processDefinitionKey,
                            flowVariablesInfo, objId, loginUserEntityInfo, userName,
                            outcome, tasknames, taskUserNames,
                            mapTransfersInfos, objectProperty,
                            objectPropertyValues);
        } catch (VCIError e) {
            throw e;
        }
    }
 
    public void setTaskAndUserForComplete(String executionId,String[] tasknames,String[][] taskUserNames) throws VCIError{
        ClientSession.getWorkflowService().setTaskAndUserForComplete(executionId, tasknames, taskUserNames, userEntityInfo);
    }
    public boolean completeTask(String taskId,String[] userName) throws VCIError {
        return completeTask(taskId, "", "","",userName);
    }
 
//    public void completeTask(String taskId,String outcome,String nextTaskName,String approvalNote,String[] userName) throws VCIError {
//        completeTask(taskId, outcome,nextTaskName, approvalNote,userName);
//    }
    
    public boolean completeTask(String taskId, String outcome, String nextTaskName,String approvalNote,String[] userName) throws VCIError {
        try{
            return ClientSession.getWorkflowService().completeTask(taskId, outcome, nextTaskName,approvalNote, userEntityInfo,userName);
        }catch (VCIError e) {
            throw e;
        }
    }
    public boolean completeTaskByPlatform(String taskId, String outcome, String nextTaskName,String approvalNote,String[] userName) throws VCIError {
        try{
            return ClientSession.getWorkflowService().completeTaskByPlatform(taskId, outcome, nextTaskName,approvalNote, userEntityInfo,userName);
        }catch (VCIError e) {
            throw e;
        }
    }
 
    public boolean completeTaskByPlatform_v1(String taskId, String outcome,
            String nextTaskName, String approvalNote, UserEntityObject userEntity, String[] userName,
            String[] objectProperty, String[][] objectPropertyValues)
            throws VCIError {
        UserEntityInfo loginUserEntityInfo = UserEntityClientDelegate.changeUserEntityToInfo(userEntity);
        try {
            return ClientSession.getWorkflowService()
                    .completeTaskByPlatformv1(taskId, outcome, nextTaskName,
                            approvalNote, loginUserEntityInfo, userName,
                            objectProperty, objectPropertyValues);
        } catch (VCIError e) {
            throw e;
        }
    }
 
    public boolean completeTasksByPlatform_v1(String[] taskIds, String outcome,
            String nextTaskName, String approvalNote, UserEntityObject userEntity, String[] userName,
            String[] objectProperty, String[][] objectPropertyValues)
            throws VCIError {
        UserEntityInfo loginUserEntityInfo = UserEntityClientDelegate.changeUserEntityToInfo(userEntity);
        try {
            return ClientSession.getWorkflowService()
                    .completeTasksByPlatformv1(taskIds, outcome, nextTaskName,
                            approvalNote, loginUserEntityInfo, userName,
                            objectProperty, objectPropertyValues);
        } catch (VCIError e) {
            throw e;
        }
    }
    
    public FlowTaskInfo[] getTodoTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String sql) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getTodoTaskByUserId(pluseroid,first,pageSize, taskType,sql,userEntityInfo);
        return flowTaskInfo;
    }
    
    public int queryTodoTaskCount(String pluser, String expandSql) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryTodoTaskCount(pluser,expandSql,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public FlowTaskInfo[] getCCTaskByUserId(String pluseroid,int first,int pageSize) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getCCTaskByUserId(pluseroid,first,pageSize, userEntityInfo);
        return flowTaskInfo;
    }
    
    public int queryCCTaskCount(String pluser) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryCCTaskCount(pluser,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public FlowTaskInfo[] getTrackTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getTrackTaskByUserId(pluseroid,first,pageSize,taskType,querySQL, userEntityInfo);
        return flowTaskInfo;
    }
    
    public int queryTraceTaskCount(String pluser, String expandSql) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryTraceTaskCount(pluser,expandSql,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public ProcessDefinitionObject[] getProcessDefinitions(String processCategoryId) throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinitions(processCategoryId);
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 获取全部流程定义
     * @return
     * @throws VCIException
     */
    public ProcessDefinitionObject[] getProcessDefinitionAll() throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinitionAll();
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public byte[] getProcessChart(String deploymentId) throws VCIException {
        try {
            byte[] result = ClientSession.getWorkflowService().getProcessResource(deploymentId, ".png");
            return result;
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public byte[] getProcessXml(String deploymentId) throws VCIException {
        try {
            byte[] result = ClientSession.getWorkflowService().getProcessResource(deploymentId, ".xml");
            return result;
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public byte[] getProcessGraphXml(String deploymentId) throws VCIException {
        try {
            byte[] result = ClientSession.getWorkflowService().getProcessResource(deploymentId, ".graph");
            return result;
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public ProcessDefinitionObject[] getProcessDefinition(String rmTemplateId, String processType) throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinition(rmTemplateId, processType);
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public ProcessDefinitionObject[] getProcessDefinitionByType(String processType) throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinitionByType(processType);
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public void saveRMTemplateProcess(String rmTemplateId, String[] processTypes, String[] jbpmDeploymentIds) throws VCIException {
 
        try {
            ClientSession.getWorkflowService().saveRMTemplateProcess(rmTemplateId, processTypes, jbpmDeploymentIds, userEntityInfo);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    public boolean deleteRMTemplateProcess(String rmTemplateId) throws VCIException {
        try {
            return ClientSession.getWorkflowService().deleteRMTemplateProcess(rmTemplateId, userEntityInfo);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
 
    /**
     * 获取下个任务的处理人
     * @param jbpmDeploymentId
     * @param taskName
     * @param outcome
     * @return
     * @throws VCIError
     */
    public String[] getNextCandidates(String jbpmDeploymentId, String taskName,
            String outcome) throws VCIException {
        String[] infos = new String[0];
        try {
            infos = ClientSession.getWorkflowService().getNextCandidates(jbpmDeploymentId, taskName, outcome);
        } catch (Exception ex) {
//            throw new VCIError(410122, new String[] {});
            throw convertVCIErrorToVCIException(new VCIError("410122", new String[] {}));
        }
        return infos;
    }
    public String[] getNextTaskNames(String jbpmDeploymentId, String taskName,
            String outcome) throws VCIException {
        String[] infos = new String[0];
        try {
            infos = ClientSession.getWorkflowService().getNextTaskNames(jbpmDeploymentId, taskName, outcome);
        } catch (Exception ex) {
            //throw new VCIError(410123, new String[] {});
            throw convertVCIErrorToVCIException(new VCIError("410123", new String[] {}));
        }
        return infos;
    }
    public String[] getCurCandidates(String jbpmDeploymentId, String taskName,
            String outcome, String excutionId) throws VCIException {
        String[] infos = new String[0];
        try {
            infos = ClientSession.getWorkflowService().getCurCandidates(jbpmDeploymentId, taskName, outcome, excutionId);
        } catch (Exception ex) {
            throw convertVCIErrorToVCIException(new VCIError("410124", new String[] {}));
        }
        return infos;
    }
    public String[] getAllCandidatesForTask(String jbpmDeploymentId, String taskName,
            String outcome) throws VCIException {
        String[] infos = new String[0];
        try {
            infos = ClientSession.getWorkflowService().getAllCandidatesForTask(jbpmDeploymentId, taskName, outcome);
        } catch (Exception ex) {
            throw convertVCIErrorToVCIException(new VCIError("410124", new String[] {}));
        }
        return infos;
    }
    public String[] getTrainName(String jbpmDeploymentId, String taskName,
            String outcome) throws VCIException {
        String[] infos = new String[0];
        try {
            infos = ClientSession.getWorkflowService().getTrainName(jbpmDeploymentId, taskName, outcome);
        } catch (Exception ex) {
            throw convertVCIErrorToVCIException(new VCIError("410125", new String[] {}));
        }
        return infos;
    }
    
    public String[] getDeployId(String taskId) throws VCIError {
        return ClientSession.getWorkflowService().getDeployId(taskId);
    }
    
    public TaskDescCObject[] getTaskDescList(String deploymentId, String taskName){
        TaskDescCObject[] o = {};
        try {
            o = convertinfoToObjects(ClientSession.getWorkflowService().getTaskDescList(deploymentId, taskName));
        } catch (VCIError e) {
            e.printStackTrace();
        }
        return o;
    }
    TaskDescCObject[] convertinfoToObjects(TaskDescInfo[] infos){
        TaskDescCObject[] o = new TaskDescCObject[infos.length];
        int i = 0;
        for (TaskDescInfo info : infos) {
            o[i++] = this.convertinfoToObject(info);
        }
        return o;
    }
    TaskDescCObject convertinfoToObject(TaskDescInfo info){
        TaskDescCObject o = new TaskDescCObject();
        o.setId(info.id);
        o.setPljbpmdeploymentid(info.pljbpmdeploymentid);
        o.setPltask(info.pltask);
        o.setPltaskdesc(info.pltaskdesc);
        o.setPltreatment(info.pltreatment);
        o.setPopUserDialog(info.popUserDialog);
        o.setPlcustomclassname(info.customclassname);
        o.setPlcustomparam(info.customparam);
        return o;
    }
    /**
     * 对象转换,从 Client 对象转换到 Corba 对象
     * 
     * @param infos
     * @return
     */
    public ProcessCategoryInfo convertProcessCategoryObjectToProcessCategoryInfo(ProcessCategoryObject object) {
        ProcessCategoryInfo info = new ProcessCategoryInfo();
        info.id = object.getId() == null ? "" : object.getId();
        info.parentId = object.getParentId() == null ? "" : object.getParentId();
        info.name = object.getName() == null ? "" : object.getName();
        info.desc = object.getDesc() == null ? "" : object.getDesc();
        info.icon = object.getIcon() == null ? "" : object.getIcon();
        info.createTime = object.getCreateTime().getTime();
        info.createUser = object.getCreateUser() == null ? "" : object.getCreateUser();
        info.createRole = object.getCreateRole() == null ? "" : object.getCreateRole();
        info.createOrg = object.getCreateOrg() == null ? "" : object.getCreateOrg();
        info.modifyTime = object.getModifyTime().getTime();
        info.modifyUser = object.getModifyUser() == null ? "" : object.getModifyUser();
        info.modifyRole = object.getModifyRole() == null ? "" : object.getModifyRole();
        info.modifyOrg = object.getModifyOrg() == null ? "" : object.getModifyOrg();
        return info;
    }
 
    /**
     * 对象转换(批量),从 Corba 对象转换到 Client 对象
     * 
     * @param infos
     * @return
     */
    public ProcessCategoryObject[] convertProcessCategoryInfosToProcessCategoryObjects(ProcessCategoryInfo[] infos) {
        ProcessCategoryObject[] objects = new ProcessCategoryObject[infos.length];
        int i = 0;
        for (ProcessCategoryInfo info : infos) {
            objects[i++] = this.convertProcessCategoryInfoToProcessCategoryObject(info);
        }
        return objects;
    }
 
    /**
     * 对象转换,从 Corba 对象转换到 Client 对象
     * 
     * @param infos
     * @return
     */
    public ProcessCategoryObject convertProcessCategoryInfoToProcessCategoryObject(ProcessCategoryInfo info) {
        ProcessCategoryObject object = new ProcessCategoryObject();
        object.setId(info.id);
        object.setParentId(info.parentId);
        object.setName(info.name);
        object.setDesc(info.desc);
        object.setIcon(info.icon);
        object.setCreateTime(new Date(info.createTime));
        object.setCreateUser(info.createUser);
        object.setCreateRole(info.createRole);
        object.setCreateOrg(info.createOrg);
        object.setModifyTime(new Date(info.modifyTime));
        object.setModifyUser(info.modifyUser);
        object.setModifyRole(info.modifyRole);
        object.setModifyOrg(info.modifyOrg);
        return object;
    }
 
    private ProcessDefinitionObject[] convertProcessDefinitionInfosToProcessDefinitionObjects(ProcessDefinitionInfo[] infos) {
        ProcessDefinitionObject[] objects = new ProcessDefinitionObject[infos.length];
        int i = 0;
        for (ProcessDefinitionInfo info : infos) {
            objects[i++] = this.convertProcessDefinitionInfoToProcessDefinitionObject(info);
        }
        return objects;
    }
 
    private ProcessDefinitionObject convertProcessDefinitionInfoToProcessDefinitionObject(ProcessDefinitionInfo info) {
        ProcessDefinitionObject object = new ProcessDefinitionObject();
        object.setId(info.id);
        object.setName(info.name);
        object.setKey(info.key);
        object.setVersion(info.version);
        object.setJbpmDeploymentId(info.jbpmDeploymentId);
        object.setStatus(info.status);
        return object;
    }
 
    public ProcessTaskInfo findById(String jbpmDeploymentId, String name) throws VCIError {
        return ClientSession.getWorkflowService().findTaskPropertyById(jbpmDeploymentId, name);
    }
 
    public FlowApproveHistoryInfo[] getHistoryActivityByProInsId(String processInstanceId) throws VCIError {
        return ClientSession.getWorkflowService().getHistoryActivityByProInsId(processInstanceId);
    }
    public FlowApproveHistoryInfo[] getHistoryActivityByProInsIdbyPLM(String processInstanceId) throws VCIError {
        return ClientSession.getWorkflowService().getHistoryActivityByProInsIdbyPLM(processInstanceId);
    }
 
    public byte[] getExecutionImageByExecutionId(String executionId, String taskName) throws VCIError {
        return ClientSession.getWorkflowService().getExecutionImageByExecutionId(executionId, taskName);
    }
 
    public FlowObjectInfo[] getFlowObjectByExecutionId(String executionId) throws VCIError {
        return ClientSession.getWorkflowService().getFlowObjectByExecutionId(executionId);
    }
 
    public String getDeploymentIdByExecutionId(String executionId) throws VCIError {
        return ClientSession.getWorkflowService().getDeploymentIdByExecutionId(executionId);
    }
    public String getDeploymentID(String processDefinitionKey) throws VCIError {
        return ClientSession.getWorkflowService().getDeploymentID(processDefinitionKey);
    }
 
    public FlowInstanceInfo getFlowInstanceInfo(String executionId) throws VCIException {
        try {
            FlowInstanceInfo info = ClientSession.getWorkflowService().getFlowInstanceInfo(executionId);
            return info;
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public String getNextSubTaskAssigner(String executionId, 
            String taskName, String outcome) {
        try {
            return ClientSession.getWorkflowService().getNextSubTaskAssigner(executionId, taskName, outcome);
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return "";
    }
    
    public String getDepolymentID(String executionId) throws VCIError {
        return ClientSession.getWorkflowService().getDepolymentID(executionId);
    }
    public byte[] getFlowImageByDeployID(String deployID) throws VCIError {
        return ClientSession.getWorkflowService().getFlowImageByDeployID(deployID);
    }
    public FlowTaskInfo[] getDoneTaskByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getDoneTaskByUserId(pluseroid, first, pageSize,taskType,querySQL, userEntityInfo);
        return flowTaskInfo;
    }
    public int queryDoneTaskCount(String pluser, String expandSql) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryDoneTaskCount(pluser,expandSql,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    /**
     * 通过任务节点取得阶段名称
     * @param processDefinitionKey
     * @param jbpmdeploymentid
     * @return
     * @throws VCIException
     * @throws VCIError
     */
    public String getTaskPhaseName(String processDefinitionKey,
            String jbpmdeploymentid,FlowInstanceInfo var) throws VCIError{
        try {
            return ClientSession.getWorkflowService().getTaskPhaseName(processDefinitionKey, jbpmdeploymentid,var,userEntityInfo);
        } catch (VCIError e) {
            throw e;
        }
    }
    
    public boolean checkKey(String name, String keyValue) throws VCIError {
        return ClientSession.getWorkflowService().checkKey(name, keyValue);
    }
    
    /**
     * 判断下一任务节点是否是end
     * @param jbpmDeploymentId
     * @param taskName
     * @return
     * @throws VCIException
     */
    public boolean getProcessTaskByTaskName(String taskId,String taskName,String outcome) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getProcessTaskByTaskName(taskId, taskName, outcome);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public String[] getAllTaskNames(String jbpmDeploymentId) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getAllTaskNames(jbpmDeploymentId);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 获取当前任务路由
     * @param taskID
     * @return
     * @throws VCIError
     */
    public String[] getAllOutComes(String taskID) throws VCIException {
        try {
            return ClientSession.getWorkflowService().getAllOutComes(taskID);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    public String getUrlPath(String jbpmDeploymentId, String taskName) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getUrlPath(jbpmDeploymentId, taskName);
        }catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    public String[] getTrainsitionUrlPath(String jbpmDeploymentId, String taskName,String trainsitionName) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getTrainsitionUrlPath(jbpmDeploymentId, taskName, trainsitionName);
        }catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    /**
     * 任务转交
     * @param fromUser
     * @param userName
     * @return
     */
    public boolean assignTask(String fromUser, String userName){
        boolean flag = false;
        try {
            flag = ClientSession.getWorkflowService().assignTask(fromUser, userName);
        } catch (VCIError e) {
            e.printStackTrace();
            flag = false;
        }
        return flag;
    }
    public boolean assignTaskByPlatform(String executionId, String userName){
        boolean flag = false;
        try {
            flag = ClientSession.getWorkflowService().assignTaskByPlatform(executionId, userName);
        } catch (VCIError e) {
            e.printStackTrace();
            flag = false;
        }
        return flag;
    }
    /**
     * 任务转发
     * @param taskId
     * @param userName
     * @return
     */
    public boolean transmitTask(String taskId, String userName){
        boolean flag = false;
        try {
            flag = ClientSession.getWorkflowService().transmitTask(taskId, userName,userEntityInfo);
        } catch (VCIError e) {
            e.printStackTrace();
            flag = false;
        }
        return flag;
    }
    
    public boolean transmitTaskByPlatform(String[] taskIds, String userName){
        boolean flag = false;
        try {
            flag = ClientSession.getWorkflowService().transmitTaskByPlatform(taskIds, userName,userEntityInfo);
        } catch (VCIError e) {
            e.printStackTrace();
            flag = false;
        }
        return flag;
    }
    
    public boolean saveOrUpdateTasksAssigned(TasksAssignedObject tasksAssigned) throws VCIError {
        TasksAssignedInfo info = new TasksAssignedInfo();
        info.id = tasksAssigned.getId() == null ? "" : tasksAssigned.getId();
        info.userName = tasksAssigned.getUserName() == null ? "" : tasksAssigned.getUserName();
//        info.TasksId = tasksAssigned.getTasksId() == null ? "" : tasksAssigned.getTasksId();
        info.TasksName = tasksAssigned.getTasksName() == null ? "" : tasksAssigned.getTasksName();
//        info.TasksTrueName = tasksAssigned.getTasksTrueName() == null ? "" : tasksAssigned.getTasksTrueName();
        info.isTrue = tasksAssigned.getIsTrue();
        info.startTime = tasksAssigned.getStartTime() == null ? 0 : tasksAssigned.getStartTime().getTime();
        info.endTime = tasksAssigned.getEndTime() == null ? 0 : tasksAssigned.getEndTime().getTime();
        info.fromUser=tasksAssigned.getFromUser()==null?"":tasksAssigned.getFromUser();
        return ClientSession.getWorkflowService().saveOrUpdateTasksAssigned(info, userEntityInfo);
    }
    public TasksAssignedObject getTasksAssignedByUserName(String userName)throws VCIError {
        TasksAssignedInfo tasksAssignedInfo;
        tasksAssignedInfo = ClientSession.getWorkflowService().getTasksAssignedByUserName(userName, userEntityInfo);
        TasksAssignedObject obj = new TasksAssignedObject();
        obj.setId(tasksAssignedInfo.id);
        obj.setIsTrue(tasksAssignedInfo.isTrue);
//        obj.setTasksId(tasksAssignedInfo.TasksId);
        obj.setTasksName(tasksAssignedInfo.TasksName);
//        obj.setTasksTrueName(tasksAssignedInfo.TasksTrueName);
        obj.setUserName(tasksAssignedInfo.userName);
        obj.setStartTime(new Date(tasksAssignedInfo.startTime));
        obj.setEndTime(new Date(tasksAssignedInfo.endTime));
        obj.setFromUser(tasksAssignedInfo.fromUser==null?"":tasksAssignedInfo.fromUser);
        return obj;
    }
    public void saveSubProcess(SubprocessTemInfo[] subprocessTemInfos) throws VCIError{
        ClientSession.getWorkflowService().saveSubProcess(subprocessTemInfos);
    }
    public int checkSubprocessQuote(String subProcess) throws VCIError{
        return (int)ClientSession.getWorkflowService().checkSubprocessQuote(subProcess);
    }
    /**
     * 获得撤销策略信息
     * @param deploymentId
     * @param taskName
     * @return
     */
    public TaskRevokeCObject[] getTaskRevokeList(String deploymentId, String taskName){
        TaskRevokeCObject[] o = {};
        try {
            o = convertRevokeinfoToObjects(ClientSession.getWorkflowService().getTaskRevokeList(deploymentId, taskName));
        } catch (VCIError e) {
            e.printStackTrace();
        }
        return o;
    }
    TaskRevokeCObject[] convertRevokeinfoToObjects(TaskRevokeInfo[] infos){
        TaskRevokeCObject[] o = new TaskRevokeCObject[infos.length];
        int i = 0;
        for (TaskRevokeInfo info : infos) {
            o[i++] = this.convertRevokeinfoToObject(info);
        }
        return o;
    }
    TaskRevokeCObject convertRevokeinfoToObject(TaskRevokeInfo info){
        TaskRevokeCObject o = new TaskRevokeCObject();
        o.setId(info.id);
        o.setPljbpmdeploymentid(info.deploymentId);
        o.setPltask(info.taskName);
        o.setPlclassname(info.className);
        o.setPlrevoke(info.revokeflag);
        return o;
    }
    
    public boolean deleteTasksAssignedByUserName(String[] userName) throws VCIError {
        return ClientSession.getWorkflowService().deleteTasksAssignedByUserName(userName, userEntityInfo);
    }
    public ProcessTaskInfo findTaskPropertyByProcessId(String jbpmDeploymentId) throws VCIError {
        return ClientSession.getWorkflowService().findTaskPropertyByProcessId(jbpmDeploymentId);
    }
    /**
     * 流程监控
     * @param pluseroid
     * @param first
     * @param pageSize
     * @param taskType
     * @param querySQL
     * @return
     * @throws VCIError
     */
    public FlowTaskInfo[] getProcessControlByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getProcessControlByUserId(pluseroid, first, pageSize,taskType,querySQL, userEntityInfo);
        return flowTaskInfo;
    }
    public int queryProcessControlCount(String pluser,String taskType) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryProcessControlCount(pluser,taskType,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 任务撤销
     * @param curTaskName
     * @param destActivityName
     * @param executionId
     * @return
     */
    public boolean revokeTask(String curTaskName, String destActivityName, String executionId){
        try {
            return ClientSession.getWorkflowService().revokeTask(curTaskName, destActivityName, executionId);
        } catch (VCIError e) {
            e.printStackTrace();
            return false;
        }
    }
    /**
     * 已完成流程
     * @param pluseroid
     * @param first
     * @param pageSize
     * @param taskType
     * @param querySQL
     * @return
     * @throws VCIError
     */
    public FlowTaskInfo[] getDoneProcessByUserId(String pluseroid,int first,int pageSize,String taskType,String querySQL) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getDoneProcessByUserId(pluseroid, first, pageSize,taskType,querySQL, userEntityInfo);
        return flowTaskInfo;
    }
    /**
     * 已完成流程条数
     * @param pluser
     * @param taskType
     * @return
     * @throws VCIException
     */
    public int queryDoneProcessCount(String pluser,String taskType) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryDoneProcessCount(pluser,taskType,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 任务指派
     * @param destActivityName
     * @param tagActivityName
     * @param classNames
     * @param executionId
     * @param userNames
     * @return
     */
    public boolean appointTask(String destActivityName,String tagActivityName,String[] classNames,String executionId, String[] userNames){
        try {
            return ClientSession.getWorkflowService().appointTask(destActivityName, tagActivityName, classNames, executionId, userNames);
        } catch (VCIError e) {
            e.printStackTrace();
            return false;
        }
    }
    /**
     * 任务指派
     * @param destActivityName
     * @param tagActivityName
     * @param classNames
     * @param executionId
     * @param userNames
     * @return
     */
    public boolean appointTask2(String destActivityName,String tagActivityName,String[] classNames,String executionId, String[] userNames){
        try {
            return ClientSession.getWorkflowService().appointTask2(destActivityName, tagActivityName, classNames, executionId, userNames, userEntityInfo);
        } catch (VCIError e) {
            e.printStackTrace();
            return false;
        }
    }
    /**
     * 查询流程模板的第一个任务对象
     * <p>Description: </p>
     * 
     * @author xchao
     * @time 2012-6-6
     * @param jbpmDeploymentId 流程模板部署的ID
     * @return
     * @throws VCIError
     */
    public ProcessTaskInfo getFirstProcessTask(String jbpmDeploymentId) throws VCIException{
        try{
            return ClientSession.getWorkflowService().getFirstProcessTask(jbpmDeploymentId);
        } catch(VCIError e){
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public ProcessTaskInfo getFirstProcessTaskByExecId(String execId) throws VCIException{
        try{
            return ClientSession.getWorkflowService().getFirstProcessTaskByExecId(execId);
        } catch(VCIError e){
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    /**
     * 
     * <p>查询当前节点同意的所有的下一任务节点数据:
     * 返回格式:transitionName,TaskName;transitionName,TaskName;的字符串值
     *  </p>
     * 
     * @time 2013-3-31
     * @param taskId 任务ID
     * @param taskName 任务名称
     * @param outcome 同意或者不同意;
     * @return
     */
    public String getAllNoAgreeProcessTaskByTaskName(String taskId,String taskName,String outcome)throws VCIException{
        try {
            return ClientSession.getWorkflowService().getAllNoAgreeProcessTaskByTaskName(taskId, taskName, outcome);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        
    }
    public String getNextTaskNameByJbpmId(String jbpmDeploymentId, String taskName, String outcome) throws VCIException{
        String res = "";
        try{
            res = ClientSession.getWorkflowService().getNextTaskNameByJbpmId(jbpmDeploymentId, taskName, outcome);
        }catch(VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return res;
    }
    
    public String getNextTaskTypeByJbpmId(String jbpmDeploymentId, String taskName, String outcome) throws VCIException{
        String res = "";
        try{
            res = ClientSession.getWorkflowService().getNextTaskTypeByJbpmId(jbpmDeploymentId, taskName, outcome);
        }catch(VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return res;
    }
    public String getProcessStartUser(String execId) throws VCIException{
        String res = "";
        try{
            res = ClientSession.getWorkflowService().getProcessStartUser(execId);
        }catch(VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return res;
    }
    
    /**
     * 通过执行标示查询任务ID
     * <p>Description: </p>
     * 
     * @time 2013-4-27
     * @param execId
     * @return
     * @throws VCIError
     */
    public String getProcessTaskId(String execId) throws VCIException{
        String res = "";
        try{
            res = ClientSession.getWorkflowService().getProcessTaskId(execId);
        }catch(VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return res;
    }
    public boolean deleteHideFlow(String deployId) throws VCIException{
        try {
            return ClientSession.getWorkflowService().deleteHideFlow(deployId);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
    }
    
    public boolean setNodeHide(String deploymentId) throws VCIError {
        return ClientSession.getWorkflowService().setNodeHide(changeNodeHideToNodeHideInfo(deploymentId));
    }
    public String changeNodeHideToNodeHideInfo(String deploymentId){
        NodeHideInfo nodehideinfo = new NodeHideInfo();
        
        nodehideinfo.deploymentId = deploymentId;
        return nodehideinfo.deploymentId;
    }
    public NodeHideObject[] getNodeHideDeploymentId()throws VCIError{
        NodeHideInfo[] info = null;
        NodeHideObject[] obj = null;
        try {
            info = ClientSession.getWorkflowService().getNodeHideDeploymentId();
            obj = new NodeHideObject[info.length];
            for(int i=0;i<info.length;i++){
                obj[i] = NodeHideInfoToNodeHide(info[i]);
            }
            
        } catch (VCIError e) {
            e.printStackTrace();
        }
        return obj;
    }
    public NodeHideObject NodeHideInfoToNodeHide(NodeHideInfo nodehideinfo){
        NodeHideObject obj = new NodeHideObject();
        obj.setDeploymentId(nodehideinfo.deploymentId);
        obj.setHide(nodehideinfo.hide);
        obj.setId(nodehideinfo.id);
        return  obj;
    }
    
    /**根据条件查询流程历史数据**/
    public FlowTaskInfo[] getTaskByCondition(String[] values,int first,int pageSize,String objectId) throws VCIError {
        FlowTaskInfo[] flowTaskInfo = ClientSession.getWorkflowService().getTaskByCondition(values,first,pageSize, objectId,userEntityInfo);
        return flowTaskInfo;
    }
    
    /**根据条件查询数据流程总数***/
    public int queryFlowTaskCount(String[] values,String objectId,boolean flag) throws VCIException {
        try{
            return (int)ClientSession.getWorkflowService().queryFlowTaskCount(values,objectId,flag,userEntityInfo);
        }catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 返回任节点上定义的候选人字符串内容
     * <p>Description: </p>
     * 
     * @author xchao
     * @time 2012-11-10
     * @param jbpmDeploymentId
     * @param taskName
     * @param outcome
     * @return
     * @throws Exception
     */
    public String getNextCandidatesDefineString(String jbpmDeploymentId, String taskName,
            String outcome) throws VCIException {
        try {
            return ClientSession.getWorkflowService().getNextCandidatesDefineString(jbpmDeploymentId, taskName, outcome);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 返回流程执行时的参数值
     * <p>Description: </p>
     * @author xchao
     * @time 2013-5-24
     * @param executionId 流程执行ID
     * @param varName 变量名称
     * @return
     * @throws VCIException
     */
    public String getProcessVariable(String executionId, String varName) throws VCIException{
        String result = "";
        try {
            result = ClientSession.getWorkflowService().getProcessVariable(executionId, varName,userEntityInfo);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return result;
    }
    public ProcessDefinitionObject[] getProcessDefinitionsByPage(String processCategoryId,String name,int pageSize,int pageIndex) throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinitionsByPage(processCategoryId, name,pageSize, pageIndex);
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    public boolean setProcessHide(String jbpmdeplotmentId, short status) throws VCIError {
        return ClientSession.getWorkflowService().setPocessHide(jbpmdeplotmentId, status, userEntityInfo);
    }
    /**
     * 模板分类定义分页
     * @param parentId
     * @param pageSize
     * @param pageIndex
     * @return
     * @throws VCIException
     */
    public ProcessCategoryObject[] getProcessCategoriesByPage(String parentId,int pageSize,int pageIndex) throws VCIException {
        try {
            ProcessCategoryInfo[] infos = ClientSession.getWorkflowService().getProcessCategoriesByPage(parentId, pageSize, pageIndex);
            return this.convertProcessCategoryInfosToProcessCategoryObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    public ProcessDefinitionObject[] getProcessDefinitionByProcessDefinitionName(String processCategoryName,String processCategoryId) throws VCIException {
        try {
            ProcessDefinitionInfo[] infos = ClientSession.getWorkflowService().getProcessDefinitionByProcessDefinitionName(processCategoryName,processCategoryId);
            return this.convertProcessDefinitionInfosToProcessDefinitionObjects(infos);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    public String[] getTasksNameByProcessName(String[] processNames) throws VCIError{
        return ClientSession.getWorkflowService().getTasksNameByProcessName(processNames, userEntityInfo);
    }
    /**
     * 根据部署ID返回流程模板对象
     * <p>Description: </p>
     * 
     * @author xchao
     * @time 2012-9-25
     * @param deployId
     * @return
     * @throws VCIException
     */
    public ProcessDefinitionObject getProcessDefinitionByDeployId(String deployId) throws VCIException {
        try {
            ProcessDefinitionInfo info = ClientSession.getWorkflowService().getProcessDefinitionByDeployId(deployId);
            return this.convertProcessDefinitionInfoToProcessDefinitionObject(info);
        } catch (VCIError e) {
            throw convertVCIErrorToVCIException(e);
        }
    }
    /**
     * 
     * <p>Description:查看已办任务详细信息 </p>
     * 
     * @time 2013-4-11
     * @param params
     * @return
     * @throws VCIException
     */
    public String searchComplateTask(String[] params)throws VCIException{
        String result = "";
        try {
            result = ClientSession.getWorkflowService().searchComplateTask(params,userEntityInfo);
        } catch (VCIError e) {
            e.printStackTrace();
            throw convertVCIErrorToVCIException(e);
        }
        return result;
        
    }
    public QueryResult<TasksAssignedObject> getTasksAssignedByPageing(QueryParam queryParam) throws VCIException{
        try{
            QueryResult<TasksAssignedObject> res = new QueryResult<TasksAssignedObject>();
 
            QueryParamInfo queryParamInfo = convertQueryParam(queryParam);
            GetTasksAssignedByPageingResult result =  ClientSession.getWorkflowService().getTasksAssignedByPageing(queryParamInfo, userEntityInfo);
            TasksAssignedInfo[] infos = result.returnValue;
            res.setTotal((int)result.total);
 
            res.setDatas(this.coventInfoListToObjectList(infos));
            return res;
        }catch(VCIError e){
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
    }
    private TasksAssignedObject[] coventInfoListToObjectList(TasksAssignedInfo[] tasksAssignedInfo){
        TasksAssignedObject[] objs = new TasksAssignedObject[tasksAssignedInfo.length];
        for(int i = 0;i<tasksAssignedInfo.length;i++){
            objs[i] = this.coventInfoToObject(tasksAssignedInfo[i]);
        }
        return objs;
    }
    private TasksAssignedObject coventInfoToObject(TasksAssignedInfo tasksAssignedInfo){
        TasksAssignedObject obj = new TasksAssignedObject();
        obj.setId(tasksAssignedInfo.id);
        obj.setIsTrue(tasksAssignedInfo.isTrue);
//        obj.setTasksId(tasksAssignedInfo.TasksId);
        obj.setTasksName(tasksAssignedInfo.TasksName);
//        obj.setTasksTrueName(tasksAssignedInfo.TasksTrueName);
        obj.setUserName(tasksAssignedInfo.userName);
        obj.setStartTime(new Date(tasksAssignedInfo.startTime));
        obj.setEndTime(new Date(tasksAssignedInfo.endTime));
        obj.setFromUser(tasksAssignedInfo.fromUser==null?"":tasksAssignedInfo.fromUser);
        return obj;
    }
    
    protected QueryParamInfo convertQueryParam(QueryParam obj){
        QueryParamInfo info = new QueryParamInfo();
        info.customQueryString = obj.getCustomQueryString();
        info.pageIndex = obj.getPageIndex();
        info.pageSize = obj.getPageSize();
        return info;
    }
 
    
    /**
     * 获取任务id
     * @param currActivityName 任务名称
     * @param executionId 执行id
     * @return
     * @throws VCIException
     */
    public String getTaskId(String currActivityName, String executionId) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getTaskId(currActivityName, executionId);
        } catch (VCIError e) {
            e.printStackTrace();
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
    }
 
    public FlowTaskInfo[] getFlowTaskInfoByDataId(String boOid, String boType) throws VCIException {
        try {
            return ClientSession.getWorkflowService().getFlowTaskInfoByDataId(boOid, boType);
        } catch (VCIError e) {
            e.printStackTrace();
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
    }
    public String[] getFlowTaskInfoByDataIds(String[] boOids, String boType) throws VCIException {
        try {
            return ClientSession.getWorkflowService().getFlowTaskInfoByDataIds(boOids, boType);
        } catch (VCIError e) {
            e.printStackTrace();
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
    }
    
    public FlowTaskInfo getFlowTaskInfo (String executionid, String taskid) throws VCIException{
        try {
            return ClientSession.getWorkflowService().getFlowTaskInfo(executionid, taskid);
        } catch (VCIError e) {
            e.printStackTrace();
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
    }
    
    /**
     * 重新设置任务节点负责人
     * @param executionId
     * @param taskNames
     * @param userNames
     * @return
     * @throws VCIException
     */
    public boolean resetNodeUser(String executionId, String[] taskNames,
            String[] userNames) throws VCIException {
        boolean bool = false;
        try {
            bool = ClientSession.getWorkflowService().resetNodeUser(executionId, taskNames, userNames);
        } catch (VCIError e) {
            // TODO Auto-generated catch block
            throw new VCIException(String.valueOf(e.code), e.messages);
        }
        return bool;
    }
}