コード例 #1
0
 public KickstartScriptTask convertToKickstartScriptTask(final ScriptTask serviceTask) {
   KickstartScriptTask task = new KickstartScriptTask();
   task.setScriptFormat(serviceTask.getScriptFormat());
   task.setResultVariableName(serviceTask.getResultVariableName());
   task.setScript(serviceTask.getScript());
   return task;
 }
コード例 #2
0
  @Test
  public void testCreateFlowElement() throws Exception {
    //    <scriptTask id="theScriptTask" name="Execute script" scriptFormat="juel"
    // activiti:resultVariableName="myVar">
    //      <script>#{echo}</script>
    //    </scriptTask>

    KickstartScriptTask dto = new KickstartScriptTask();
    dto.setId("theScriptTask");
    dto.setName("Execute script");

    dto.setScriptFormat("juel");
    dto.setResultVariableName("myVar");
    dto.setScript("#{echo}");

    Bpmn20MarshallingService marshallingService = new MarshallingServiceImpl();
    ScriptTask scriptTask = marshallingService.convertToBPMN(dto);
    assertEquals("juel", scriptTask.getScriptFormat());
    assertEquals("myVar", scriptTask.getResultVariableName());
    assertEquals("#{echo}", scriptTask.getScript());
  }