Package akka.actor

Examples of akka.actor.ActorRef


         * handeled by other components of the engine
         */
        if (sequenceFlowJaxb.getTargetRef() instanceof TFlowNode) {
         
          // actor reference
          ActorRef actorRef = new ActorReferenceService().getActorReference(
              IdService.getUniqueFlowNodeId(clientId, processJaxb, subProcessesJaxb,
                  (TFlowNode) sequenceFlowJaxb.getTargetRef()));
         
          // conditional expression
          String expressionString = this.getConditionalExpressionString(sequenceFlowJaxb);
View Full Code Here


  public static Map<ActorRef,Expression> createJexlExpressions(Map<ActorRef,String> expressions) {
    Map<ActorRef,Expression> result = new TreeMap<ActorRef, Expression>();
   
    Iterator<ActorRef> it = expressions.keySet().iterator();
    while (it.hasNext()) {
      ActorRef actorRef = it.next();
      if(expressions != null) {
        result.put(actorRef, createJexlExpression(expressions.get(actorRef)));
      } else {
        System.out.println("###################### expressions NULL!!!");
      }
View Full Code Here

  public void dispatchToEngine(IntegrationMessage integrationMessage, Map<String, Object> metaData) {

    // get the actor to send the integration message to
    String targetNodeActorString = uniqueFlowNodeIdToActorRefMap
        .get(integrationMessage.getUniqueFlowNodeId());
    ActorRef targetNodeActor = this.actorSystem
        .actorFor("user/" + targetNodeActorString);
   
    // create the integration message
    TriggerMessage triggerMessage = new TriggerMessage(
        integrationMessage.getProcessInstanceId(),
        integrationMessage.getPayload());

    LOG.debug("Message Dispatcher sending trigger message to " + targetNodeActor);
   
    // send the integration message to the actor
    targetNodeActor.tell(triggerMessage, null);
   
    // send the meta data to the meta data actor (if it is not a start event, which can not collect meta data)
    if (integrationMessage.getProcessInstanceId() != null) {
      MetaDataMessage metaDataMessage = new MetaDataMessage(integrationMessage.getProcessId(), integrationMessage.getProcessInstanceId(), metaData);
     
View Full Code Here

        .toString()));
   
    // FIXME: this is a bugfix, because messages are not properly sent without
    // prior calling of the actorSystem
    String ars = targetNode.path().toString();
    ActorRef ar = actorSystem.actorFor(ars);
    ar.tell(message, this.getSelf());
   
//    targetNode.tell(message, this.getSelf());
  }
View Full Code Here

          actorRef.toString()));
     
      // FIXME: this is a bugfix, because messages are not properly sent without
      // prior calling of the actorSystem
      String ars = actorRef.path().toString();
      ActorRef ar = actorSystem.actorFor(ars);
      ar.tell(message, this.getSelf());
     
//      actorRef.tell(message, this.getSelf());
    }
  }
View Full Code Here

   
    // write changes to db
    this.getNodeInstanceMediatorService().persistChanges();
   
    // fire for every incoming sequence
    ActorRef outgoingSequence = this.evaluateOutGoingSequence(iid);
    if(outgoingSequence != null) {
      super.sendMessageToNodeActor(new ActivationMessage(iid), outgoingSequence);
    } else if (this.defaultOutgoingSequence != null) {
      super.sendMessageToNodeActor(new ActivationMessage(iid), this.defaultOutgoingSequence);
    } else {
View Full Code Here

    Iterator<ActorRef> it = this.conditionalExpressionStrings.keySet().iterator();
    // fill the context once and use it for every expression
    JexlContext context = ExpressionService.fillContext(this.usedDataObjectIds, this.dataObjectHandler, this.uniqueProcessId, iid);
   
    while (it.hasNext()) {
      ActorRef actorRef = it.next();
      Expression expression = this.conditionalExpressionStrings.get(actorRef);
      if(ExpressionService.evaluateToBoolean(expression, context)) {
        return actorRef;
      }
    }
View Full Code Here

   * @see com.catify.processengine.management.ProcessManagementService#sendTriggerMessage(java.lang.String, com.catify.processengine.core.messages.TriggerMessage)
   */
  @Override
  public void sendTriggerMessage(String uniqueFlowNodeId, TriggerMessage triggerMessage) {

    ActorRef actorRef = new ActorReferenceService().getActorReference(uniqueFlowNodeId);
   
    LOG.debug("Sending TriggerMessage to " + actorRef);
   
    actorRef.tell(triggerMessage, null);
 
View Full Code Here

  private ActorRef createNodeServiceActor(String clientId,
      TProcess processJaxb, ArrayList<TSubProcess> subProcessesJaxb, TFlowNode flowNodeJaxb,
       List<TSequenceFlow> sequenceFlowsJaxb) {
   
    // create flow node actors (a bridge factory is used to be able to pass parameters to the UntypedActorFactory)
    ActorRef nodeServiceActor = this.actorSystem.actorOf(new Props(
        new ServiceNodeBridge(clientId, processJaxb, subProcessesJaxb, flowNodeJaxb, sequenceFlowsJaxb)
          ).withDispatcher("file-mailbox-dispatcher"), ActorReferenceService.getActorReferenceString(
            IdService.getUniqueFlowNodeId(clientId, processJaxb, subProcessesJaxb, flowNodeJaxb)));
   
    LOG.debug(String.format("%s --> resulting akka object: %s", flowNodeJaxb,
        nodeServiceActor.toString()));
    return nodeServiceActor;
  }
View Full Code Here

  }

  @Override
  protected void activate(ActivationMessage message) {

    ActorRef serviceTaskInstance = this.getContext().actorOf(new Props(
        new UntypedActorFactory() {
          private static final long serialVersionUID = 1L;

          // create an instance of a (synchronous) service worker
          public UntypedActor create() {
              return new ServiceTaskInstance(getUniqueProcessId(), getUniqueFlowNodeId(),
                  getOutgoingNodes(), messageIntegrationInOut, getDataObjectService());
          }
        }), ActorReferenceService.getAkkaComplientString(message.getProcessInstanceId()));
    LOG.debug(String.format("Service task instance craeted %s --> resulting akka object: %s", this.getClass(),
        serviceTaskInstance.toString()));
   
    this.sendMessageToNodeActor(message, serviceTaskInstance);
  }
View Full Code Here

TOP

Related Classes of akka.actor.ActorRef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.