Search in sources :

Example 6 with ScriptTask

use of org.activiti.bpmn.model.ScriptTask in project Activiti by Activiti.

the class ScriptStepDefinitionConverter method createProcessArtifact.

@Override
protected ScriptTask createProcessArtifact(ScriptStepDefinition stepDefinition, WorkflowDefinitionConversion conversion) {
    ScriptTask scriptTask = new ScriptTask();
    scriptTask.setId(conversion.getUniqueNumberedId(ConversionConstants.SCRIPT_TASK_ID_PREFIX));
    scriptTask.setName(stepDefinition.getName());
    scriptTask.setScript(stepDefinition.getScript());
    if (stepDefinition.getScriptLanguage() != null) {
        scriptTask.setScriptFormat(stepDefinition.getScriptLanguage());
    } else {
        scriptTask.setScriptFormat("JavaScript");
    }
    addFlowElement(conversion, scriptTask, true);
    return scriptTask;
}
Also used : ScriptTask(org.activiti.bpmn.model.ScriptTask)

Example 7 with ScriptTask

use of org.activiti.bpmn.model.ScriptTask in project Activiti by Activiti.

the class ScriptTaskJsonConverter method convertJsonToElement.

protected FlowElement convertJsonToElement(JsonNode elementNode, JsonNode modelNode, Map<String, JsonNode> shapeMap) {
    ScriptTask task = new ScriptTask();
    task.setScriptFormat(getPropertyValueAsString(PROPERTY_SCRIPT_FORMAT, elementNode));
    task.setScript(getPropertyValueAsString(PROPERTY_SCRIPT_TEXT, elementNode));
    return task;
}
Also used : ScriptTask(org.activiti.bpmn.model.ScriptTask)

Aggregations

ScriptTask (org.activiti.bpmn.model.ScriptTask)7 FlowElement (org.activiti.bpmn.model.FlowElement)1