<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Conditional Expression in Intermidiate Catching event in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34149#M14416</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Clearly the signal expression is not a standard BPMN and is an extension. To make it work this is what I had to do.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Had to extend CatchEventXMLConverter and add it in BpmnXMLConverter.&lt;PRE&gt; BpmnXMLConverter.addConverter(new CatchEventXMLConverter() {
      @Override
      protected void writeSignalDefinition(Event parentEvent,
          SignalEventDefinition signalDefinition, XMLStreamWriter xtw) throws Exception {
        xtw.writeStartElement(ELEMENT_EVENT_SIGNALDEFINITION);
        writeDefaultAttribute("activiti:"+ATTRIBUTE_SIGNAL_EXPRESSION, signalDefinition.getSignalExpression(), xtw);
        if (parentEvent instanceof ThrowEvent &amp;amp;&amp;amp; signalDefinition.isAsync()) {
          BpmnXMLUtil.writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_ASYNCHRONOUS, "true", xtw);
        }
        boolean didWriteExtensionStartElement =
            BpmnXMLUtil.writeExtensionElements(signalDefinition, false, xtw);
        if (didWriteExtensionStartElement) {
          xtw.writeEndElement();
        }
        xtw.writeEndElement();
      }
    });&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Had to extend IntermediateCatchSignalEventActivityBehavior and register it process engine configuration.&lt;PRE&gt;getProcessEngineConfiguration())
            .setActivityBehaviorFactory(new DefaultActivityBehaviorFactory() {
              @Override
              public IntermediateCatchSignalEventActivityBehavior createIntermediateCatchSignalEventActivityBehavior(
                  IntermediateCatchEvent intermediateCatchEvent,
                  SignalEventDefinition signalEventDefinition, Signal signal) {


                return new IntermediateCatchSignalEventActivityBehavior(signalEventDefinition,
                    signal) {
                
                  private static final long serialVersionUID = 1L;

                  @Override
                  public void execute(DelegateExecution execution) {
                    CommandContext commandContext = Context.getCommandContext();
                    ExecutionEntity executionEntity = (ExecutionEntity) execution;

                    String signalName = null;

                    Expression signalExpression =
                        commandContext.getProcessEngineConfiguration().getExpressionManager()
                            .createExpression(signalEventDefinition.getSignalExpression());
                    signalName = signalExpression.getValue(execution).toString();


                    commandContext.getEventSubscriptionEntityManager().insertSignalEvent(signalName,
                        signal, executionEntity);
                  }

                };
              }

            })&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;I removed signalRef completely But you can tweak the code and use both flavour.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Vishal&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 15:05:07 GMT</pubDate>
    <dc:creator>vgaur</dc:creator>
    <dc:date>2020-02-28T15:05:07Z</dc:date>
    <item>
      <title>Conditional Expression in Intermidiate Catching event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34147#M14414</link>
      <description>&lt;P&gt;I am trying to use intermididate catching event in my process definition, but only want to signal it based on condition. I can see signalExpression is there inside catching event but bpmn modelere is not allowing me to use this.&lt;/P&gt;&lt;P&gt;I posted similar question os stack overflow&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/60350138/signalexpression-in-activiti-6-0-intermediate-catching-event" target="_blank" rel="noopener nofollow noreferrer"&gt;https://stackoverflow.com/questions/60350138/signalexpression-in-activiti-6-0-intermediate-catching-event&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Can someone help.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Feb 2020 08:00:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34147#M14414</guid>
      <dc:creator>vgaur</dc:creator>
      <dc:date>2020-02-22T08:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression in Intermidiate Catching event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34148#M14415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/32907"&gt;@vgaur&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;I see on Stack that someone chipped in - looks like you have resolved your issue? If so, it would be great if you could update this post with how you resolved your problem.&lt;/P&gt;
&lt;P&gt;Many thanks,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 09:26:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34148#M14415</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-02-24T09:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression in Intermidiate Catching event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34149#M14416</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Clearly the signal expression is not a standard BPMN and is an extension. To make it work this is what I had to do.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Had to extend CatchEventXMLConverter and add it in BpmnXMLConverter.&lt;PRE&gt; BpmnXMLConverter.addConverter(new CatchEventXMLConverter() {
      @Override
      protected void writeSignalDefinition(Event parentEvent,
          SignalEventDefinition signalDefinition, XMLStreamWriter xtw) throws Exception {
        xtw.writeStartElement(ELEMENT_EVENT_SIGNALDEFINITION);
        writeDefaultAttribute("activiti:"+ATTRIBUTE_SIGNAL_EXPRESSION, signalDefinition.getSignalExpression(), xtw);
        if (parentEvent instanceof ThrowEvent &amp;amp;&amp;amp; signalDefinition.isAsync()) {
          BpmnXMLUtil.writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_ASYNCHRONOUS, "true", xtw);
        }
        boolean didWriteExtensionStartElement =
            BpmnXMLUtil.writeExtensionElements(signalDefinition, false, xtw);
        if (didWriteExtensionStartElement) {
          xtw.writeEndElement();
        }
        xtw.writeEndElement();
      }
    });&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;Had to extend IntermediateCatchSignalEventActivityBehavior and register it process engine configuration.&lt;PRE&gt;getProcessEngineConfiguration())
            .setActivityBehaviorFactory(new DefaultActivityBehaviorFactory() {
              @Override
              public IntermediateCatchSignalEventActivityBehavior createIntermediateCatchSignalEventActivityBehavior(
                  IntermediateCatchEvent intermediateCatchEvent,
                  SignalEventDefinition signalEventDefinition, Signal signal) {


                return new IntermediateCatchSignalEventActivityBehavior(signalEventDefinition,
                    signal) {
                
                  private static final long serialVersionUID = 1L;

                  @Override
                  public void execute(DelegateExecution execution) {
                    CommandContext commandContext = Context.getCommandContext();
                    ExecutionEntity executionEntity = (ExecutionEntity) execution;

                    String signalName = null;

                    Expression signalExpression =
                        commandContext.getProcessEngineConfiguration().getExpressionManager()
                            .createExpression(signalEventDefinition.getSignalExpression());
                    signalName = signalExpression.getValue(execution).toString();


                    commandContext.getEventSubscriptionEntityManager().insertSignalEvent(signalName,
                        signal, executionEntity);
                  }

                };
              }

            })&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;I removed signalRef completely But you can tweak the code and use both flavour.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;-Vishal&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 15:05:07 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34149#M14416</guid>
      <dc:creator>vgaur</dc:creator>
      <dc:date>2020-02-28T15:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Expression in Intermidiate Catching event</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34150#M14417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://migration33.stage.lithium.com/t5/user/viewprofilepage/user-id/32907"&gt;@vgaur&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for posting your solution - really helpful to other hub members.&lt;/P&gt;
&lt;P&gt;Kind regards,&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 09:39:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/conditional-expression-in-intermidiate-catching-event/m-p/34150#M14417</guid>
      <dc:creator>EddieMay</dc:creator>
      <dc:date>2020-03-02T09:39:09Z</dc:date>
    </item>
  </channel>
</rss>

