WorkflowContextImpl.java
2.96 KB
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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.aemfd.docmanager.Document
* com.adobe.granite.workflow.WorkflowSession
* com.adobe.granite.workflow.exec.WorkItem
* com.adobe.granite.workflow.exec.Workflow
* com.adobe.granite.workflow.model.WorkflowModel
*/
package com.adobe.aemfd.watchfolder.workflow;
import com.adobe.aemfd.docmanager.Document;
import com.adobe.aemfd.watchfolder.service.ProcessorContextImpl;
import com.adobe.aemfd.watchfolder.workflow.api.WorkflowContext;
import com.adobe.aemfd.watchfolder.workflow.api.payload.WorkflowExecutionContext;
import com.adobe.aemfd.watchfolder.workflow.api.payload.WorkflowInitializationContext;
import com.adobe.granite.workflow.WorkflowSession;
import com.adobe.granite.workflow.exec.WorkItem;
import com.adobe.granite.workflow.exec.Workflow;
import com.adobe.granite.workflow.model.WorkflowModel;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public class WorkflowContextImpl
extends ProcessorContextImpl
implements WorkflowContext,
WorkflowInitializationContext,
WorkflowExecutionContext {
WorkflowModel workflowModel;
WorkItem workItem;
WorkflowSession workflowSession;
Map args;
Map<String, Document> committedResults = new HashMap<String, Document>();
Map<String, Object> committedVariables = new HashMap<String, Object>();
Map<String, Object> variableMap = new HashMap<String, Object>();
@Override
public WorkItem getWorkItem() {
return this.workItem;
}
@Override
public WorkflowSession getWorkflowSession() {
return this.workflowSession;
}
@Override
public Map getMetadata() {
return this.args;
}
@Override
public Map<String, Document> getCommittedResults() {
return this.committedResults == null ? null : Collections.unmodifiableMap(this.committedResults);
}
@Override
public Map<String, Object> getCommittedVariables() {
return this.committedVariables == null ? null : Collections.unmodifiableMap(this.committedVariables);
}
@Override
public void setVariable(String varName, Object value) {
this.variableMap.put(varName, value);
}
@Override
public WorkflowModel getWorkflowModel() {
if (this.workflowModel != null) {
return this.workflowModel;
}
if (this.workItem != null) {
return this.workItem.getWorkflow().getWorkflowModel();
}
return null;
}
void clear() {
this.workflowModel = null;
this.watchFolderId = null;
this.inputMap.clear();
this.committedResults.clear();
this.committedVariables.clear();
this.configParameters = null;
this.resultMap.clear();
this.variableMap.clear();
this.workItem = null;
this.workflowSession = null;
this.args = null;
}
}