jBPM Developers Guide(jBPM开发指南)--Chapter 3. BPMN 2.0(第五部分)

3.8.12. Task: Script Task(脚本任务)

    A script task is a an automatic activity upon which the process engine will execute a script when the task is reached. The script task is used as follows:

 

    脚本任务时一个自动活动,当任务到达的时候 流程引擎会执行一个脚本。脚本任务使用方式如下:

<scriptTask id="scriptTask" name="Script Task" scriptLanguage="bsh">
  <script><![CDATA[
    for(int i=0; i < input.length; i++){
      System.out.println(input[i] + " x 2 = " + (input[i]*2));
    }]]>
  </script>
</scriptTask> 
 

    The script task, besides the required id and the optional name, allows for specifying a scriptLanguage and a script. Since we're using JSR-223 ('Scripting for the Java platform'), changing the script language involves

 

    脚本任务,除了必须的id和可选的 name之外,还允许指定 scriptLanguagescript。因为我们使用了JSR-223java平台的脚本语言),修改脚本语言就需要:

  • changing the scriptLanguage attribute to the JSR-223 compliant name
  • scriptLanguage 属性修改为JSR-223兼容的名称
  • adding the ScriptEngine implementation of the JSR specification to the classpath
  • classpath下添加JSR规范的ScriptEngine实现

    The XML above is visualized as follows (adding a none start and end event).

 

    上面的XML对应图形如下所示(添加了空开始和结束事件)。


    As shown in the example, process variables can be used inside the scripts. We can now start a process instance for this example process, while also supplying some random input variables:

 

    像上面例子中显示的那样,可以在脚本中使用流程变量。我们现在可以启动一个这个例子的流程,同时提供一些随机生成的输入变量:

Map<String, Object> variables = new HashMap<String, Object>();
Integer[] values = { 11, 23, 56, 980, 67543, 8762524 };
variables.put("input", values);   
executionService.startProcessInstanceBykey("scriptTaskExample", variables); 
    In the output console, we can now see the script being executed:

 

    在输出控制台里,我们现在可以看到脚本的执行:

11 x 2 = 22
23 x 2 = 46
56 x 2 = 112
980 x 2 = 1960
67543 x 2 = 135086
8762524 x 2 = 17525048
   

3.8.13. Task: Manual task(任务:手工任务)

 

    A manual task is a task that is performed by an external actor, but without the aid of a BPM system or a service that is invoked. In the real world, examples are plenty: the installation of telephone system, sending of a letter using regular mail, calling a customer by phone, etc.

 

    手工任务时一个由外部人员执行的任务,但是它的执行没有BPM系统或服务帮助。在真实世界里,有很多这样的例子,如安装一个电话系统、使用定期邮件发送一封信、用电话联系客户,等等。

<manualTask id="myManualTask" name="Call customer" />
    The purpose of the manual task is more documentation/modeling-wise, as it has no meaning for execution on a process engine. As such, the process engine will simply pass through a manual task when it encounters one.

 

    手工任务的目的更像是为了文档或建模提醒,因为它对流程引擎的运行没有任何意义。因此,当流程引擎遇到一个手工任务时会简单略过。

 

3.8.14. Task: Java Receive task(Java Receive任务)

 

    A receive task is a task that waits for the arrival of an external message. Besides the obvious use case involving webservices, the specification is liberal in what to do in other environments. The web service use case is not yet implemented, but the receive task can already be used in a Java environment.

 

    receive task是一个任务会等到外部消息的到来。除了广泛使用的web service用例,规范在其他环境中的使用也是一样的。 web service用例还没有实现, 但是receive task已经可以在java环境中使用了。

 

    The receive task is depicted as a rounded rectangle (= task shape) with a little enveloppe in the left top corner.

 

    receive task显示为一个圆角矩形(和task图形一样) 在左上角有一个小信封的图标。


    In a Java environment, the receive task without any other attribute filled in besides an id and (optionally) a name, behaves as a wait state. To introduce a wait state in your business process, just add the following line:

 

    在java环境中,receive task除了idname(可选)属性外,没有其他属性,其行为就像是一个等待状态。为了在你的业务流程中使用等待状态,只需要加入如下几行:

<receiveTask id="receiveTask" name="wait" />

    Process execution will wait in such a receive task. The process can then be continued using the familiar jBPM signal methods. Note that this will probably change in the future, since a 'signal' has a completely different meaning in BPMN 2.0.

  

    流程执行当遇到一个receive task是将会进入等待状态。流程可以使用我们熟悉的jBPM signal 方法来继续执行。注意,这些可能在未来改变,因为'signal'BPMN 2.0中拥有完全不同的含义。

Execution execution = processInstance.findActiveExecutionIn("receiveTask");
executionService.signalExecutionById(execution.getId()); 
内容概要:本文提出了一种基于融合鱼鹰算法和柯西变异的改进麻雀优化算法(OCSSA),用于优化变分模态分解(VMD)的参数,进而结合卷积神经网络(CNN)与双向长短期记忆网络(BiLSTM)构建OCSSA-VMD-CNN-BILSTM模型,实现对轴承故障的高【轴承故障诊断】基于融合鱼鹰和柯西变异的麻雀优化算法OCSSA-VMD-CNN-BILSTM轴承诊断研究【西储大学数据】(Matlab代码实现)精度诊断。研究采用西储大学公开的轴承故障数据集进行实验验证,通过优化VMD的模态数和惩罚因子,有效提升了信号分解的准确性与稳定性,随后利用CNN提取故障特征,BiLSTM捕捉时间序列的深层依赖关系,最终实现故障类型的智能识别。该方法在提升故障诊断精度与鲁棒性方面表现出优越性能。; 适合人群:具备一定信号处理、机器学习基础,从事机械故障诊断、智能运维、工业大数据分析等相关领域的研究生、科研人员及工程技术人员。; 使用场景及目标:①解决传统VMD参数依赖人工经验选取的问题,实现参数自适应优化;②提升复杂工况下滚动轴承早期故障的识别准确率;③为智能制造与预测性维护提供可靠的技术支持。; 阅读建议:建议读者结合Matlab代码实现过程,深入理解OCSSA优化机制、VMD信号分解流程以及CNN-BiLSTM网络架构的设计逻辑,重点关注参数优化与故障分类的联动关系,并可通过更换数据集进一步验证模型泛化能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值