How do I name sub-workflow actions in parent workflow? - oozie

I have created an Oozie workflow that consists of multiple sub-workflow actions. When the workflow is executed and I look at it in HUE and in the graph tab all the actions are named subworkflow and therefor no way to distinguish between them other than clicking on the sub-workflow action that takes you to a new page but this is obviously very inefficient.
How can I explicitly name each sub-workflow action so that I can see the name in the graph instead of just the generic name subworkflow?
Please see attached screenshot.
I'm running Oozie version 4.1.0-cdh5.10.0 & HUE 3

You can edit the workfolw name as below,
Or edit the json file with name: "/subworkflow"/

Related

Symfony event vs service

Hi I have a question about symfony application architecture,
In my application I create different user, but when a user is created, updated, deleted, or his picture change, I need to do some action.
What is the best way to do this ? I excluded to do this on a controller action. There is 2 others solutions :
Create differents events like user.created, user.updated, ... And dispatch it on the controller action and make different listener to do the different action like MailListener (for user.created) TaskListener (for user.created) for add a task.
Use a service like UserManager and on this service have a method like userCreated() and on this method call differents actions like sendMailOnCreated, addTaskOnCreated for example.
For you what is the best method ?
For me, your first solution is the best one. It's clearly a use case for the Event component. It will be easier to maintain and more readable.
Moreover, if you need to add more listener you just need to create another one and bind it to your event. You don't need to modify your controller anymore.

How can I set the data into a template dynamically?

I have a list of Task objects.
I have a template which contains a modal form to edit a task.
When a user clicks the link to a single Task I want to set the task to be edited to the Task that was clicked and then render the form.
I'm trying it with reactive variables and Tracker.depend. But I haven't quite gotten it working yet. The data on Template.taskUpdateForm doesn't get set properly.
Please see this commit to see what I'm working on.
https://github.com/laran/eisenhower/commit/e89890d49f5b772849d09fd1f719a6cdafa58125
When you click on a task to edit, just store it's _id or the whole task in a Session variable, and in the helper function for your modal use that same session variable. No need to worry about Tracker depend. This always works for me.
I was setting the selectedTask to the wrong thing. I just needed SelectedTask.set(this.task) instead of SelectedTask.set(this)

Using and call bookamrk in activities using rehosted

I'm using WF, I res-hosted the designer, and everything is fine till i need in my custom activities to wait a value when workflow is running, that what i made using BOOKMARK. i tried bookmark in ConsoleApplication and its work.
the following code i used in the main class in the ConsoleApplication:
AutoResetEvent syncEvent = new AutoResetEvent(false);
wa.Completed = delegate(WorkflowApplicationCompletedEventArgs r)
{
syncEvent.Set();
};
wa.Run();
wa.ResumeBookmark("bookmarkName", Console.ReadLine());
syncEvent.WaitOne();
but here in my rehosted project, i need to call many workflows. not only 1. and I can't specify it before runtime.
for this method:
wa.ResumeBookmark("bookmarkName", Console.ReadLine());
1st argument: bookmarks' names, i tried and i found i can name all bookmarks the same name.
About the 2nd argument, how can I pass the value for each workflow, and some workflows have more than 1 bookmark.
I have to read the value from many places, asp.net pages, DB and others.
Im sure there is something like these in WF 4.0, but i didnt find it. can u help me please :)
Thank you.
You need to keep track of each workflow's Id, and record that Id when a bookmark is created. Once you wish to return to the workflow, you can search for the one with the matching Id and then resume your bookmark.

ASP.NET options/command generator framework?

I want to put context-sensitive, dynamic command options on my asp.net pages.
I tried coding my own command structure but it's not very good, and I'm sure there must be a framework for doing this somewhere I can re-use?
Example:
I have a detailsview for some database object, I want to code in the object class what commands are available, based on the state of the object. I then want a UI object I can place on the webform that will pass commands back to the object when user clicks them, or jump to a different link (e.g. when additional parameters are available).
e.g. form might look like this
Product Details
Name: XXXX product
Price: $1.00
Qty: 1
Commands:
> Edit
> New Stock
> Mark as obsolete
So the commands at the bottom would have very little UI code and pass actions back to the object. For example the New Stock command would jump to a new page to ask for a quantity.
I don't know of the framework, but you could create something yourself. Let's say you are using MVP pattern, and assuming that this is a CRUD application, you could tell each view what type of object it is related to, then annotate you object with operations that are available. Then Presenter could call Service to perform the operation. You could name your methods using some convention so that you can wire it up in a Service. It is a lot of work, and unless you have 100s of views it is not worth while. I am building app that is about that size, and I am in process of creating GenericMVP framework, that would make wiring a breeze.

Possible to save a node using a multi-step form?

I'm building a Drupal based site that requires the communication of a node ID to a seperate web service. This web service handles the uploading of files to a seperate server (from the one Drupal is on).
This creates a problem where in if I create a new node, the Node ID is not generated until the form is submitted - meaning I can't attach the files until I save the node and open it back up to edit it. I'd like to remove that step.
Is it possible to create a two step node creation process where the basics of the node are submitted and saved, and then the form re-directs to step two where I can attach the files?
I'd also consider an AJAX enabled node submission form - but that seems to add even more complexity to the situation.
Any advice, examples will be appreciated!
you could do this with a multi-step form. see http://pingv.com/blog/ben-jeavons/2009/multi-step-forms-drupal-6-using-variable-functions for the canonical way to do this (besides the code, also check the comments).
you could also do it by adding a second submit handler to the form. the first, default one (node_form_submit) saves your node (including the attached file) the standard Drupal way. the second handler could upload the file to the separate server, do upload error checking, delete the file from the Drupal DB, etc. you can add an additional submit handler to a Drupal 6 form by adding it to the form's #submit property, either in the form definition or via hook_form_alter / hook_form_FORM_ID_alter.
Depending on what exactly you want to do, you might use hook_nodeapi on its 'insert' operation. It is fired after successful node creation, so the node object will contain the newly assigned nid there already.
NOTE: The wording of the API documentation is a bit ambiguous concerning the 'insert' and 'update' operations:
"insert": The node is being created
(inserted in the database).
This sounds like it is right in the middle of the process, whereas the node has already been created at this point.
I guess the node_save function can help you.
I ran into exactly this same issue and did it the wrong way. I added the hook myself.
http://drupal.org/node/313389

Resources