Class WorkflowTemplate

All Implemented Interfaces:
Serializable, Comparable

@Deprecated(since="ages", forRemoval=false) public class WorkflowTemplate extends GeneratedWorkflowTemplate
Deprecated.
since ages - as of release 4.3, please useWorkflowTemplateModel

Template for creating an workflow instance. The instance will be getting the attributes of this template.

See Also:
  • Constructor Details

    • WorkflowTemplate

      public WorkflowTemplate()
      Deprecated.
  • Method Details

    • createItem

      protected Item createItem(SessionContext ctx, ComposedType type, Item.ItemAttributeMap allAttributes) throws JaloBusinessException
      Deprecated.
      Description copied from class: Item
      Has to be implemented for each concrete subtype of item. This method is responsible for creating a new item instance ( by calling managers, ejb homes, etc. ) during ComposedType.newInstance(Map).

      In case this method uses any of the attribute values during creation it is required to override Item.getNonInitialAttributes(SessionContext, ItemAttributeMap) too.
      Sn example:

      
       public static final String MY_ATTRIBUTE = "someAttribute"; ... protected Item createItem(SessionContext
       ctx, ComposedType type, Map allAttributes ) throws JaloBusinessException { MyManager man = ... return
       man.createMyItem( (String)allAttributes.get(MY_ATTRIBUTE) );
       // here MY_ATTRIBUTE is used for creation, so it must not be set again } protected Map getNonInitialAttributes(
       SessionContext ctx, Map allAttributes ) { // let superclass remove its own initial attributes Map ret =
       super.getNonInitialAttributes( ctx, allAttributes );
       // remove MY_ATTRIBUTE from all attributes since if has already been set ret.remove(MY_ATTRIBUTE); return ret; }
      
       
      Overrides:
      createItem in class Job
      Parameters:
      ctx - the current session context which this item is created within
      type - the actual item type ( since subtypes may not provide a own jalo class this may be different from the type which this method was implemented for )
      Returns:
      the new item instance
      Throws:
      JaloBusinessException - indicates an error during creation - any changes will be rollbacked
    • createWorkflow

      @Deprecated(since="ages", forRemoval=false) public Workflow createWorkflow()
      Deprecated.
      since ages - as of release 4.3, plase use WorkflowService.createWorkflow(WorkflowTemplateModel, de.hybris.platform.core.model.user.UserModel)

      Creates a new workflow instance using this template for getting attributes.

      Returns:
      new workflow instance
    • createActions

      protected List<WorkflowAction> createActions(Workflow workflow)
      Deprecated.
      Creates new actions corresponding to the action templates set to this workflow template. Also creates the decisions and links associated
      Parameters:
      workflow - workflow instance set to the new action instances
      Returns:
      list of created actions
    • copyAndConnectionAttribute

      public void copyAndConnectionAttribute(WorkflowDecisionTemplate workflowDecisionTemplate, List<WorkflowAction> workflowActions, WorkflowDecision newDecision)
      Deprecated.
      Sets the andConntection Attribute on the extendet Relation WorkflowActionLinkRelation.
      Parameters:
      workflowDecisionTemplate - The decisionTemplate which holds the source for the copy.
      workflowActions - The list actions in this workflow.
      newDecision - The new workflowDecision which holds the target of the copy.
    • getWorkAction

      protected WorkflowAction getWorkAction(WorkflowActionTemplate templateAction, List<WorkflowAction> workflowActions)
      Deprecated.
      Gets the action out of given action list which was created by given action template.
      Parameters:
      templateAction - template for which a corresponding action is searched
      workflowActions - list of actions which will be searched
      Returns:
      the action that was created based on given action template
    • performCronJob

      protected CronJob.CronJobResult performCronJob(CronJob cronJob) throws AbortCronJobException
      Deprecated.
      Description copied from class: Job
      You have to implement this method in your Job. Here you can execute the job. You have to return a CronJobResult that indicates whether the Job was successfully executed or not.
      Specified by:
      performCronJob in class Job
      Parameters:
      cronJob - the CronJob to execute
      Returns:
      a CronJobResult that indicates whether the Job was successfully executed or not.

      Throws:
      AbortCronJobException
      See Also:
    • addToActions

      public void addToActions(SessionContext ctx, WorkflowActionTemplate value)
      Deprecated.
      Description copied from class: GeneratedWorkflowTemplate
      Generated method - Adds value to actions.
      Overrides:
      addToActions in class GeneratedWorkflowTemplate
      value - the item to add to actions - n-part of the WorkflowTemplateActionTemplateRelation; set of action templates from which a action will be created and set to the workflow created by the workflow template each
    • remove

      public void remove(SessionContext ctx) throws ConsistencyCheckException
      Deprecated.
      Description copied from class: Job
      First all assigned CronJobs were removed, than the Job itself.
      Overrides:
      remove in class Job
      Parameters:
      ctx - A SessionContext object
      Throws:
      ConsistencyCheckException - if this item could not be removed for some reason
      See Also:
    • setOwner

      public void setOwner(Item item) throws ConsistencyCheckException
      Deprecated.
      Overrides:
      setOwner in class Item
      Throws:
      ConsistencyCheckException
    • isValidWorkflowTemplateActions

      protected boolean isValidWorkflowTemplateActions()
      Deprecated.
      checks if all workflow template actions have at least one option, except for the actions with action type end
      Returns:
      true if all workflow template actions have at least one option