use of io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl in project automatiko-engine by automatiko-io.
the class FunctionImportHandler method start.
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
parser.startElementBuilder(localName, attrs);
WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
final String name = attrs.getValue("name");
emptyAttributeCheck(localName, "name", name, parser);
java.util.List<String> list = process.getFunctionImports();
if (list == null) {
list = new ArrayList<String>();
process.setFunctionImports(list);
}
list.add(name);
return null;
}
use of io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl in project automatiko-engine by automatiko-io.
the class AbstractProcess method activate.
@Override
public void activate() {
if (this.activated) {
return;
}
configure();
WorkflowProcessImpl p = (WorkflowProcessImpl) process();
List<StartNode> startNodes = p.getTimerStart();
if (startNodes != null && !startNodes.isEmpty()) {
this.processRuntime = createProcessRuntime();
for (StartNode startNode : startNodes) {
if (startNode != null && startNode.getTimer() != null) {
String timerId = processRuntime.getJobsService().scheduleProcessJob(ProcessJobDescription.of(configureTimerInstance(startNode.getTimer()), this));
startTimerInstances.add(timerId);
}
}
}
this.activated = true;
}
use of io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl in project automatiko-engine by automatiko-io.
the class ProcessToExecModelGenerator method generateUserTaskModel.
public List<UserTaskModelMetaData> generateUserTaskModel(WorkflowProcess process, boolean templateSupported) {
String packageName = process.getPackageName();
List<UserTaskModelMetaData> usertaskModels = new ArrayList<>();
VariableScope variableScope = (VariableScope) ((io.automatiko.engine.workflow.base.core.Process) process).getDefaultContext(VariableScope.VARIABLE_SCOPE);
for (Node node : ((WorkflowProcessImpl) process).getNodesRecursively()) {
if (node instanceof HumanTaskNode) {
HumanTaskNode humanTaskNode = (HumanTaskNode) node;
VariableScope nodeVariableScope = (VariableScope) ((ContextContainer) humanTaskNode.getParentContainer()).getDefaultContext(VariableScope.VARIABLE_SCOPE);
if (nodeVariableScope == null) {
nodeVariableScope = variableScope;
}
usertaskModels.add(new UserTaskModelMetaData(packageName, variableScope, nodeVariableScope, humanTaskNode, process.getId(), ModelMetaData.version(process.getVersion()), templateSupported));
}
}
return usertaskModels;
}
use of io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl in project automatiko-engine by automatiko-io.
the class SwimlaneHandler method start.
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
parser.startElementBuilder(localName, attrs);
WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
final String name = attrs.getValue("name");
emptyAttributeCheck(localName, "name", name, parser);
SwimlaneContext swimlaneContext = (SwimlaneContext) process.getDefaultContext(SwimlaneContext.SWIMLANE_SCOPE);
if (swimlaneContext != null) {
Swimlane swimlane = new Swimlane();
swimlane.setName(name);
swimlaneContext.addSwimlane(swimlane);
} else {
throw new SAXParseException("Could not find default swimlane context.", parser.getLocator());
}
return null;
}
use of io.automatiko.engine.workflow.process.core.impl.WorkflowProcessImpl in project automatiko-engine by automatiko-io.
the class GlobalHandler method start.
public Object start(final String uri, final String localName, final Attributes attrs, final ExtensibleXmlParser parser) throws SAXException {
parser.startElementBuilder(localName, attrs);
WorkflowProcessImpl process = (WorkflowProcessImpl) parser.getParent();
final String identifier = attrs.getValue("identifier");
final String type = attrs.getValue("type");
emptyAttributeCheck(localName, "identifier", identifier, parser);
emptyAttributeCheck(localName, "type", type, parser);
Map<String, String> map = process.getGlobals();
if (map == null) {
map = new HashMap<String, String>();
process.setGlobals(map);
}
map.put(identifier, type);
return null;
}
Aggregations