Package org.activiti.bpmn.model

Examples of org.activiti.bpmn.model.Activity


    ContainerShape targetContainer = null;
    if (source instanceof BoundaryEvent) {
      BoundaryEvent boundaryEvent = (BoundaryEvent) source;
      if (boundaryEvent.getAttachedToRef() != null) {
        Activity attachedActivity = boundaryEvent.getAttachedToRef();
        targetContainer = (ContainerShape) getFeatureProvider().getPictogramElementForBusinessObject(attachedActivity);
      }
    } else {
      targetContainer = (ContainerShape) context.getSourcePictogramElement();
    }
View Full Code Here


            SubProcess subProcess = (SubProcess) element;
            loopThroughElements(subProcess.getFlowElements(), subProcess);
            loopThroughElements(subProcess.getArtifacts(), subProcess);
          }
          if(element instanceof Activity) {
            Activity activity = (Activity) element;
            for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
              updateFlowElement(boundaryEvent);
            }
          }
        } else if (element instanceof Artifact) {
          if (element instanceof Association) {
View Full Code Here

   * @param bo the business object (must be an activity, otherwise nothing will occur here)
   * @param reverse if <code>true</code> the buttons are updated, otherwise the business object.
   */
  private void updateButtonStates(final Object bo, boolean reverse) {
    if (bo instanceof Activity) {
      final Activity activity = (Activity) bo;

      if (reverse) {
        asyncButton.setSelection(activity.isAsynchronous());
        exclusiveButton.setSelection(!activity.isNotExclusive());
      } else {
        activity.setAsynchronous(asyncButton.getSelection());
        activity.setNotExclusive(!exclusiveButton.getSelection());
      }
    }
  }
View Full Code Here

   
    Object bo = getBusinessObject(pe);
    if (bo == null || bo instanceof Activity == false)
      return;
   
    Activity activity = (Activity) bo;
    MultiInstanceLoopCharacteristics multiInstanceDef = (MultiInstanceLoopCharacteristics) activity.getLoopCharacteristics();
   
    loopCardinaltyText.removeFocusListener(listener);
    collectionText.removeFocusListener(listener);
    elementVariableText.removeFocusListener(listener);
    completionConditionText.removeFocusListener(listener);
View Full Code Here

    PictogramElement pe = getSelectedPictogramElement();
    if (pe == null) return;
   
    final Object bo = getBusinessObject(pe);
    if (bo instanceof Activity == false) return;
    final Activity activity = (Activity) bo;
   
   
    DiagramEditor diagramEditor = (DiagramEditor) getDiagramEditor();
    TransactionalEditingDomain editingDomain = diagramEditor.getEditingDomain();
    ActivitiUiUtil.runModelChange(new Runnable() {
View Full Code Here

      if(element instanceof SubProcess) {
        determinedId = loopThroughElements(featureClass, determinedId, ((SubProcess) element).getFlowElements(), featureIdKey);
      }
     
      if(featureClass == BoundaryEvent.class && element instanceof Activity) {
        Activity activity = (Activity) element;
        for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
          if (boundaryEvent.getId() != null) {
            String contentObjectId = boundaryEvent.getId().replace(featureIdKey, "");
            determinedId = getId(contentObjectId, determinedId);
          }
        }
View Full Code Here

      currentFlowElement.setId(elementId);
      currentFlowElement.setName(elementName);
     
      if(currentFlowElement instanceof Activity) {
       
        Activity activity = (Activity) currentFlowElement;
        activity.setAsynchronous(async);
        activity.setNotExclusive(notExclusive);
        if(StringUtils.isNotEmpty(defaultFlow)) {
          activity.setDefaultFlow(defaultFlow);
        }
      }
     
      if(currentFlowElement instanceof Gateway) {
        if(StringUtils.isNotEmpty(defaultFlow)) {
View Full Code Here

    didWriteExtensionStartElement = false;
    writeDefaultAttribute(ATTRIBUTE_ID, flowElement.getId(), xtw);
    writeDefaultAttribute(ATTRIBUTE_NAME, flowElement.getName(), xtw);
   
    if (flowElement instanceof Activity) {
      Activity activity = (Activity) flowElement;
      if (activity.isAsynchronous()) {
        writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_ASYNCHRONOUS, ATTRIBUTE_VALUE_TRUE, xtw);
      }
      if (activity.isNotExclusive()) {
        writeQualifiedAttribute(ATTRIBUTE_ACTIVITY_EXCLUSIVE, ATTRIBUTE_VALUE_FALSE, xtw);
      }
      writeDefaultAttribute(ATTRIBUTE_ACTIVITY_DEFAULT, activity.getDefaultFlow(), xtw);
    }
   
    writeAdditionalAttributes(flowElement, xtw);
    if (StringUtils.isNotEmpty(flowElement.getDocumentation())) {

      xtw.writeStartElement(ELEMENT_DOCUMENTATION);
      xtw.writeCharacters(flowElement.getDocumentation());
      xtw.writeEndElement();
    }
    writeAdditionalChildElements(flowElement, xtw);
   
    writeListeners(flowElement, xtw);
   
    if (didWriteExtensionStartElement) {
      xtw.writeEndElement();
    }
   
    if (flowElement instanceof Activity) {
      Activity activity = (Activity) flowElement;
      if (activity.getLoopCharacteristics() != null) {
        MultiInstanceLoopCharacteristics multiInstanceObject = activity.getLoopCharacteristics();
        if (StringUtils.isNotEmpty(multiInstanceObject.getLoopCardinality()) ||
            StringUtils.isNotEmpty(multiInstanceObject.getInputDataItem()) ||
            StringUtils.isNotEmpty(multiInstanceObject.getCompletionCondition())) {
         
          xtw.writeStartElement(ELEMENT_MULTIINSTANCE);
View Full Code Here

    flowElement.setDocumentation(getPropertyValueAsString(PROPERTY_DOCUMENTATION, elementNode));
   
    convertJsonToListeners(elementNode, flowElement);
   
    if (flowElement instanceof Activity) {
      Activity activity = (Activity) flowElement;
      activity.setAsynchronous(getPropertyValueAsBoolean(PROPERTY_ASYNCHRONOUS, elementNode));
      activity.setNotExclusive(!getPropertyValueAsBoolean(PROPERTY_EXCLUSIVE, elementNode));
     
      String multiInstanceCardinality = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_CARDINALITY, elementNode);
      String multiInstanceCollection = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_COLLECTION, elementNode);
      String multiInstanceCondition = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_CONDITION, elementNode);
     
      if (StringUtils.isNotEmpty(multiInstanceCardinality) || StringUtils.isNotEmpty(multiInstanceCollection) ||
          StringUtils.isNotEmpty(multiInstanceCondition)) {
       
        String multiInstanceVariable = getPropertyValueAsString(PROPERTY_MULTIINSTANCE_VARIABLE, elementNode);
       
        MultiInstanceLoopCharacteristics multiInstanceObject = new MultiInstanceLoopCharacteristics();
        multiInstanceObject.setSequential(getPropertyValueAsBoolean(PROPERTY_MULTIINSTANCE_SEQUENTIAL, elementNode));
        multiInstanceObject.setLoopCardinality(multiInstanceCardinality);
        multiInstanceObject.setInputDataItem(multiInstanceCollection);
        multiInstanceObject.setElementVariable(multiInstanceVariable);
        multiInstanceObject.setCompletionCondition(multiInstanceCondition);
        activity.setLoopCharacteristics(multiInstanceObject);
      }
    }
    if (parentElement instanceof Process) {
      ((Process) parentElement).addFlowElement(flowElement);
    } else if (parentElement instanceof SubProcess) {
View Full Code Here

      outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(sequenceFlow.getId()));
    }
   
    if (flowElement instanceof Activity) {
     
      Activity activity = (Activity) flowElement;
      for (BoundaryEvent boundaryEvent : activity.getBoundaryEvents()) {
        outgoingArrayNode.add(BpmnJsonConverterUtil.createResourceNode(boundaryEvent.getId()));
      }
     
      if (activity.isAsynchronous()) {
        propertiesNode.put(PROPERTY_ASYNCHRONOUS, PROPERTY_VALUE_YES);
      }
     
      if (activity.isNotExclusive()) {
        propertiesNode.put(PROPERTY_EXCLUSIVE, PROPERTY_VALUE_NO);
      }
     
      if (activity.getLoopCharacteristics() != null) {
        MultiInstanceLoopCharacteristics loopDef = activity.getLoopCharacteristics();
        if (StringUtils.isNotEmpty(loopDef.getLoopCardinality()) || StringUtils.isNotEmpty(loopDef.getInputDataItem()) ||
            StringUtils.isNotEmpty(loopDef.getCompletionCondition())) {
         
          if (loopDef.isSequential() == false) {
            propertiesNode.put(PROPERTY_MULTIINSTANCE_SEQUENTIAL, PROPERTY_VALUE_NO);
          }
          if (StringUtils.isNotEmpty(loopDef.getLoopCardinality())) {
            propertiesNode.put(PROPERTY_MULTIINSTANCE_CARDINALITY, loopDef.getLoopCardinality());
          }
          if (StringUtils.isNotEmpty(loopDef.getInputDataItem())) {
            propertiesNode.put(PROPERTY_MULTIINSTANCE_COLLECTION, loopDef.getInputDataItem());
          }
          if (StringUtils.isNotEmpty(loopDef.getElementVariable())) {
            propertiesNode.put(PROPERTY_MULTIINSTANCE_VARIABLE, loopDef.getElementVariable());
          }
          if (StringUtils.isNotEmpty(loopDef.getCompletionCondition())) {
            propertiesNode.put(PROPERTY_MULTIINSTANCE_CONDITION, loopDef.getCompletionCondition());
          }
        }
      }
     
      if (activity instanceof UserTask) {
        addListeners(((UserTask) activity).getTaskListeners(), false,  propertiesNode);
      } else {
        addListeners(activity.getExecutionListeners(), true,  propertiesNode);
      }
    }
   
    flowElementNode.put("outgoing", outgoingArrayNode);
  }
View Full Code Here

TOP

Related Classes of org.activiti.bpmn.model.Activity

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.