Package org.uengine.kernel

Examples of org.uengine.kernel.ProcessVariable


      String messageName = act.getMessage().replace(' ', '_');
*/
    for(int j=0; j<messageDefinitions.length; j++){
     
      ParameterContext[] vars = messageDefinitions[j].getParameters();
      ProcessVariable var = null;
      String messageName = messageDefinitions[j].getName();     
     
      boolean bCustomizedStarter = false;
      if(starterMessage!=null && messageDefinitions[j].equals(starterMessage)){
        bCustomizedStarter = true;
      }
     
      out.print("  public " + (bCustomizedStarter ? "String on" + messageName + "(" : "void on" + messageName + "(String instanceId" ));

      if(vars!=null){
        String sep = (bCustomizedStarter ? "":", ");
        for(int i=0; i<vars.length; i++){
          try{
            ProcessVariable pvd = vars[i].getVariable();
            Class type = null;
            if(pvd!=null){
              type = pvd.getType();
            }else{
              type = (Class)vars[i].getType();
            }
           
            //review: messagedefinition need a field, which contains parameter type in Class
            out.print( sep + getActualTypeName(type) + " " + vars[i].getArgument());
            sep = ", ";
          }catch(Exception e){
            throw new UEngineException("Can't resolve type information of message '" + messageName + "', property '" + vars[i].getArgument()+"'");
          }
        }
      }else if(var!=null){       
        out.print(", " + getActualTypeName(var.getType()) + " " + var.getName());
      }
     
      out.print(") throws java.rmi.RemoteException");
     
      if(isInterface){
        out.println(";");
      }else{
        out.println("{");
        out.println("    try{");
       
        if(bCustomizedStarter ){
          out.println("      String instanceId = _startAndSendMessage(new Object[]{\"" + proc.getName() + "\", \"" + messageName +"\"");
        }else
          out.print  ("      _sendMessage(new Object[]{instanceId, \"" + messageName +"\"");
       
        if(vars!=null){
          for(int i=0; i<vars.length; i++){
            try{
              ProcessVariable pvd = vars[i].getVariable();
              Class type = null;
              if(pvd!=null){
                type = pvd.getType();
              }else{
                type = (Class)vars[i].getType();
              }
           
              out.print(", " + convert2Object(type, vars[i].getArgument().getText()));
View Full Code Here


    for(int i=0; i<selectedActivityComponents.size(); i++){
      ActivityDesigner activityDesigner = (ActivityDesigner)selectedActivityComponents.get(i);
      if(activityDesigner instanceof ArrowTargetSource){
        ArrowTargetSource arrowTargetSource = ((ArrowTargetSource)activityDesigner);
       
        ProcessVariable variables[] = processDefinition.getProcessVariables();
        if(variables !=null)
        for(int j=0; j<variables.length; j++){
          java.util.List links = arrowTargetSource.getArrowLinkingInfo(variables[j]);

          if(links!=null)
View Full Code Here

  public Serializable getProcVar(String key) throws Exception {
    if (StringUtils.isEmpty(key))
      return null;
    Serializable retObj = null;
    if (pdRemote != null && piRemote != null) {
      ProcessVariable variable = pdRemote.getProcessVariable(key);

      if (variable == null)
        throw new UEngineException(
            "Undeclared process variable reference : " + key);
View Full Code Here

    return (instance!=null ? instance.getProcessDefinition().evaluateContent(instance, getFtpFileNamePattern()).toString() : getFtpFileNamePattern());
  }

  public void beforeOpen(ProcessInstance instance, String variableKey) throws Exception {
   
    ProcessVariable theVariable;
    FileContext defaultValue;
    if(instance!=null){
      theVariable = instance.getProcessDefinition().getProcessVariable(variableKey);
      defaultValue = (FileContext)theVariable.getDefaultValue();
    }else
      defaultValue = this;

    //document source
    String docFileURL = (UEngineUtil.isNotEmpty(getPath()) ? getPath() : defaultValue.getTemplateFilePath());
View Full Code Here

    is.close();
    workbook.close();     
  }
 
  public boolean doCommand(ProcessInstance instance, String variableKey) throws Exception {
    ProcessVariable theVariable = instance.getProcessDefinition().getProcessVariable(variableKey);
    FileContext defaultValue = (FileContext)theVariable.getDefaultValue();
   
    if(defaultValue.getTemplateFilePath()!=null && defaultValue.getTemplateFilePath().endsWith(".xls")){
      //parse the completed xsl file and reflect the changes to the corresponding process variables.//
      ProcessDefinition definition = instance.getProcessDefinition();
     
View Full Code Here

    java.util.List arrowLinkList = new ArrayList();
   
    SubProcessActivity subProcessAct = (SubProcessActivity)getActivity();
   
    if(forWhat instanceof ProcessVariable && subProcessAct.getVariableBindings()!=null && subProcessAct.getVariableBindings().length > 0){
      ProcessVariable wannaBeLinked = (ProcessVariable)forWhat;
     
      ParameterContext[] variableBindings = subProcessAct.getVariableBindings();
      for(int i=0; i<variableBindings.length; i++){
        if(wannaBeLinked==variableBindings[i].getVariable()){
       
          ArrowLinkingInfo arrowLinkingInfo = new ArrowLinkingInfo();
         
          Point linkPoint;
         
          if(collapsed){
            linkPoint = new Point(i * getWidth()/variableBindings.length, getHeight());
          }else{
            ProcessVariable boundSubProcessVariable = subProcDef.getProcessVariable(variableBindings[i].getArgument().getText());
            JLabel labelForBoundSubProcessVariable = subProcessDesignerComponent.processVariableInformationPanel.getJLabel(boundSubProcessVariable);
           
            if(labelForBoundSubProcessVariable==null) continue;
           
            linkPoint = UEngineUtil.getRelativeLocation(this, labelForBoundSubProcessVariable);
View Full Code Here

    ActivityFor forLoopForAddingCommandVariables = new ActivityFor(){

      public void logic(Activity activity) {
        if (!(activity instanceof HumanActivity)) return;
       
        ProcessVariable commandVariable = new ProcessVariable();
        final HumanActivity finalActivity = (HumanActivity)activity;
       
        variables.add(new ActivityDueDatePointingProcessVariable(finalActivity));
      }
     
View Full Code Here

    proc.setactivity_Group(actGrp)
   
    //setting variables
    tVariables variables = new tVariables();
   
    ProcessVariable pvds[] = srcProcDef.getProcessVariables();
    for(int i=0; i<pvds.length; i++){
      ProcessVariable pvd = pvds[i];
      tVariable variable = new tVariable();
      variable.setname_Attribute(new XNCName(BPELSerializer.toSafeName(pvd.getName(), "variable"+i)));
     
      //review: should be xsi type
      variable.settype_Attribute(getXSDTypeName(pvd));   
      variables.addvariable(variable);
    }
   
    Vector addVariables = (Vector)context.get("addVariables");
    for(Enumeration enumeration = addVariables.elements(); enumeration.hasMoreElements(); ){
      Object [] varCtx = (Object[])enumeration.nextElement();
     
      String variableName = (String)varCtx[0];
      XQName variableType = (XQName)varCtx[1];
      
      tVariable variable = new tVariable();
      variable.setname_Attribute(new XNCName(variableName) );
     
      //review: should be xsi type
      variable.setmessageType_Attribute(variableType);   
      variables.addvariable(variable);
    }
   
    proc.setvariables(variables);     
    //
   
    //setting partners
    tPartnerLinks partnerLinks = new tPartnerLinks();
   
    Role roles[] = srcProcDef.getRoles();
    for(int i=0; i<roles.length; i++){
      Role role = roles[i];
      tPartnerLink partnerLink = new tPartnerLink();
      String roleName = BPELSerializer.toSafeName(role.getName(), "role"+i);     
      partnerLink.setname_Attribute(new XNCName(roleName));
      partnerLink.setpartnerLinkType_Attribute(new XQName("sdns", "", roleName + "PartnerLinkType"));
      partnerLink.setpartnerRole_Attribute(new XNCName("partnerRole"));
      partnerLinks.addpartnerLink(partnerLink);
    }
    //add my role
    tPartnerLink partnerLink = new tPartnerLink();
    partnerLink.setname_Attribute(new XNCName("myRole") );
    partnerLink.setpartnerLinkType_Attribute(new XQName("sdns", "", srcProcName + "PartnerLinkType"));
    partnerLink.setpartnerRole_Attribute(new XNCName("myRole"));
    partnerLinks.addpartnerLink(partnerLink);
    //
   
    proc.setpartnerLinks(partnerLinks);   
    //
   
    //setting correlations   
    tCorrelationSets correlationSets = new tCorrelationSets();
    for(int i=0; i<roles.length; i++){
      Role role = roles[i];
      ProcessVariable identifier = role.getIdentifier();
      if(identifier==null) identifier = srcProcDef.getProcessVariables()[0];//continue;
     
      tCorrelationSet correlationSet = new tCorrelationSet();
      correlationSet.setname_Attribute(new XNCName(BPELSerializer.toSafeName(role.getName(), "role"+i)+"Identification"));
      //review:
      correlationSet.setproperties_Attribute(new XQName("sdns","","property_" + identifier.getName()));
      correlationSets.addcorrelationSet(correlationSet);
    }
    proc.setcorrelationSets(correlationSets);
    //   
   
View Full Code Here

      Vector pvdVector = new Vector();
   
      for(Iterator iter = srcProcDef.getVariables().iterator(); iter.hasNext();){
        Variable var = (Variable)iter.next();
       
        ProcessVariable pvd = new ProcessVariable();
       
        pvd.setName(var.getName());
        //pvd.setQName(var.gettype_Attribute().get());
        pvdVector.add(pvd);
      }
   
      ProcessVariable[] pvds = new ProcessVariable[pvdVector.size()];
View Full Code Here

    {
      Vector pvdVector = new Vector();
   
      tVariables variables = srcProc.getvariables();
      for(Enumeration enumeration = variables.enumeratevariable(); enumeration.hasMoreElements();){
        ProcessVariable pvd = new ProcessVariable();
        tVariable var = (tVariable)enumeration.nextElement();
        pvd.setName(var.getname_Attribute().get());
        //pvd.setQName(var.gettype_Attribute().get());
        pvdVector.add(pvd);
      }
   
      ProcessVariable[] pvds = new ProcessVariable[pvdVector.size()];
View Full Code Here

TOP

Related Classes of org.uengine.kernel.ProcessVariable

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.