jsegd-fluig-types 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/fluig.backend.d.ts +41 -2
- package/fluig.webservice.d.ts +344 -0
- package/index.d.ts +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# jsegd-fluig-types
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
Pacote de tipos TypeScript para desenvolvimento com a plataforma Fluig. Este pacote fornece tipagens completas para APIs do Fluig, facilitando o desenvolvimento tanto no frontend quanto no backend.
|
package/fluig.backend.d.ts
CHANGED
|
@@ -414,14 +414,53 @@ declare global {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// #########################################################################
|
|
417
|
-
// ##########################
|
|
417
|
+
// ########################## ServiceManager Types #########################
|
|
418
418
|
// #########################################################################
|
|
419
|
+
|
|
420
|
+
// Mapeamento de classes Java comuns no Fluig
|
|
421
|
+
interface ClassNameMap {
|
|
422
|
+
'java.util.ArrayList': java.util.ArrayList<any>;
|
|
423
|
+
'java.util.HashMap': java.util.HashMap<any, any>;
|
|
424
|
+
'java.util.List': java.util.List<any>;
|
|
425
|
+
'java.util.Collection': java.util.Collection<any>;
|
|
426
|
+
'java.util.Map': java.util.Map<any, any>;
|
|
427
|
+
'java.lang.String': java.lang.String;
|
|
428
|
+
'java.lang.Integer': java.lang.Integer;
|
|
429
|
+
'java.lang.Long': java.lang.Long;
|
|
430
|
+
'java.lang.Object': java.lang.Object;
|
|
431
|
+
'java.sql.ResultSet': java.sql.ResultSet;
|
|
432
|
+
'java.sql.Date': java.sql.Date;
|
|
433
|
+
'java.sql.Timestamp': java.sql.Timestamp;
|
|
434
|
+
'javax.naming.InitialContext': javax.naming.InitialContext;
|
|
435
|
+
'com.fluig.sdk.api.FluigAPI': com.fluig.sdk.api.FluigAPI;
|
|
436
|
+
'com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService': com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService;
|
|
437
|
+
}
|
|
438
|
+
|
|
419
439
|
class ServiceManager {
|
|
420
440
|
static getService(serviceName: string): Service;
|
|
421
441
|
}
|
|
442
|
+
|
|
422
443
|
class Service {
|
|
423
444
|
getBean(): {
|
|
424
|
-
|
|
445
|
+
/**
|
|
446
|
+
* Instancia uma classe Java com tipagem específica baseada no nome da classe
|
|
447
|
+
* @param className Nome completo da classe Java
|
|
448
|
+
* @returns Instância da classe com tipagem apropriada
|
|
449
|
+
* @example
|
|
450
|
+
* const arrayList = service.getBean().instantiate('java.util.ArrayList');
|
|
451
|
+
* arrayList.add("item"); // Métodos do ArrayList disponíveis
|
|
452
|
+
*
|
|
453
|
+
* const hashMap = service.getBean().instantiate('java.util.HashMap');
|
|
454
|
+
* hashMap.put("key", "value"); // Métodos do HashMap disponíveis
|
|
455
|
+
*
|
|
456
|
+
* const fluigAPI = service.getBean().instantiate('com.fluig.sdk.api.FluigAPI');
|
|
457
|
+
* fluigAPI.getUserService(); // Métodos da FluigAPI disponíveis
|
|
458
|
+
*
|
|
459
|
+
* const workflowService = service.getBean().instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService');
|
|
460
|
+
* workflowService.startProcess(...); // Métodos do ECMWorkflowEngineService disponíveis
|
|
461
|
+
*/
|
|
462
|
+
instantiate<T extends keyof ClassNameMap>(className: T): ClassNameMap[T];
|
|
463
|
+
instantiate<T = any>(className: string): T;
|
|
425
464
|
};
|
|
426
465
|
}
|
|
427
466
|
}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
// fluig.webservice.d.ts
|
|
2
|
+
// Tipos para webservices do Fluig
|
|
3
|
+
|
|
4
|
+
declare global {
|
|
5
|
+
// #########################################################################
|
|
6
|
+
// #################### ECM Workflow Engine Service Types ##################
|
|
7
|
+
// #########################################################################
|
|
8
|
+
|
|
9
|
+
namespace com {
|
|
10
|
+
namespace totvs {
|
|
11
|
+
namespace technology {
|
|
12
|
+
namespace ecm {
|
|
13
|
+
namespace workflow {
|
|
14
|
+
namespace ws {
|
|
15
|
+
// Classe principal do serviço ECM Workflow Engine
|
|
16
|
+
class ECMWorkflowEngineServiceService {
|
|
17
|
+
constructor();
|
|
18
|
+
|
|
19
|
+
// Método para obter a porta do serviço
|
|
20
|
+
getWorkflowEngineServicePort(): WorkflowEngineService;
|
|
21
|
+
|
|
22
|
+
// Métodos de gerenciamento de processo
|
|
23
|
+
importProcess(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
24
|
+
exportProcess(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
25
|
+
exportProcessInZipFormat(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
26
|
+
|
|
27
|
+
// Métodos de inicialização de processo
|
|
28
|
+
startProcess(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
|
|
29
|
+
startProcessClassic(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
|
|
30
|
+
simpleStartProcess(username: string, password: string, companyId: number, processId: string, nextState: number, userId: string, comments: string): java.util.HashMap<string, string>;
|
|
31
|
+
|
|
32
|
+
// Métodos de gerenciamento de tarefas
|
|
33
|
+
saveAndSendTask(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
|
|
34
|
+
saveAndSendTaskClassic(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
|
|
35
|
+
saveAndSendTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, replacementUserId: string): java.util.HashMap<string, string>;
|
|
36
|
+
|
|
37
|
+
// Métodos de tarefa
|
|
38
|
+
takeProcessTask(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string): string;
|
|
39
|
+
takeProcessTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, replacementUserId: string): string;
|
|
40
|
+
|
|
41
|
+
// Métodos de cancelamento
|
|
42
|
+
cancelInstance(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string): string;
|
|
43
|
+
cancelInstanceByReplacement(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string, replacementUserId: string): string;
|
|
44
|
+
|
|
45
|
+
// Métodos de consulta
|
|
46
|
+
getAvailableProcess(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
47
|
+
getAvailableProcessOnDemand(username: string, password: string, companyId: number, limit: number, initialProcess: number, processSearch: string): ProcessDefinitionVersionDtoArray;
|
|
48
|
+
getAllProcessAvailableToExport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
49
|
+
getAllProcessAvailableToImport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
50
|
+
searchProcess(username: string, password: string, companyId: number, processSearch: string): ProcessDefinitionVersionDtoArray;
|
|
51
|
+
|
|
52
|
+
// Métodos de estados
|
|
53
|
+
getAvailableStates(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number): java.util.ArrayList<StateDto>;
|
|
54
|
+
getAvailableStatesDetail(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence?: number): AvailableStatesDetailDto;
|
|
55
|
+
getAllActiveStates(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<StateDto>;
|
|
56
|
+
|
|
57
|
+
// Métodos de usuários
|
|
58
|
+
getAvailableUsers(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number): AvailableUsersDto;
|
|
59
|
+
getAvailableUsersOnDemand(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
|
|
60
|
+
getAvailableUsersStart(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number): AvailableUsersDto;
|
|
61
|
+
getAvailableUsersStartOnDemand(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
|
|
62
|
+
|
|
63
|
+
// Métodos de dados do cartão
|
|
64
|
+
getInstanceCardData(username: string, password: string, companyId: number, processInstanceId: number): java.util.HashMap<string, string>;
|
|
65
|
+
getCardValue(username: string, password: string, companyId: number, processInstanceId: number, cardFieldId: string): string;
|
|
66
|
+
|
|
67
|
+
// Métodos de vencimento
|
|
68
|
+
setDueDate(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, dueDate: java.sql.Date, timeInSeconds: number): string;
|
|
69
|
+
calculateDeadLineHours(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
|
|
70
|
+
calculateDeadLineTime(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
|
|
71
|
+
|
|
72
|
+
// Métodos diversos
|
|
73
|
+
getActualThread(username: string, password: string, companyId: number, processInstanceId: number, state: number): number;
|
|
74
|
+
getProcessFormId(username: string, password: string, companyId: number, processId: string): string;
|
|
75
|
+
getProcessImage(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
76
|
+
getAttachments(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<AttachmentDto>;
|
|
77
|
+
getHistories(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<HistoryDto>;
|
|
78
|
+
|
|
79
|
+
// Métodos de comentários
|
|
80
|
+
setTasksComments(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence: number, comments: string): string;
|
|
81
|
+
|
|
82
|
+
// Métodos de decisão automática
|
|
83
|
+
setAutomaticDecisionClassic(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, userId: string, targetUserId: string, comments: string): string;
|
|
84
|
+
|
|
85
|
+
// Métodos de versão de processo
|
|
86
|
+
createWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): string;
|
|
87
|
+
getWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): number;
|
|
88
|
+
|
|
89
|
+
// Métodos de importação avançada
|
|
90
|
+
importProcessWithCard(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
91
|
+
importProcessWithCardAndRelatedDatasets(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
92
|
+
importProcessWithCardAndPersistenceType(username: string, password: string, companyId: number, processId: string, processFile: string, persistenceType: string): string;
|
|
93
|
+
importProcessWithCardAndGeneralInfo(username: string, password: string, companyId: number, processId: string, processFile: string, generalInfo: string): string;
|
|
94
|
+
|
|
95
|
+
// Métodos de anexo
|
|
96
|
+
updateWorkflowAttachment(username: string, password: string, companyId: number, processInstanceId: number, attachmentData: AttachmentDto): string;
|
|
97
|
+
|
|
98
|
+
// Métodos de liberação
|
|
99
|
+
releaseProcess(username: string, password: string, companyId: number, processId: string): string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Interface do port/endpoint do webservice
|
|
103
|
+
interface WorkflowEngineService {
|
|
104
|
+
// Métodos de gerenciamento de processo
|
|
105
|
+
importProcess(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
106
|
+
exportProcess(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
107
|
+
exportProcessInZipFormat(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
108
|
+
|
|
109
|
+
// Métodos de inicialização de processo
|
|
110
|
+
startProcess(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
|
|
111
|
+
startProcessClassic(username: string, password: string, companyId: number, processId: string, nextState: number, choosedUsers: java.util.ArrayList<string>, comments: string, completeTask: boolean, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
|
|
112
|
+
simpleStartProcess(username: string, password: string, companyId: number, processId: string, nextState: number, userId: string, comments: string): java.util.HashMap<string, string>;
|
|
113
|
+
|
|
114
|
+
// Métodos de gerenciamento de tarefas
|
|
115
|
+
saveAndSendTask(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, managerMode: boolean): java.util.HashMap<string, string>;
|
|
116
|
+
saveAndSendTaskClassic(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>): java.util.HashMap<string, string>;
|
|
117
|
+
saveAndSendTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, choosedState: number, threadSequence: number, userId: string, completeTask: boolean, comments: string, cardData: java.util.HashMap<string, string>, replacementUserId: string): java.util.HashMap<string, string>;
|
|
118
|
+
|
|
119
|
+
// Métodos de tarefa
|
|
120
|
+
takeProcessTask(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string): string;
|
|
121
|
+
takeProcessTaskByReplacement(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, replacementUserId: string): string;
|
|
122
|
+
|
|
123
|
+
// Métodos de cancelamento
|
|
124
|
+
cancelInstance(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string): string;
|
|
125
|
+
cancelInstanceByReplacement(username: string, password: string, companyId: number, processInstanceId: number, userId: string, cancelText: string, replacementUserId: string): string;
|
|
126
|
+
|
|
127
|
+
// Métodos de consulta
|
|
128
|
+
getAvailableProcess(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
129
|
+
getAvailableProcessOnDemand(username: string, password: string, companyId: number, limit: number, initialProcess: number, processSearch: string): ProcessDefinitionVersionDtoArray;
|
|
130
|
+
getAllProcessAvailableToExport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
131
|
+
getAllProcessAvailableToImport(username: string, password: string, companyId: number): ProcessDefinitionVersionDtoArray;
|
|
132
|
+
searchProcess(username: string, password: string, companyId: number, processSearch: string): ProcessDefinitionVersionDtoArray;
|
|
133
|
+
|
|
134
|
+
// Métodos de estados
|
|
135
|
+
getAvailableStates(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number): java.util.ArrayList<StateDto>;
|
|
136
|
+
getAvailableStatesDetail(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence?: number): AvailableStatesDetailDto;
|
|
137
|
+
getAllActiveStates(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<StateDto>;
|
|
138
|
+
|
|
139
|
+
// Métodos de usuários
|
|
140
|
+
getAvailableUsers(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number): AvailableUsersDto;
|
|
141
|
+
getAvailableUsersOnDemand(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
|
|
142
|
+
getAvailableUsersStart(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number): AvailableUsersDto;
|
|
143
|
+
getAvailableUsersStartOnDemand(username: string, password: string, companyId: number, processId: string, state: number, threadSequence: number, limit: number, initialUser: number, userSearch: string): AvailableUsersDto;
|
|
144
|
+
|
|
145
|
+
// Métodos de dados do cartão
|
|
146
|
+
getInstanceCardData(username: string, password: string, companyId: number, processInstanceId: number): java.util.HashMap<string, string>;
|
|
147
|
+
getCardValue(username: string, password: string, companyId: number, processInstanceId: number, cardFieldId: string): string;
|
|
148
|
+
|
|
149
|
+
// Métodos de vencimento
|
|
150
|
+
setDueDate(username: string, password: string, companyId: number, processInstanceId: number, threadSequence: number, userId: string, dueDate: java.sql.Date, timeInSeconds: number): string;
|
|
151
|
+
calculateDeadLineHours(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
|
|
152
|
+
calculateDeadLineTime(deadlineDate: java.sql.Date, seconds: number, deadlineInHours: number, periodId: string): unknown;
|
|
153
|
+
|
|
154
|
+
// Métodos diversos
|
|
155
|
+
getActualThread(username: string, password: string, companyId: number, processInstanceId: number, state: number): number;
|
|
156
|
+
getProcessFormId(username: string, password: string, companyId: number, processId: string): string;
|
|
157
|
+
getProcessImage(username: string, password: string, companyId: number, processId: string, version: number): string;
|
|
158
|
+
getAttachments(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<AttachmentDto>;
|
|
159
|
+
getHistories(username: string, password: string, companyId: number, processInstanceId: number): java.util.ArrayList<HistoryDto>;
|
|
160
|
+
|
|
161
|
+
// Métodos de comentários
|
|
162
|
+
setTasksComments(username: string, password: string, companyId: number, processInstanceId: number, userId: string, threadSequence: number, comments: string): string;
|
|
163
|
+
|
|
164
|
+
// Métodos de decisão automática
|
|
165
|
+
setAutomaticDecisionClassic(username: string, password: string, companyId: number, processInstanceId: number, state: number, threadSequence: number, userId: string, targetUserId: string, comments: string): string;
|
|
166
|
+
|
|
167
|
+
// Métodos de versão de processo
|
|
168
|
+
createWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): string;
|
|
169
|
+
getWorkFlowProcessVersion(username: string, password: string, companyId: number, processId: string): number;
|
|
170
|
+
|
|
171
|
+
// Métodos de importação avançada
|
|
172
|
+
importProcessWithCard(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
173
|
+
importProcessWithCardAndRelatedDatasets(username: string, password: string, companyId: number, processId: string, processFile: string): string;
|
|
174
|
+
importProcessWithCardAndPersistenceType(username: string, password: string, companyId: number, processId: string, processFile: string, persistenceType: string): string;
|
|
175
|
+
importProcessWithCardAndGeneralInfo(username: string, password: string, companyId: number, processId: string, processFile: string, generalInfo: string): string;
|
|
176
|
+
|
|
177
|
+
// Métodos de anexo
|
|
178
|
+
updateWorkflowAttachment(username: string, password: string, companyId: number, processInstanceId: number, attachmentData: AttachmentDto): string;
|
|
179
|
+
|
|
180
|
+
// Métodos de liberação
|
|
181
|
+
releaseProcess(username: string, password: string, companyId: number, processId: string): string;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// DTOs e tipos auxiliares
|
|
185
|
+
interface ProcessDefinitionVersionDtoArray {
|
|
186
|
+
item: ProcessDefinitionVersionDto[];
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
interface ProcessDefinitionVersionDto {
|
|
190
|
+
processId: string;
|
|
191
|
+
version: number;
|
|
192
|
+
description: string;
|
|
193
|
+
active: boolean;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
interface StateDto {
|
|
197
|
+
sequence: number;
|
|
198
|
+
state: number;
|
|
199
|
+
description: string;
|
|
200
|
+
stateType: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface AvailableStatesDetailDto {
|
|
204
|
+
item: StateDetailDto[];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
interface StateDetailDto {
|
|
208
|
+
sequence: number;
|
|
209
|
+
state: number;
|
|
210
|
+
description: string;
|
|
211
|
+
stateType: string;
|
|
212
|
+
canReceiveTask: boolean;
|
|
213
|
+
canTakeTask: boolean;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
interface AvailableUsersDto {
|
|
217
|
+
item: UserDto[];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
interface UserDto {
|
|
221
|
+
userId: string;
|
|
222
|
+
userName: string;
|
|
223
|
+
email: string;
|
|
224
|
+
active: boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
interface AttachmentDto {
|
|
228
|
+
documentId: number;
|
|
229
|
+
version: number;
|
|
230
|
+
fileName: string;
|
|
231
|
+
description: string;
|
|
232
|
+
uploadDate: java.sql.Date;
|
|
233
|
+
userId: string;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
interface HistoryDto {
|
|
237
|
+
processInstanceId: number;
|
|
238
|
+
state: number;
|
|
239
|
+
sequence: number;
|
|
240
|
+
userId: string;
|
|
241
|
+
dateTime: java.sql.Date;
|
|
242
|
+
comments: string;
|
|
243
|
+
action: string;
|
|
244
|
+
stateDescription: string;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// #########################################################################
|
|
254
|
+
// ##################### WebService ServiceManager Types ###################
|
|
255
|
+
// #########################################################################
|
|
256
|
+
|
|
257
|
+
// A classe ECMWorkflowEngineServiceService já está mapeada no ClassNameMap do fluig.backend.d.ts
|
|
258
|
+
// Este arquivo apenas define os tipos específicos para webservices
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/*
|
|
262
|
+
// ############################################################################
|
|
263
|
+
// #################### Exemplos de uso do ECMWorkflowEngineService ##########
|
|
264
|
+
// ############################################################################
|
|
265
|
+
|
|
266
|
+
// Exemplo de uso básico do ECMWorkflowEngineService
|
|
267
|
+
function exemploWorkflowService() {
|
|
268
|
+
// Instanciando o serviço com tipagem completa
|
|
269
|
+
const service = ServiceManager.getService("ECMWorkflowEngineServiceService");
|
|
270
|
+
const workflowServiceClass = service.getBean().instantiate('com.totvs.technology.ecm.workflow.ws.ECMWorkflowEngineServiceService');
|
|
271
|
+
|
|
272
|
+
// Obtendo o port/endpoint do webservice
|
|
273
|
+
const workflowService = workflowServiceClass.getWorkflowEngineServicePort();
|
|
274
|
+
|
|
275
|
+
// Exemplo 1: Iniciar um processo
|
|
276
|
+
const cardData = new java.util.HashMap<string, string>();
|
|
277
|
+
cardData.put("campo1", "valor1");
|
|
278
|
+
cardData.put("campo2", "valor2");
|
|
279
|
+
|
|
280
|
+
const choosedUsers = new java.util.ArrayList<string>();
|
|
281
|
+
choosedUsers.add("usuario123");
|
|
282
|
+
|
|
283
|
+
const result = workflowService.startProcess(
|
|
284
|
+
"admin", // username
|
|
285
|
+
"senha", // password
|
|
286
|
+
1, // companyId
|
|
287
|
+
"ProcessoTeste", // processId
|
|
288
|
+
2, // nextState
|
|
289
|
+
choosedUsers, // choosedUsers
|
|
290
|
+
"Iniciando processo via webservice", // comments
|
|
291
|
+
true, // completeTask
|
|
292
|
+
cardData, // cardData
|
|
293
|
+
false // managerMode
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
// Exemplo 2: Obter processos disponíveis
|
|
297
|
+
const availableProcesses = workflowService.getAvailableProcess("admin", "senha", 1);
|
|
298
|
+
for (const process of availableProcesses.item) {
|
|
299
|
+
log.info(`Processo: ${process.processId} - Versão: ${process.version}`);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Exemplo 3: Obter dados do cartão de uma instância
|
|
303
|
+
const instanceCardData = workflowService.getInstanceCardData("admin", "senha", 1, 12345);
|
|
304
|
+
|
|
305
|
+
// Exemplo 4: Avançar uma tarefa
|
|
306
|
+
const nextCardData = new java.util.HashMap<string, string>();
|
|
307
|
+
nextCardData.put("aprovacao", "APROVADO");
|
|
308
|
+
nextCardData.put("observacoes", "Processo aprovado com sucesso");
|
|
309
|
+
|
|
310
|
+
const taskResult = workflowService.saveAndSendTask(
|
|
311
|
+
"admin", // username
|
|
312
|
+
"senha", // password
|
|
313
|
+
1, // companyId
|
|
314
|
+
12345, // processInstanceId
|
|
315
|
+
3, // choosedState
|
|
316
|
+
1, // threadSequence
|
|
317
|
+
"usuario123", // userId
|
|
318
|
+
true, // completeTask
|
|
319
|
+
"Aprovando processo", // comments
|
|
320
|
+
nextCardData, // cardData
|
|
321
|
+
false // managerMode
|
|
322
|
+
);
|
|
323
|
+
|
|
324
|
+
// Exemplo 5: Obter usuários disponíveis para uma atividade
|
|
325
|
+
const availableUsers = workflowService.getAvailableUsers("admin", "senha", 1, 12345, 3, 1);
|
|
326
|
+
for (const user of availableUsers.item) {
|
|
327
|
+
log.info(`Usuário disponível: ${user.userId} - ${user.userName}`);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// Exemplo 6: Cancelar uma instância
|
|
331
|
+
const cancelResult = workflowService.cancelInstance(
|
|
332
|
+
"admin", // username
|
|
333
|
+
"senha", // password
|
|
334
|
+
1, // companyId
|
|
335
|
+
12345, // processInstanceId
|
|
336
|
+
"admin", // userId
|
|
337
|
+
"Cancelamento solicitado pelo administrador" // cancelText
|
|
338
|
+
);
|
|
339
|
+
|
|
340
|
+
return result;
|
|
341
|
+
}
|
|
342
|
+
*/
|
|
343
|
+
|
|
344
|
+
export {};
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsegd-fluig-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Pacote de tipos para fluig",
|
|
5
5
|
"license": "CC-BY-NC-ND-4.0",
|
|
6
6
|
"author": "Elemar Deckmann",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"fluig.sdk.d.ts",
|
|
12
12
|
"fluig.frontend.d.ts",
|
|
13
13
|
"fluig.backend.d.ts",
|
|
14
|
+
"fluig.webservice.d.ts",
|
|
14
15
|
"java.d.ts"
|
|
15
16
|
]
|
|
16
17
|
}
|